3 ms·
NSArray *array = @[@"a", @"b", nil, @"c"]; // array = [@"a", @"b"] I sort of prefer Swift: let array = [“a”,”b”]
by melling 5y ago
NSArray *array = @[@"a", @"b", nil, @"c"];
// array = [@"a", @"b"]
I sort of prefer Swift:
let array = [“a”,”b”]
- happytoexplain 5y agoAnd the Swift version is even automatically typed as containing Strings using generics!
- astrange 5y agoThough this isn't precisely typed: let dict = ["a":[1],"b":["c"]] print(type(of:dict["a"])) = Optional<Array<Any>>