Category: Swift 2 defer #swiftlang Apple iOS
-
Swift’s defer statement is funkier than I thought
Swift 2.0 introduced the defer keyword. I’ve used this a little but only in a simple way, basically when I wanted to make sure some code would be executed regardless of where control left the function, e.g. private func resetAfterError() throws { &…
-
Swift’s defer statement is funkier than I thought
Swift 2.0 introduced the defer keyword. I’ve used this a little but only in a simple way, basically when I wanted to make sure some code would be executed regardless of where control left the function, e.g. private func resetAfterError() throws { &…