S Link
Win more than $1,000 in iOS books, training and coaching
Do you want to improve your iOS development skills to push your career forward, get an awesome new job or finally be able to publish your own app and make money in the App Store? Enter this giveaway to win $1,000+ worth of premium training material. If you score the grand prize you also get 3 sessions of personalized coaching.
Working with video is not complex … anymore
Gather, analyze and process video in a few lines of code with our powerful Mobile Video SDKs & Cloud Platform. Sign up today to get FREE access! Or try it right now: pod try StorieCloudSDK
Swift Around the Web
Swift 3 Access Control (Xcode 8 Beta 6)
One of the biggest changes implemented in the latest beta is around access controls. There is now open
, public
, internal
, fileprivate
, and private
😬. I think it's a really great change overall, especially for third-party libraries and frameworks, but it's definitely something to get used to. So many choices!
Structs and mutation in Swift
Good explanation of the mutating
keyword in Swift structs. I tend to avoid it as well, but maybe it's not too bad...
"With Swift structs,
mutating
does not have the same problems. The mutation of the struct is a local side-effect, and only applies to the current struct variable. Because every struct variable is unique (or in other words: every struct value has exactly one owner), it’s almost impossible to introduce bugs this way. Unless you’re referring to a global struct variable across threads, that is."
Coding
Making burritos with Swift (or How To Mock Classes You Don’t Control)
Great point on how to extend NSUserDefaults
to take over it's method calls for testing purposes 👍
Dude, Where's my Call?
The magic behind the Grand Renaming ✨
"The compiler has built-in linguistic transforms that turn Objective-C’s naming style into a more Swifty form. It drops duplicate words and words that just repeat type information. It also moves some words that were before the opening parenthesis in function calls and moves them into the parens as argument labels. This automatically cleans up a great number of calls."
Apple News
Design
How to Tell If Your App Is Handling Colors Correctly
Good computer 🎨 tip for those (🙋🏻) who see different shades of red as just red...
Saudi Millennials Don’t Use Their Phones Like We Do
So much good stuff here about doing user research outside our own backyard. Here are some of my favorite quotes to think about:
"“The only thing worse than not asking the questions, is not paying attention to the answers that don’t fit into their world view, because it’s inconvenient"
"Organizations love to talk about bringing the user’s voice into the conversation, yet if it’s just to retrofit an existing growth strategy, it’s morally bankrupt, and in a connected society, a very poor strategy."
"The only interesting answers are those which destroy the questions."
Other Cool Stuff
In Case You Missed It
iPS 166 Protocol-Oriented Programming with Natasha Murashev
I talked about POPing ALL THE THINGS on iPhreaks. Enjoy!
Videos
Advanced ObjC <-> Swift Interoperability
This looks super painful to set up, but if you are stuck with Objective-C code, it's definitely worth it to take the time to go through and make it Swift-compatible. A better way would of course be to convince everyone to rewrite everything in Swift - love this talk from @ayanonagon (start at 16 min) on how she did this at Venmo 👏
Swift Evolution
[swift-evolution] Swift Package Manager 3.0 Project Status
The main focus of SPM is currently on supporting server-side Swift development, which is awesome, but it probably won't be replacing CocoaPods any time soon...
"Our stated plans here, and there hasn't been any change, is to leave building for iOS to Xcode. We have (very) limited support for doing that from SwiftPM via generated projects, and it would be nice to see that support deepen. However, there are a lot of limits to that approach and for something better we will need to wait for full Xcode integration. Unfortunately, we don't yet have a much better answer than this one from last year:
The reality is that we have a lot of work to do to make the package manager and its ecosystem a stable base for development... for any platform. We think its really important to have that base be solid so that it can grow successfully, which means we are prioritizing features that impact the package syntax, dependency resolution, and workflows. The scope of things we would need to tackle to directly build for iOS is just too long (remote testing, cross-compilation, code signing, entitlements, provisioning profiles) to try to do simultaneously."
Podcasts
What's New in Swift 3
Love this - super short (under 5 minutes!) and simple slide-voiceovers by @dimsumthinking reviewing the changes in Swift 3. Make sure to scroll down (and click the annoying "read more") to skip the intro part and get to the good stuff!
Swift Code
- NMessenger - A fast, lightweight messenger component built on AsyncDisplaykit and written in Swift
- HeartControl - ❤️ Continuous heart rate measurement during workouts with watchOS 3.
- Buffer - Swift μ-framework for efficient array diffs, collection observation and cell configuration.
- RxAutomaton - RxSwift + State Machine, inspired by Redux and Elm.
- depcheck - Depcheck reports dependencies per class, allowing you to easily detect classes that have too many dependencies. It can also report how many dependents a class have. Therefore you can spot the most used and unused classes.
- Skopelos - A minimalistic, thread safe, non-boilerplate and super easy to use version of Active Record on Core Data. Simply all you need for doing Core Data. Swift flavour. Blog post here.
Swift Thoughts
Hello there and welcome to the 💯th issue of This Week in Swift!! What started off as a project for myself to keep track of all the cool Swift stuff from the community has itself turned into a community of 15,000+ readers ❤️
I really appreciate everyone's support, all the sponsors who made this newsletter sustainable, and all the kind words I've received from many of you. If I'm ever in the same city as you, don't hesitate to reach out and say hi!
I'll be taking the next two weeks off from the newsletter to focus on finalizing planning for try! Swift NYC 🗽🐥🎉 and then to take some vacation as the beautiful days of summer come to an end. Then onto the next 100 🚀