S Link
try! Swift NYC
Join us for a Swift Community Celebration π in New York City on September 1st and 2nd. Speakers include @batalia, @cocoaphony, @danielpunkass, @icanzilb, @vixentael & many more! Use code SWIFT100 by Friday to get $100 off!
Swift Around the Web
Recursive Tail Calls and Trampolines in Swift
Didn't know about Trampolines...
"A trampoline is not much more than a loop that executes iteratively functions that can either return the next function in the sequence (in form of a thunk or continuation, a data structure that contains the information needed to perform a specific function call) or another kind of value (in this case the content of the accumulator) to signal the end of the iteration."
Of course, once you do learn about Trampolines, don't over-engineer your code and actually use them π
Swift Style Guide: April 2016 Update
Not quite comfortable with the Flip Flops here π
But of course, I'll follow Apple's lead on this...
Coding
Doubling Down on Protocol-Oriented Programming
The power of Protocols applied to Networking taken to the next level:
"Protocols in Swift are very powerful, especially because they can include default implementations as of Swift 2.0. However, because of its static nature, protocol-oriented programming can still lock you in to certain patterns. Protocols should be very small, ideally containing only one responsibility each."
A Tale Of Two Optimizers
"So the lesson is that new Swift developers coming from a legacy of Objective C, C++, or C development need to take stock of Swift compiler settings because they are liable to be rooted in completely different build settings."
Apple News
Swift 3.0 Release Process
"Swift 3.0 is a major release that is not source-compatible with Swift 2.2. It contains fundamental changes to the language and Swift Standard Library."
I was almost sad to see this - now I know what to expect at WWDC. However, I have heard from sources that there will still be plenty of mind-blowing surprises announced at WWDC.
I recommend getting ready for Swift 3.0 sooner rather than later to leave room to work on other cool stuff after WWDC - for those going to WWDC, you can debug any big issues with the Swift engineers in the Labs!
Other Cool Stuff
Videos
Parser Combinators in Swift, by Yasuhiro Inami
Parser combinators are one of the most awesome functional techniques for parsing strings into trees, like constructing JSON. In this talk from try! Swift, @inamiy describes how they work by combining small parsers together to form more complex and practical ones.
Boundaries in Practice, with Ayaka Nonaka
Amazing talk by @ayanonagon (aka @ayanonagon_jp) in both English and Japanese at the same time!!! But seriously, this is a must-watch talk about the applications of the Functional Core, Imperative Shell.
Swift Evolution
Survival of the Swiftest: Whatβs up in Swift Evolution
Thanks again to @ericasadun for keeping us updated on the Swift Evolution changes.
Proposal SE-0068 to expand the Swift Self to class members and value types sounds great! I like the idea of using Self
with value types, and it's a lot less confusing to use x.Self
instead of x.dynamicType
.
ο£ΏWATCH
ClockKit Deep Dive: Text Providers
Complications are a bit complicated... There are several different sizes that have a different amount of space each. So the ClockKit API provides special Text Providers to make text (or date / time) formatting a lot more dynamic depending on the size of the complication.
Swift Code
- BuildTimeAnalyzer-for-Xcode - Build Time Analyzer is an Xcode plugin that shows you a break down of Swift build times.
- URLPreview - An NSURL extension for showing preview info of webpages
- Outlets - Utility functions for validating IBOutlet and IBAction connections
- Palau - NSUserDefaults with Wings!
- PatronKit - A framework to add patronage to your apps.
- RealmVideo - An iOS app to watch Realm videos and slides on your phone.
Learning
I love this perspective
Elon Musk: "Rocket reentry is a lot faster and hotter than last time, so odds of making it are maybe even, but we should learn a lot either way"
Always keep learning π (and in case you were wondering, this rocket landing was also a success - it even landed inside the circle this time!).