S Link
Forward Swift Courses: Two Weeks Free and 50% Off First 2 Months
Join Forward Courses in January or February and get two weeks free and 50% off the first 2 months with promo code "thisweekin" and get access to full-day video courses on beginning and advanced Swift, PoP, functional programming, React Native, Four Semesters of Computer Science, accessibility, and many more. All of our past conference talks are also available for free on the site.
Connect With Opportunity
If you're looking for your next great iOS opportunity, look no further. Get access to over 4,000+ innovative companies looking for their next iOS ace.
Swift Around the Web
Progressive Disclosure In Swift
In his excellent interview on Accidental Tech Podcast, Chris Lattner cites Swift's design philosophy as progressive disclosure - something that is easy to approach and use, but can also be super complicated to accomplish the goals of power users.
In this article, @danielpunkass does a amazing job showing how this is Apple's philosophy for their products, and I definitely think it can and should be applied to our own apps and products as well. The app that immediately came to mind while reading this was Snapchat!
Improving Optionals
A few great extensions for common annoying / ugly patterns that might come up when using optionals a lot. The isNilOrEmpty
one is definitely something I run into often enough to make that extension! I also like the readability of value(or:)
.
Coding
Clean Code for Multiple Storyboards
Go from 🤔:
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let loginScene = storyboard.instantiateViewController(withIdentifier: "LoginVC") as! LoginVC
To 😻:
let loginScene = LoginVC.instantiate(fromAppStoryboard: .Main)
Working with Asynchronous Objective-C APIs in Swift
You know those horrible Objective-C Asynchronous APIs that give you that optional value or error or both and you have to do those if checks? Like this:
class CLGeocoder {
...
func reverseGeocodeLocation(_ location: CLLocation,
completionHandler: @escaping ([CLPlacemark]?, Error?) -> Void)
...
}
Well, this is a great way to abstract that away a little bit into a much nicer Swifty Result
type 👍
class CLGeocoder {
...
func reverseGeocode(location: CLLocation,
completion: @escaping (Result<[CLPlacemark]>) -> Void)
...
}
Design
Other Cool Stuff
Sugar-cane chicken.
This weekend, I had an amazing lunch at the Unplugged Courtyard with a few other iOS devs in New Delhi. @_riteshhh recommended I get chicken wrapped around a sugar-cane, which sounds pretty crazy, but wow!!! Still thinking about how good it was. Highly recommend for all the foodies out there!
Videos
Property-Based Testing with SwiftCheck
Even for those who actually get past the "difficulty" of writing tests and do write them, it's hard for us, as humans, to think of every single random use-case - I personally test out a 0 and a 1, and then I'm done. In this amazing try! Swift NYC talk, @griotspeak showcases how SwiftCheck can add the much-needed randomness in tests so we can become more confident about the assumptions that our code is built on.
Swift Evolution
Swift Evolution Status Page Now Available
It's definitely been super hard and confusing to keep track of Swift Evolution proposals if you're not a direct part of it. But this new Swift Evolution Status Page is super simple and great for checking once in a while for a casual look of what's changing!
StringManifesto: String Processing For Swift 4
"An API that is easy to use--but incorrectly--cannot be considered an ergonomic success. Conversely, an API that's simply hard to use is also hard to use correctly."
Lots of good lessons to take away here, and of course it's great to see a coherent set of design goals and action items to decide for Strings in Swift 4.
Podcasts
Accidental Tech Podcast: 205: People Don't Use the Weird Parts
MUST-LISTEN: Chris Lattner does a public interview and shares Swift's plan to WORLD DOMINATION!!!! Great notes here.
Swift Code
- SwiftyCam - A Snapchat Inspired iOS Camera Framework written in Swift
- Files - A nicer way to handle files & folders in Swift
- Quick-Chat - Real time chat app written in Swift 3 using Firebase
- WatchShaker - Simple motion detector for ⌚️ (watchOS) shake gesture.
- ResponseDetective - Sherlock Holmes of the networking layer.
- Swift-3D-Demo - Shows how to draw a 3D object without using shaders
Swift Thoughts
This weekend, I spoke at the Swift India meetup in New Delhi, but of course the best part was meeting the community. If you haven't gone to any Swift / iOS meetups near you, I highly recommend it. And if you don't have one by you - consider starting one! This was the first Swift Delhi meetup and it was incredible!
In other news, Chris Lattner gave an amazing interview on the ATP podcast now that he's no longer an Apple employee. Definitely check it out!