The above picture is from this weekend's sold-out Taylor Swift 1989 World Tour concert at Levi's Stadium (read 50,000 fans) . Can you spot the magic?
When I sat down in my seat, something hit my back. I got annoyed and got it off my seat. As the concert started, however, I realized that the thing taped to my seat was a wearable that everyone else around me was wearing. It was a bracelet that lit up in coordination with the music.
It was seriously one of the coolest use-cases for wearables I've seen outside of fitness. The result was a magical atmosphere, where the audience was used as one giant light show. You can feel some of the magic in the video here. Welcome to the 2015 version of the glow stick! It's so simple, yet so powerful and beautiful.
What other simple use-cases for wearables are there like this? I guess we'll have to wait to find out, or make them ourselves!
In this blog post, Apple shows how they went from a very un-Swift-friendly UIView SDK to a very nice Swift one just by using nullability annotations.
This seems like a big hint from Apple. While they're not going all crazy re-writing everything in Swift (as far as we know), they are making a big effort as a company to make sure their SDKs are very Swift-friendly and blogging about it!
Swift Around the Web
Swift Compiler Diagnostics
One of the biggest pain points of Swift over the past year has been attempting to debug it. The error messages have been very vague and unhelpful. I've had to revert back to print statements most of the time, hoping it would print the right thing while waiting for the project to compile.
It's amazing to see that the Swift team has taken this super seriously, with massive improvements in Xcode 7. So while better compiler error messages may seem like a minor Swift improvement compared to error handling and guards and generics in Swift 2.0, this small change is crucial for Swift adoption. Thanks @olebegemann for pointing this out and providing a great example (I wouldn't have know why that doesn't work either!).
Binary Search and Applications
How to do binary search in Swift! And in this case, it's not just one of those blog post about an algorithm for the sake of implementing an algorithm, there is an actual iOS-specific use-case - implementing fast autocompletion.
Want to level up your knowledge of iOS? Take NSScreencast for a spin!
NSScreencast offers weekly, bite-sized videos on iOS & Mac development. On the site, you’ll find over 180 episodes of members-only content. Each episode covers a single topic and is typically less than 20 minutes long. Most of the new episodes are written in Swift, so come and learn something new, each week! For subscribers of This Week in Swift, we have a special discount of 30% off for 3-months! Sign up here...
The Swift Algorithms Book
Written for students and professionals, The Swift Algorithms Book blends modern code, illustrations and computer science to help you pass the interview or build your next app. Perfect for the classroom or the office, the book takes a fresh approach to explain concepts that power search engines, databases and social networks.
A Practical Introduction to Functional Programming - Now with Swift!
@HarlanKellaway re-writes @maryrosecook's practical functional programming tutorial in Swift! I agree with @HarlanKellaway about this being the best quote from the original tutorial:
When people talk about functional programming, they mention a dizzying number of “functional” characteristics. They mention immutable data, first class functions and tail call optimisation. These are language features that aid functional programming....
Ignore all that. Functional code is characterised by one thing: the absence of side effects. It doesn’t rely on data outside the current function, and it doesn’t change data that exists outside the current function. Every other “functional” thing can be derived from this property. Use it as a guide rope as you learn.
Using application context to transfer data (Watch Connectivity #2)
I'm really excited to see @kristinathai's WatchConnectivity tutorials back in action! I tried watching the WatchConnectivity WWDC session, and it felt very long to say the least. In this tutorial, @kristinathai goes over using application context to transfer emoji data from the watch to the device.
Testing consumers of WCSession with protocols in Swift.
I've talked about singletons on here before. While you should try to avoid them as much as possible, unfortunately, some of Apple's frameworks require them, including WatchConnectivity - which requires us to use a singleton for WCSession. And of course, one of the main problems with singletons is testing them.
Thanks @meanestcreature for walking us through the pitfalls of testing WCSession and how to do it with protocols. I think this does make you a protocol-oriented programmer!
4 Xcode Asset Catalog Secrets You Need to Know
When Apple announced that the Xcode Asset Catalog now supports PDFs at WWDC, it had no meaning to me, and I doubt enough mobile designers watched the technical announcements to understand what that means for them. Luckily, @allonsykraken explains it all.
So the big deal is that PDFs are the standard for vector assets. This means:
- Your designer can give you a PDF of an image, and it will scale on all devices!
- You can change the color of the image just by changing the tint color in storyboard or in code
- No more hassling your designer when a new device size comes out or you need a new image color or size!
I tried this out in my project last week, and it worked amazingly well!
Another great breakpoint to add to your collection of User breakpoints. I've had to look this one up just the other day, and it was a PAIN, especially when translating it into Swift. Thanks @nshintio for the great tip!
BusyNavigationBar - A UINavigationBar extension to show loading effects
TKAnimatedCheckButton - Animated Check Button
Decodable - Swift 2 JSON parsing done (more) right
CKWaveCollectionViewTransition - Cool wave like transition between two or more UICollectionView
FillableLoaders - Collection of completely customizable progress based loaders drawn using custom CGPaths written in Swift
How To Change Your App Icon at Build Time
Super useful tutorial for overlaying your App Icon with different version information for testing.
Functional Reactive Awesomeness With Swift!
I've been avoiding Functional Reactive Programming (FRP) because it sounds super complicated and intimidating. I also don't like having such a big external dependency in my code.
Yet, in this beautiful talk, @ashfurrow manages to make FRP sound like the next logical step in programming. He does a great job explaining the concepts in a very-easy to understand way with hand-drawn slides! Must watch if you'd like to learn more about what FRP is and the concepts behind it. It suddenly doesn't look that scary and actually makes a lot of sense.
Why empty states deserve more design time
Just like really good programmers code for errors right away - not just the happy path, good designers should design for empty states. Love the example scenarios provided - I'm delighted, educated, and impressed all at the same time!
Apple Watch Design & App Development: 5 Things
My favorite is tip #4:
Because watchOS 2 grants access to features like a heart rate monitor, accelerometer, and Taptic Engine, you can really give users things to do with your app. Figure out a task that was once way too difficult to complete on a smartphone, then build an app that makes it possible on the watch. Find that open space, and create something that enables the watch to fill it.
Oh, and remember kids, "a watch app should be a convenience, not an ankle monitor for parolees" - so well-said lol.
Average Manager vs. Great Manager
10 sketches on the difference between an average manager vs a great manager. Seriously, if you're running a business or even just managing people, print these out and put them somewhere you can see them several times a day!
Random Cool Stuff
This is how self-driving cars could work at an intersection.
Another cool aspect of self-driving cars - no need for stop lights! Looks kind of terrifying, but so cool!