I may define default type for overloaded functions. sometimes. This is Swift [https://swift.org/] return overloading that may lead to ambiguity: extension String { func encode() -> NSData? { return self.dataUsingEncoding(NSUTF8StringEncoding)?.base64EncodedDataWithOptions([]) } func encode() -> String? { return self.dataUsingEncoding(NSUTF8StringEncoding)?.base64EncodedStringWithOptions([]) } } I have two functions encode() that…
Retry! in the wild
In perfect world every action finish with the success. In real world it's not. In perfect world sending network request returns with a result. In real world it fail sometimes due to dozen of reasons, and since we're living in the real world I have to…
How to be awesome Swift developer
I don't know, but I received enough emails from various people asking me how to be "awesome Swift developer" to write this post. > I’d be an iOS developer and it would be amazing if you could me advise on the right path to follow…
Linux compatible Swift and Swift Package Manager
Apple opensourced Swift [https://swift.org/] today, as promised in early 2015. This is great, awesome etc... but I'm not about that here. Together with Swift - programming language, Apple presented Linux port of Swift compiler and some tools. One of the tools is Swift Package Manager [https:…
Code at the end of the queue
Operation and OperationQueue [http://nshipster.com/nsoperation/] are great and useful Foundation framework [https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/ObjC_classic/] tools for asynchronous tasks. One thing puzzled me though: How can I run code after all my queue operations finish? The simple answer is: use…