Swift 1.2

Some overlooked goodies

Russ Bishop
April 14, 2015

Apple has delivered on their promise to be, well, swift with Swift. Version 1.2 has been released and includes a number of updates and syntax changes.

Some are less welcome, like requiring parameter names for closures in methods with optional parameters. Others are great additions like Set or the ability for value-returning closures . . .

Read More

UIKit Missing Bits #1

Some Handy Utilities

Russ Bishop
April 03, 2015

Just a quick post today. Here are some UIKit bits that should have always existed but after 8 years are still absent:

  • setHidden:animated: - Absolutely inexcusable that we still have basic UIView properties that can't be animated
  • setEnabled:animated: - Ditto for UIControl
  • setEnabled:animated: - For some inexplicable . . .

Read More

Swift Quickie: Capture Lists

Closures for fun and profit

Russ Bishop
January 20, 2015

This is the first in a series of short posts addressing easy things you might not know about. I'm going to try interleaving these thing the long-form major effort-posts.

Capture Lists

Many people don't know that you can explicitly specify capture lists for closures in Swift.

A closure closes over . . .

Read More

Swift: Associated Types

I Want a Type-alee-uss-ess-ess for Christmas

Russ Bishop
January 05, 2015

Associated Types Series

Sometimes I think type theory is deliberately obtuse and all those functional programming hipster kids are just bull-shitting as if they understood one word of it. Really? You have a 5,000 word blog . . .

Read More

Swift: Strange tales of initialization

Or the case of the disappearing values

Russ Bishop
November 17, 2014

While trying to create a new view controller in Swift I ran into a curious problem with initialization. The class was a relatively simple subclass of UITableViewController containing a property var values:[String] and an initializer required init(values:[String]) that delegated to the super.init(style:UITableViewStyle) initializer. So far, so . . .

Read More

Swift and ObjC: Gotcha!

Interop is easy right up until it isn't

Russ Bishop
November 16, 2014

Swift and Objective-C use the same runtime. They use the same ARC memory management. They certainly interoperate far more than most languages except perhaps ones targeting the CLR. You might be forgiven for thinking that writing new classes in Swift would be easy, but there are several gotchas you might encounter:

Enumerated Sadness

. . .

Read More

Swift: respondsToSelector?

Ah for those carefree days

Russ Bishop
October 19, 2014

Welcome to another glorious Swift post, brought to you from foggy outer sunset in San Francisco. I'm working full time on iOS and loving every minute of it.

Today, let's talk about optional method chaining and respondsToSelector. Normally in Objective-C land, we have to do a little dance any time we want to handle selectors . . .

Read More

   Subscribe by email and never miss a post.