S Link
Technically Speaking
Wanna level up on public speaking? Whether it's your first talk or 50th, subscribe to techspeak.email for a weekly prompt with CFPs, helpful tips, and inspiration.
Join us at Swift Summit SF!
Swift Summit in San Francisco is a must-attend event for iOS developers. Hear from Chris Eidhof, Natasha Murashev, Andy Matuschak, Daniel Steinberg and ~20 other prominent speakers at the 2 day conference. Learn new things, make new friends, and give your Swift career a leg-up. There are rumors of a 🎤Karaoke 🎤tradition at the after party, too :)
Readers of This Week in Swift can use the code "RobotFriends" to get a $100 discount on the regular price. Student pricing is also available!
Swift Around the Web
Pattern Matching in Swift
Wow! A beautiful way of using generics, currying, and event custom operators in Swift for very readable pattern matching. Must read!
Mixins and Traits in Swift 2.0
A very powerful demonstration of how using Protocol-Oriented Programming will simplify your inheritence tree - or get rid of it completely :)
Love this!
class ZapMonster: GameObject, GunTrait, RenderTrait, HealthTrait, MovementTrait {
...
}
With inheritance the only structure you can make is a hierarchy. But by placing your reusable code in protocol extensions, you’re no longer limited to just hierarchies — you’ve got more freedom in how you stick your building blocks together to build bigger components.
Coding
Add iOS 9’s Quick Actions shortcut support in 15 minutes right now!
"Apple introduced 3D touch (/force touch for iOS) functionality in iOS 9. API is divided into 3 parts. Quick actions, Peek and Pop, Pressure Sensitivity. This functionality will be available in iOS 9 at launch. Meaning you can already submit apps with support for it right now."
Of course the big issue is that you can't test that it works... Unless you use @conradev's tweek! Thanks @aligatr for the tip.
iOS 9 Sampler
Code samples with screenshots for new iOS 9 features in Swift, most of which I didn't even know about!
Samples include:
- UIStackView
- Selfies & Screenshots
- Search APIs
- Content Blockers
- SFSafariViewController
& A LOT more!
Design
How Apple Built 3D Touch
"The designers concede they were far down a rabbit hole until they remembered, as Federighi says, that while the hardware was measuring force, the software needed to measure intent. To make what is counterintuitive feel normal, each on-screen “peek” and “pop” is accompanied by a 10-millisecond or 15-millisecond haptic tap, little vibrations that say “good job” to your fingers when an action is complete. (The precise timing of those taps is a cosmology all its own.) For the years of effort, 3D Touch will be judged a success only when its existence fades completely into a user’s subconscious."
UX design tips for your app
"A gorgeous app with poor UX isn’t a gorgeous app — it’s an invitation to frustration. Your users deserve better than that."
Amazing tips and examples for going above and beyond in user experience. Of course all of these tips are engineering challenges that are often ignored / added as an after-thought.
- The UX should adapt to the user
- Network awareness means good UX in any context
- Don’t assault your users with notifications
- You need a search interface
- Create a good user onboarding experience
Other Cool Stuff
What is this sorcery
Watched this a few times... I don't think my brain will ever make sense of it. Sorcery!
In Case You Missed It
FREE Power Swift Playgrounds!
I've created a few Swift 2.0 playgrounds to give away. You'll learn...
- Reference vs Value Types
- Higher Order Functions
- Error Handling with Swift 2.0,
- Protocol-Oriented Programming,
Enjoy!
Videos
Let's Play 'Refactor the Mega-Controller' with Andy Matuschak
While I haven't watched this particular video, I did see a refactored version of this talk live at NSSpain, so I highly recommend watching this while waiting for the NSSpain videos to come out!
You can also follow along by going through the refactoring steps on Github here. My favorite part of the talk was the idea of converting NSManagedObjects into structs to avoid mutable state. I'll have to think through this more!
WATCH
Native UIKit apps on Apple Watch
Cool to know that the Apple Watch is capable of fully running UIKit. The video of NanoCanabalt on Apple Watch at the end is definitely cool! I'm sure we'll get access to the non-hacked functionality eventually...
Podcasts
One Big Wrist Button (feat. Ayaka Nonaka + Sam Soffes)
A great discussion of the Apple announcements from a design / development perspective with @ayanonagon and @soffes. They dig through each product and talk about the design and development implications we can expect in the future!
Swift Code
Nuke - Advanced framework for managing images
SwiftMock - A mocking framework for Swift. Also check out Dobby. Yay! Testing in Swift is growing up!
DDMathParser - String → Number
InceptionTouch - Who needs 3DTouch when you can have InceptionTouch
StringSize.swift - String extension to find the layout size of a String with specified attributes.
Business
Minimum Viable iOS Engineer
Last week I mentioned that while the release of tvOS is super exciting and a great new opportunity for many, I'll be focusing on sticking with iOS and the Apple Watch. Some were surprised at this, and were even trying to temp me otherwise. I love the shrew analogy in this blog post.
"We have reached a point with the platform where we can’t know everything" and that's ok! Just keep learning whatever you're passionate about and work with others of complementary skills to build amazing products.
Lascorbe/CocoaConferences
A comprehensive list of Cocoa Conferences around the world. Thanks for putting this together @Lascorbe!
Swift Thoughts
Last week, I had the pleasure of speaking about WatchOS 2 at NSSpain in the beautiful Logroño, España (look at those perfect clouds!).
My favorite Swift talk was by @ayanonagon, who discussed a question that I get asked a lot - "I like Swift, but how do I convince my co-workers to start using it?".
Ayaka and her team of 5 iOS engineers were able to convince the business people at Venmo to give them 8 weeks to re-write the entire app in Swift! Wow! The result was going from 66,000 lines of code in the old (aka classic) app to 16,000 in the new Swift 2.0 version. Wow again!
Of course, as Ayaka points out, the mindset switch to Swift started incrementally. Start by first writing tests in Swift. Then new features in Swift. Talk to others in your office about Swift to get them excited. Really listen to their concerns, etc. The slides from Ayaka's talk are here - video version will be available eventually (I'll make sure to link to it when it is!).
Happy Swifting!