Back to the front page

Queues are not bound to any specific thread

It all started with this snippet [https://gist.github.com/jspahrsummers/af6ddfbabf3894bde981] from @jspahrsummers [https://twitter.com/jspahrsummers] #import <Foundation/Foundation.h> int main (int argc, const char **argv) { @autoreleasepool { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_sync(dispatch_get_main_queue(), ^{ NSLog(…

Status of Portable Swift code

Portable Swift [http://swift.org] source code is so damn hard to do. Main problem is that OSX and Linux Swift is using different Foundation codebase. Linux is using SwiftFoundation [https://github.com/apple/swift-corelibs-foundation] and OSX is using Foundation [https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/…

CloudKit Security model

CloudKit [https://developer.apple.com/icloud/] security model is barely described in documentation, yet it's very important aspect of this cloud solution. I do care about privacy [https://privacyapp.io] and I believe privacy aspect is important when implementing Cloud driven solutions. The subject is not widely explained…

Overload Swift type ambiguity

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…