week 1 review
Target/Action, Outlets, Outlet Collections
Methods and Properties (aka instance variables)
Property Observer (didSet)
Array<Element>
MVC
value types (struct) and reference types (class)
initializer
Type (static) methods
lazy properties
for in loops
Dictionary<Key, Value>
Type conversion (eg. UInt32(anInt))
Optionals
Range
for i in stride(from: 0.5, through: 15.25, by: 0.3) {}
Tuple
let x: (String, Int, Double) = (“Hello”, 5, 8.5)
let (word, number, value) = x
print(word)
func getSize() -> (weight: Double, height: Double) { return(250, 80)}
let x = getSize()
print(“weight is \(x.weight)”)
Access Control
internal
private
private(set)
fileprivate
public: for framework only, call outside framework
open: for framework only, public and can subclass this
相關