Category: ios8
-
Understand and Use Closures in Swift
Have you ever seen some factory method in UIKit and see this strange parameter called completion or completionHandler? Usually you put nil there and leave it alone. These strange things like (Double,Double) -> Bool things are closures. Closures are functions you use as types, often in parameters of other functions. In this lesson we’ll explore…
-
How to Use MapKit for 2D and 3D Map Views.
Everyone may remember when Apple first introduced MapKit to replace Google Maps on iPhones, they ended up to apologizing. However over time, developers have found how easy it is to use MapKit. This API provides features which make using both 2D and 3D maps very easy. More importantly, Google charges for map views over a…
-
The Step by Step Guide to Custom Presentation Controllers
Ever wanted that sliding sidebar or an alert with a image picker? Apple has many great ways of presenting view controllers, but sometimes we want something different, something new. For that we subclass UIPresentationController. However there’s a few concepts that you’ll need to wrap your head around first. In this lesson we’ll create a few…
-
Using Settings Bundles with Swift
Have you ever wondered how to put user defined settings for your app into the settings app? Xcode can create a special property list called a settings bundle which can append the NSUserDefaults with more entries from Settings App. You’ll find out in this lesson how to set up a settings bundle in your app…
-
How and Why To Use Unsigned Integers (UInt)
In the beginning there was the unsigned integer, and it was good. If you go deep into machine code you will still find that any device is nothing more than unsigned integers. All other values Int, Float, Bool, Character, and String are forms or collections of unsigned integers. To a modern high-level language like Swift,…
-
How to Make Drill-Down Tables in Swift
Table views are a lot like potato chips: You can’t have just one. Often, table views relate to each other in what is often referred to as a drill-down. Drill downs typically take the selected data and provide another list in a table about the selection. It creates a hierarchical selection. You might have a…