private let lock = NSLock() var someVariable: Bool { get { lock.lock(); defer { lock.unlock() } // Don’t forget to unlock or you’ll risk a deadlock, otherwise -> NSRecursiveLock return _someVariable } set { lock.lock(); _someVariable = newValue lock.unlock() // unlocking in a di ff erent thread may cause unde fi ned behaviour } } }
It removes the copying capability of a type • “~” its called a negative constraint • Enforces strict ownership and move semantics • Borrowing • Temporarily gives access to a non copyable resource without transferring ownership • Consuming • Transfers ownership, leaving the original reference invalid • Bene fi ts • Prevention: common errors and unnecessary duplication • Performance: reducing the overhead of eventual copies • Expressiveness: more control over low memory management
to early 2013 • A fi rst experience with Eclipse IDE and Android SDK • Xcode 4.6 and an iPhone 4 • I’m sorry for those of you coming from the pre-ARC era 🦕 • Worked on IoT, video, banking and Cloud B2B and B2C apps