S Link
Super Easy iPhone Apps – How to Make iPhone Apps with Swift 2
Join the Ultimate Beginner Course Series using Swift 2 taught by a former Apple employee, Paul Solt. Enjoy a beginner-friendly community for creating polished iPhone apps using the latest Swift (2.1), iOS 9, and Xcode 7.
Super Easy iPhone Apps is designed with the beginner programmer in mind: it’s accessible, easy to follow, and divided into manageable segments that even someone with no programming experience will be able to follow.
If you're an experienced developer you can jump between lessons using the provided source code to learn what is new in Swift 2.
For a limited time, you can enroll and save 60% on the retail price of the course series.
The Swift Algorithms Book (30% off)
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. Use code coupon code THEROBOT at checkout to receive a 30% discount!
Swift Around the Web
Null Object Pattern in Swift
Cool use of protocols to minimize the amount of optional unwrapping done in Swift code!
"Swift allows us to create APIs with a clear indication if something can be null. However, when an object received from a function can be null, the additional checks or unwrapping is needed. Those checks make the functions bigger, tend to spread out, and often are just a duplicate code. In addition to creating throwing functions that return non-optional types, the Null Object pattern can be used to make the code cleaner and easier to understand."
Coding
Replacing KIF Tests with XCUI Tests
Glad to see that the new native XCUI Tests are powerful enough to replace KIF. TL;DR:
- Record makes a great starting point for tests, once I got into the habit of using it things went faster. I ended up rewriting a lot of the code it produced, though.
- I think these tests run faster than KIF, but not by that much. Worth keeping a separate target. Bonus: means the inner workings of your app are not exposed (for me, just that strings file).
- Sometimes a bit flakey – I think this might be because there’s some asynchronicity and my computer was running slowly.
- So far the images have renamed themselves (with a different timestamp – weird) once. I changed it to just pick the first image in the collection.
The best part about this blog post: great tips on how to test your UI.
Swift Scripting by Example: Generating Acknowledgements for CocoaPods & Carthage Dependencies
Laziness-driven development 💖
"When something is tedious and requires repeating, it’s the worst. (Especially if you are lazy like me!) But the good thing is, with a bit of code we can automate all the things. We can take our laziness and do something fun. 🌟
Best of all, we can do this all in Swift!"
Apple News
Swift's High-Level IR: A Case Study of Complementing LLVM IR with Language-Specific Optimization - Joseph Groff & Chris Lattner, Apple
"The Swift programming language is built on LLVM and uses LLVM IR and the LLVM backend for code generation, but it also contains a new high-level IR called SIL to model the semantics of the language (and perform optimizations) at a higher level. In this talk, we discuss the motivations and applications of SIL, including high-level semantic analyses and transformations such as flow-dependent diagnostics, devirtualization, specialization, reference counting optimization, and TBAA, and we compare SIL's design with that of LLVM IR."
Xcode 7.2 beta 3 Now Available
Looks like a few bug fixes, especially with Swift 2.1 and Objective-C. You can view the release notes here.
Design
The Next Step for 3D Touch
So what would happen if 3D Touch became an app’s main UI? What could happen if we created apps solely comprised of shortcut actions and dynamic actions— and nothing else? Some ideas to fill that quadrant with, off the top of my head:
- Instead of tapping into the Clock app to set a timer from there, a user could set a timer from the Clock app’s home screen icon by using varying levels of pressure to select the amount of time to count down from.
- Instead of using the Hue app to change the brightness of its smart lights, a user could change the brightness by applying pressure to the app’s home screen icon.
- Instead of going into the Nest app, a user could change the temperature on their thermostat with pressure applied to the app’s home screen icon.
There is enormous potential hidden inside what appears on the surface to be an incredibly simple feature.
Other Cool Stuff
In Case You Missed It
Swift: Protocol Composition 😍
I’ve found that in practice, my objects sometimes conform to too many protocols, so the method or classes that take in these protocols become way too long and a bit confusing. Here is a great solution to this issue...
Thoughts on Functional Programming in Swift
One of the most powerful Swift language features is the ability to write code in more functional style. There's been a lot of excitement over that in the community. So I wanted to put together some thoughts I have on functional programming in Swift after spending some time with it!
Natasha “The Robot” Murashev joins Basecamp
On the personal news side, I'm super excited to be joining Basecamp as an iOS Developer 🎉. Basecamp has been a company I've admired for many years, so it's super surreal to actually be part of it.
Since Basecamp is a remote-first company (they wrote the book on remote work!), I've given up my San Francisco apartment and will be traveling the world instead. You can follow my journey at @NatashaTheNomad if you're interested. If I'm in your part of the world, please reach out and say hi!
Tutorials
Reference vs Value Types in Swift
One of the biggest differences developers note when coming to Swift from Objective-C is the heavy preference of value types over reference types. @ecerney walks through the differences between each type and shows you when each type is appropriate to use. Also check out Part 2 of this tutorial for more advanced concepts.
Videos
Testing View Controllers with Quick, with Rachel Bobbins
Testing view controllers isn’t as hard as people think. Using Quick, @bobbins shows how useful testing can be, covering different testing patterns she and her team use such as buttons triggering network requests, handling successful and failing response cases, and properly presenting other view controllers.
Simplifying Login with Swift Enums, with David East
Apps with only one login method limit user options and often lead to negative reviews, but with multiple login options comes great complexity. By using Swift enums, @_davideast demonstrates how we can easily abstract it away to keep our view controllers and login logic clean and simple.
Swift Code
- Money - Swift value types for working with money & currency
- Dunk - Dunk is Dribbble client.
- JMCMarchingAnts - Example of adding marching ants selection to the edges of the image.
- SnowGlobeFramework - Snow globe framework is delightful / slightly cheese easter egg for the holiday season. Turns your awesome app into a snow globe when user shakes the device. Blog post here.
- Transporter - Modern finite-state machine implemented in pure Swift
- Epoch - Venice based HTTP server for Swift 2 (Linux ready)
Business
Resist and Thrive
Wow! What a powerful read:
"Don’t sell out your values, don’t sell out your community, don’t sell out the long term for the short term. Do something because you believe it’s wonderful and beneficial, not to get rich."
Swift Thoughts
Swift quote of the week:
"I very rarely used the dynamism that made Objective-C so powerful. I constantly use the static type system that makes Swift so powerful." — @nomothetis