Swift notes

Arrays

let c = a+b; // create an immutable array from arrays a and b
var c = a+b; // create a mutable array from array a and b
array.sort{ return $0.myProperty<$1.myProperty; } // see here

Functions

func merge(a:String, and b:String) -> String { ... }
class func ... // use 'class', not static.

Typecasting

(sender as NSButton)

[WORK IN PROGRESS]

No comments:

Post a Comment