Tag Archives: Swift

NilError

I think that everybody knows how the error handling works when you call Objective-C methods from Swift. If you accidentally missed it, here’s quote from the Using Swift with Cocoa and Objective-C book:

In Cocoa, methods that produce errors take an NSError pointer parameter as their last parameter, which populates its argument with an NSError object if an error occurs. Swift automatically translates Objective-C methods that produce errors into methods that throw an error according to Swift’s native error handling functionality.

Read this book to learn more. I’m going to focus on one corner case only.

Continue reading

Swift hidden options

Night tweets recap. Swift compilation time is very slow sometimes. Especially when you’re going to use
map, filter, reduce, … and compiler must find out types & friends. It drives me
crazy and I’m forced to replace almost all my map calls with for ... in loops.

Continue reading