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
Friday Q&A 2015-11-06: Why is Swift's String API So Hard?
"Today, I'm going to explain just why Swift's String API is designed the way it is (or at least, why I think it is) and why I ultimately think it's the best string API out there in terms of its fundamental design."
Yes, please explain 😭...
"Swift's String type takes an unusual approach to strings. Many other languages pick one canonical representation for strings and leave you to fend for yourself if you want anything else. Often they simply give up on important questions like "what exactly is a character?" and pick something which is easy to work with in code but which sugar-coats the inherently difficult problems encountered in string processing. Swift doesn't sugar-coat it, but instead shows you the reality of what's going on. This can be difficult, but it's no more difficult than it needs to be."
What we learned from rewriting our robotic control software in Swift
"We believed that redesigning this application using Swift would allow us to create a safer, more maintainable, and more testable application. Not only did we achieve those goals, but the resulting application is more responsive, nearly doubles the printing speed of our systems, and has a slew of other improvements. Unit testing is now implemented from the lowest levels to the highest in the application, catching issues that were impractical to test for before."
Coding
Thread Safety Basics on iOS/OS X
A super detailed, must-read overview of thread safety. Here is the most important point, which Swift helps with a lot:
The first thing that should always be discussed when talking about thread safety is that thread safety is inherently hard. Due to the way that threading, scheduling, garbage collection, cache misses, branch predictions, etc. work, issues with threading can be very difficult to trace down and fix. Given these factors, whenever possible, do not write code that can fail in a multithreaded environment. That can be achieved quite simply, if you follow the following guidelines:
- Don’t have mutable state whenever possible. Copies, copies, copies.
- Yes, your code has a race condition.
- Prefer thread-local storage over global state when it makes sense.
- When in doubt, use a lock.
- Yes, your code has a race condition (even if you think it’s impossible).
The Project File Part 2: Schemes and Targets
One of the things that stood out from @nerdonica's SwiftSummit talk (video should be available a bit later) is that we, as iOS developers, need to know our tools deeper, especially some of the low-level stuff. I'm definitely guilty of not knowing Xcode as well as I should. Thanks @micheletitolo for explaining some of the more complicated parts of Xcode to us!
Apple News
Xcode 7.2 beta 2 Now Available
Looks like small bug fixes for Swift / Xcode (and an unfortunate hit on CocoaPods). Check out the release notes here.
The most exciting improvement comes in iOS 9.2 beta 2:
"New to iOS 9.2 beta 2:
SFSafariViewController
can be dismissed using an edge swipe in apps built with the 9.2 SDK. No extra code required." - @rmondello
Other Cool Stuff
Van Gogh's 'Starry Night' was re-created with bacteria. It's as cool as it sounds.
Next step: 3D Print with bacteria! What could possibly go wrong?
Tutorials
Putting a UICollectionView in a UITableViewCell in Swift
Amazing tutorial with great tips on gotchas for a very common UX design pattern in iOS:
"But does it feel fine? Something is wrong, but what is it? Well, remember that the table view cells are being reused, so our collection views are being reused too. When they are, they’re starting off already scrolled instead of at the beginning of the collection view.
What we want is to have our interface “remember” where each of the collection views was scrolled to. This would let us scroll new collection views to the beginning, and scroll reused collection views to wherever they were left off."
Videos
While Your App Was Sleeping: Background Transfer Services, with Gwendolyn Weston
I had the pleasure of seeing this talk live two times, and will definitely watch it again when I'm incorporating background file downloads / uploads into my apps! So bookmark it!! It'll serve you well on your journey of avoiding 💩 pitfalls of the Background Transfer Service API!
Functional Voodoo
Approachable Functional Thinking, Using Protocol Extensions
Love this demonstration of how using Protocols is a good intermediate step between being completely Object-Oriented vs being completely Functional (and hard / confusing). Just shows how amazing the Swift language architects are!
WATCH
Native Games on WatchKit 2.0 - A hard way to go...
Pretty cool to see the result despite all the constraints for game developers on the Apple Watch:
"When i listen at first the keynote at the WWDC i was thinking native means native. But that is not really the case. There are no gesture handler or maybe touch delegates or something similar. Instead, all user input is directly bind to the user interface controls. That means, it's not usable for a game! But after trying a lil bit the different possibilities i decided for the WKInterfacePicker. It's the only control which gives me some input possibilities. So i use this until i find something better. So it turns out, this was more difficult to find a solution then for the graphics."
Swift Code
- Localize-Swift - Swift 2.0 friendly localization and i18n with in-app language switching
- AccessibilityAnnouncer - An accessibility announcement queue for iOS with timeout and retry behavior. Built using RAC.
- Unbox - The easy to use Swift JSON decoder
- Zephyr - Effortlessly synchronize NSUserDefaults over iCloud
- Carlos - A simple but flexible cache
- TVSafeArea - Using AutoLayout to Constrain AppleTV Layouts within the TV Safe Area
Swift Thoughts
So in a very bold move, Dropbox released their v2 iOS SDK fully in Swift, without even considering Objective-C compatibility!
Look for more big SDKs being Swift only! If your friends haven't started learning Swift yet, tell them to start ASAP! The Swifty future is here.
In other news, make sure EVERYONE on your team installs this.