Archivos de la categoría Programming

Singletons in Swift

If you come from the Objective-C world, you’re probably familiar with the singleton pattern. @implementation MyClass + (id)sharedInstance { static MyClass *__instance = nil static dispatch_once_t token; dispatch_once(&token, ^{ __instance = [[MyClass alloc] init]; }); return __instance; } @end Okay, … Sigue leyendo

Publicado en Swift | Dejar un comentario

On Apple's take on how to handle JSON with Swift 3

A couple of days ago, Apple published this post in which they describe some ways one can parse JSON using core languages of Swift 3. Weird thing, they suggest that it is OK to have a type download JSON by … Sigue leyendo

Publicado en Swift | Etiquetado , , | Dejar un comentario