S Link
iOS Spellbook
The iOS Spellbook will help you get to 80% of the way to Expert iOS Developer while doing only 20% of the work. You can get a preview of the book here - check it out I bet you haven't seen a programming book like the Spellbook π
Don't love your job? You should! Try Hired and find the right fit from over 4,000 innovative companies.
Hired puts the power back in your hands by having companies apply to you, not the other way around. On Hired, you only talk to companies you're interested in.
Swift Around the Web
How To Prevent Memory Leaks In Swift Closures
"Most closure examples that I've seen in tutorials or examples seem to capture
self
as unowned and call it a day, since capturingself
as weak makes it optional, which can be more inconvenient to work with. But as we learned before, this is inherently unsafe since there will be a crash ifself
is no longer in memory. This isn't much different than just force unwrapping all of your optional variables because you don't want to do the work to safely unwrap them. Unless you can be sure thatself
will be around as long as your closure is, you should try to capture it weak instead. If you need a non-optional self inside your closure, consider using anif let
orguard let
to get a strong, non-optionalself
inside the closure. Because you made this new, strong reference inside the Swift closure, you won't be creating a retain cycle since this reference will be released at the end of the closure."
CollectionOfOne
Whoa! A CollectionOfOne
is an actual real thing in the Swift source code, and for some reason, it really speaks to me...
"There are places in the standard library where the parameter is a collection and at the call site, you know you only have a single item to pass in. You can gain some efficiencies by using
CollectionOfOne
instead of a full-blown array."
Oh, and of course there needs to be an IteratorOverOne π΄
Coding
Use New Awesome iOS Features While Maintaining Backward Compatibility
Well, that seems almost too easy... Thanks Swift π»
Swift snippet: preferredStatusBarStyle
I've definitely been in that hopeless situation where I'm trying to change the preferredStatusBarStyle
of a View Controller and it's not working no matter what I do. The secret is that you're supposed to change navigation controller's preferredStatusBarStyle
... Elegant tip from @_riteshhh on how to make this code work the way you think it should.
Design
Optimistic UI
I've been using iMessage a lot more than usual lately, and I've come to expect Optimistic UI, especially since I travel so much and my wifi is not that great a lot of the time. I love the way it has the indicator at the top showing if the message is sending, when it's delivered, and finally when it's read. Or let's me resend if there was an error. I loved seeing examples from other apps in this article on additional ways to do Optimistic UIs well.
Other Cool Stuff
Kobe Luminarie
It's the season of lights! I loved learning about this amazing lights display in Kobe, Japan from @jpmartha_jp yesterday. I'll have to visit Japan in December too some time!
In Case You Missed It
My Way to "try! Swift Tokyo 2017"
TFW someone makes real friends and travels the world because of an event you organized. This is pretty much the biggest payout any conference / meetup / community organizer hopes to achieve. It's stressful and hard, but this is why we keep doing it. Thank you @jpmartha_jp for sharing your story and helping to make try! Swift Tokyo 2017 a reality π
Videos
Value SEMANTICS (not value types!)
Another must-watch talk by @alexisgallagher!! Super important for really understanding one of the most important concepts in Swift - value semantics and the big gotchas thanks to Objective-C. So much goodness here - I might have to rewatch a few times. Do you agree that immutable reference types have value semantics? Prepare to really π€
Architectural Superpowers
Good architecture = π°! Oh, and pride of course. Good overview of how to know when you do have good architecture, applying concepts from Clean Architecture to iOS.
Swift Code
- Snowflake - βοΈ SVG in Swift
- UnsplashKit - UnsplashKit is a Swift Client to download photos from the Unsplash Source API. This API is free of limits so you can download as many photos as you want π Blog post here
- Jolly - Jolly Chimp monkey that allows you to monitor Github repos straight from HipChat.
- RefactoratorApp - App version of Refactorator plugin
- AREK - AREK is a clean and easy to use wrapper over any kind of iOS permission.
- pxctest - Execute tests in parallel on multiple iOS Simulators
On Open Source
How to attract new contributors to your open source project
I've open sourced my projects before just because it's what you're supposed to do, but haven't added any of the stuff mentioned here. In truth, I didn't really want or expected contributors, but was pleasantly surprised by how much my life was made easier when people did contribute (e.g. some people upgraded my old forgotten projects into Swift 3!).
I'd definitely like to be more deliberate in my open sourcing one day... these are really great tips for how to do that, beginning with adding some kind of beginner task tag to issues and being very clear on what and how to contribute.
Swift Thoughts
Last week, I really enjoyed attending the Swift Buenos Aires Meetup and learning about Swift en EspaΓ±ol π. My favorite tip was from @alemohamad - apparently you can localize images so a different image shows up based on what language the app is in. Of course the image trick only works for images outside the assets catalog. But still - super cool! Apparently this can also be done for audio, video, plist files, and more!