Learning Swift

Notes written while Swift was being released to the world.

Tuesday 3 June 2014, writing my first app:

Wednesday 4 June 2014, watching the 1st WWDC video (session 402) about the language:

“@Catfish_Man @siracusa Swift doesn’t dispatch through objc_msgSend() unless you inherit from NSObject or mark @objc. It’s pretty crazy.” https://twitter.com/brentdax/status/473929502955823106

Every iOS/OS X dev conference talk for the next ten years is going to have Swift code with the poop emoji as a variable name. https://twitter.com/mattgemmell/status/474104244384305152

Seems odd that Swift is still using @ prefixes for certain keywords (such as at the lazy modifier) - does anyone know why that is? https://twitter.com/nicklockwood/status/474178519468343297

Most perplexing feedback on Swift: folks who see it (and judge it) as the end of a trek - but don’t realize it is the start of a new world. https://twitter.com/clattner_llvm/status/474082459860992000

Looking forward to next month: I’ll be the first and only guy with 4 years of swift programming experience :-) https://twitter.com/clattner_llvm/status/473835365137416192

http://www.raywenderlich.com/73967/swift-cheat-sheet-and-quick-reference

Thursday 5 June 2014: Notes from session 406, “Integrating Swift with Objective-C”

The .swift Icon is the “Crazy Ones” text now. 😊 (via @blunckalex) http://t.co/JA63Fs5iyG https://twitter.com/_nb/status/474569926297276416

Of course Swift supports hashbang scripts, you can immediately execute a swift script with “xcrun swift -i”. https://twitter.com/clattner_llvm/status/474593140511211520

Observations while creating sb2code:

Friday 6 June 2014: Intermediate (403) and advanced (404) Swift sessions in WWDC

That’s one very strong statement: Swift is a protocol based language. https://twitter.com/fabricetdc/status/474824367126638592 (heard in session 404, minute 51)

In swift, “==” is compiled to [object1 isEqualTo:object2]. Something Cocoa developers have been begging for. “===” behaves as “==” in C. https://twitter.com/rosyna/status/474746076864344065

Swift web view tutorial video: https://www.youtube.com/watch?v=-wQ8sVa9TbU

Swift performance tip: compile your code in -Ofast mode to remove runtime safety checks. Your code will run much faster. https://twitter.com/SwiftDevs/status/474988521623916544

Safety and immutability are preferred, but Swift has UnsafePointer, malloc(), and mutability for the times you still need or want them https://twitter.com/clattner_llvm/status/475026273870180352