Category: iOS10
-
Custom Table View Cells in Swift 3
In iOS you are limited to two labels and an image for one of the standard table view cell styles. You might want more custom cells than this. You are not alone with other developers including, Instagram, Twitter, Feedly and even Apple often using more than the basic table view cell. You can customize table view cells and populate…
-
Introducing Table Views in Swift 3
Table views on any mobile platform are the workhorse of any application. To be a good developer you need to make table views easily. Tables in iOS use the UITableView class to do so. This is a very powerful class with many features to make the tables you see in applications like Facebook, Instagram and…
-
What Do you do with Any?
There’s been a major change to Swift 3.0 That many people might find a little disturbing in code, and others may have no idea what it is. In one sense that’s the idea. Apple changed AnyObject to Any in Swift 3.0. This three-letter word is an extremely powerful feature,a backbone of many functions and classes, and…
-
Why do we need Delegates in iOS and WatchOS?
About two years ago someone asked me a very good question: Why do we need delegates for UIViewControllers? He thought Swift made things easier, but this delegate stuff seems very complicated. Shouldn’t we be able to send a message or initializer between classes? When I first learned iOS, I’ll admit it took me months to…
-
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…
-
Make a WatchOS 3 Haptic Catalog with a Picker
How does the Apple Watch communicate to the user when they are not looking at the watch face? That is done with haptics. Haptics are sounds and taps letting the user know something is happening. In this lesson, I’ll explain to you how to use haptics in Watch OS applications by creating a catalog of all the haptics…
-
Adding Modal Views and Popovers in Swift 3.0
Modal views are one of the fundamental ways to present view controllers. Some early applications on the iPhone were completely modal views — some still do. Modals do not do their own housekeeping like navigation controllers or tab controllers, so they are not as efficient for the backbone of your application. They need the user’s…
-
Create Dynamic and Static Table Views in Swift 3
In an early post on this site, I wrote a table view tutorial. I decided to update that tutorial a bit for The Swift Swift View Controllers Book and add a bit more sophistication and depth. This tutorial deep dives in the subject. Both will remain on the site. In October 2016 I updated this for…