Yearly Archives: 2016

Size classes in Xcode 8

More devices, split view controllers (introduced in iOS 8), slide over and split view multitasking modes (introduced in iOS 9) have all made adjusting a layout to its environment more and more complex. Interested to know about Size classes in Interface

Tagged with: ,
Posted in Swift

Sprite Kit Easing in Swift

It really is surprising that SpriteKit, Apple’s framework for building 2D games doesn’t have better easing algorithms available. I’ve just updated my solution, SpriteKitEasingSwift, to Swift 3, and added Carthage support. Here it is at github and CocoaPods. Kudos to buddingmonkey who built the Objective-C

Tagged with:
Posted in Swift

Xcode Keyboard Shortcut for CamelCase!

Sometimes it can be a pain moving around code in Xcode especially with long method and property names. Then I discovered an Xcode keyboard shortcut that rocks – move back and forward through camel case sub-words! Use Control→ and Control← to skip through camel case. Hold

Tagged with: ,
Posted in Swift

Why Swift?

With Swift 3 coming out of beta, some are still asking the question ‘Why Swift?’ Maybe you’re already an Objective-C developer – why learn a new language when the old one works fine? Or maybe you’re learning iOS development and

Posted in Swift

Any vs AnyObject vs NSObject in Swift 3

What is the difference between these three enigmatic types? A sometimes confusing topic, and to confuse things further Swift 3 has shaken it up by removing implicit bridging between Foundation and native data types. Aagh! Let’s look at the current

Tagged with: ,
Posted in Swift

Parsing XML in Swift 3

Parsing XML has always bothered me in Swift. The NSXMLParser class doesn’t actually parse the XML structure into Swift objects, rather it traverses the XML structure, pinging its delegate whenever it discovers something new, like an XML element or attribute,

Tagged with:
Posted in Swift

Sorting strings in Swift

Sorting an array of strings in Swift is a bit of an iceberg topic – it seems fairly manageable, you just call the sort function right? Then you dig a little deeper and find a whole lot more lurking under the surface! Let’s start

Tagged with:
Posted in Swift

My book: iOS Development with Swift – Early access Deal of the Day!

I’m pleased to announce that I am half way through writing a book on iOS development with Swift, to be published by Manning Publications. The great news if you have experience in programming is that this book skips over all the basics, and skips

Posted in Swift

Keyboards, text views and first responders

If you’re moving your app’s interface from under the keyboard when it appears, you’re probably doing the following: 1. Get a reference to the relevant text field in the UITextFieldDelegate‘s textFieldDidBeginEditing method. 2. Listen to a relevant keyboard notification (possibly

Tagged with: , , , ,
Posted in Swift

Any vs AnyObject vs NSObject

What is the difference between these three enigmatic types? A sometimes confusing topic, let’s get it straight. UPDATE: Things have changed in Swift 3! This post has been updated for Swift 3 here. You probably know Swift is a type-safe

Tagged with:
Posted in Swift