Nov 27 2016
Basic (generic) swap function
(Swift 3) var a: Int = 15 var b: Int = 12 func swap( a: inout Int, b: inout Int){ (a, b) = (b, a) } print(“a is \(a) “) //15 swap(a: &a, b: &b) print(“a is \(a) “) //12 So far, so good. I really like that this is doing away with the extra […]
Jan 3 2017
Limited Stack
(Xcode 8.0, OSX 10.11) For the app I am currently working on, I wanted to implement the following: – user can import a picture – user can change their mind and undo their choice, up to a point – I don’t need to store a million images in my app And there are many ways […]
By Extelligent Cocoa • Extensions, Wiki • • Tags: collections, default values, generics, stack