With noticeable changes coming in Swift 3, we decided to take the dive and update TicTalkToc. TicTalkToc has been out for over a year now, and the only major updates made have been to watchOS2 with a few minor updates with Swift 2 and iOS9.

While Swift 3 has made significant changes (mostly to the Cocoa API), they are welcome changes. Here are the changes we saw:

Redundant Names

The old API has significant redundancy in how terms were used. Here are examples:

UIScreen.mainScreen()

becomes:

UIScreen.main()

and

UIColor.whiteColor()

becomes:

UIColor.white()

SE-0005 - Better Translation of Objective-C APIs Into Swift

Lowercase Enum Values

All enum values are now lowercase:

.Default 

becomes:

.default

SE-0006 - Apply API Guidelines to the Standard Library

New ErrorProtocol

Applying the new API guidelines means that Protocols are now suffixed properly. Such as ErrorType which now becomes ErrorProtocol. If you just started using do, try, catch, you'll want to pay attention to this.

SE-0006 - Apply API Guidelines to the Standard Library

Goodbye NeXTSTEP

This is by far the biggest change. All NS prefixes are removed. So for instance what was NSTimeInterval is now simply TimeInterval.

SE-0086 - Drop NS Prefix in Swift Foundation

Fixed Grammar

Many boolean properties now include an is verb prefix. Such as:

self.navigationItem.leftBarButtonItem?.enabled

is now:

self.navigationItem.leftBarButtonItem?.isEnabled

and

label.hidden = true

is now:

label.isHidden = true

SE-0086: Drop NS Prefix in Swift Foundation

Specifying No Parameter Label

Now all functions are assumed to have labels including the first parameter. In order to not have a label, you need to specify an underscore "_" label. So call which use to be:

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell 

are now:

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

and calls which were:

override func viewDidAppear(animated: Bool)

are now:

override func viewDidAppear(_ animated: Bool)

SE-0046 - Establish consistent label behavior across all parameters including first labels

Improved Labeling from Objective-C

The new API design does clean up the labeling along with this. With a healthy use of verbs, nouns, and prepositions, parameter have more descriptive labels. Examples are:

self.presentViewController(self.mailComposeViewController, animated: true, completion: nil)

becomes

self.present(self.mailComposeViewController, animated: true, completion: nil)

and

self.performSegueWithIdentifier("timeLimitSegue", sender: sender)

becomes

self.performSegue(withIdentifier: "timeLimitSegue", sender: sender)

SE-0005 - Better Translation of Objective-C APIs Into Swift

Updated Attribute Syntax

Lastly for attributes commonly used to for deprication = (equal sign) has been turned to : (colon).

@available (iOS, deprecated=9.0)

is now:

@available (iOS, deprecated:9.0)

SE-0040 - Replacing Equal Signs with Colons For Attribute Arguments


Many of the issues could be resolved using the standard issue fix-it, sometimes find-and-replace worked, but many times it required hand holding.

If you are looking for help updating your application, contact us and let us know how we can help.

We are also looking for tester for this version of TicTalkToc. If you are interested, you can submit your email address at TicTalkToc or in the form above.