Swift Around the Web
XCPlayground
Well said: "Playgrounds aren't a feature of the Swift language per se—instead, they are a terrific showcase for all that Swift has to offer, from its efficiency and power to its opacity and depth. Playgrounds make it truly simple to create a working program—indeed, every new Playground starts with the soon-familiar "Hello, playground"
. At the same time, Playgrounds hide some of their most powerful features, leaving exploration as the only means to discovering their rapidly advancing capabilities."
Make sure to explore this blog post as a Playground :)
Swift: () -> () vs () -> Void
From Apple devforums: "FWIW, we’ve recently decided to standardize on () -> Void (generally, () for parameters and Void for return types) across all of our documentation." Good catch @ericasadun!
Swift: Enumerating Collections
Another good tip from @ericasadun. Use map for printing and debugging collections!
Coding
Swift Generics
@richturton discusses some of the boilerplate code encountered in Core Data, and how you can use Swift generics to DRY ("Don’t Repeat Yourself") out some of these operations.
Design
On The Design And Building of 1Password for Apple Watch
I was really impressed by the 1Password Apple Watch app design earlier this week. Read about the design process 1Password went through to create their Apple Watch app.
Design an Apple Watch App: Visual Design
Important design tips for making your tiny icon and visual branding stand out on the Apple Watch.
Other Cool Stuff
In Case You Missed It
Swift: The Unused Optional Value Problem
Here is a scenario – you need to do something in your code based on whether an optional value exists or not, but the thing you need to do does not need to actually use the optional value...
I loved the discussing this post generated. Make sure to read @owensd's follow up!
WatchKit: How to Place Text Over An (Animating) Image
It is becoming common to see WatchKit UI that includes a chart-like animating image with text overlaid on top of it. Yet, today when I tried to create this type of interface, I got stuck. I couldn't put a Label on top of an Image!
WatchKit UI: A Clever Passcode Screen
Love this clever Passcode entry interface from 1Passcode's Apple Watch App.
WatchKit: How to Check Device Screen Size in Code
The Apple Watch comes in two sizes – the 38mm and the 42mm. This means that you might need to do different logic based on the device screen size in code. In my case, I wanted to set a different image based on the device size. So here is how you check the Apple Watch device size in code...
Videos
Using Core Data in Swift
"Core Data is a framework of great power, but it often comes with great frustration. Nevertheless, it remains a popular choice for many iOS developers. Swift is a language of great power, yet it promises ease and simplicity. Combining the two, can we use Swift to harness the power of Core Data, without the frustration?
In this talk Jesse Squires walks us through his attempt, and the new frustrations he found along the way."
Functional Voodoo
Towards a more functional Swift
"Swift as it stands (at version 1.2) is a few pieces of syntactic sugar away from being a much more elegant (and functional) language."
WATCH
Improve the Accessibility of Images in Your WatchKit App
Didn't know about WKAccessibilityImageRegion! It allows you to add accessibility labels to specific parts of an image.
WatchKit Image Tips
"Recall that your Watch extension (where all of your logic and code resides) runs on the iPhone, while your Watch app is really just a bundle of storyboards and assets that are installed on the physical Watch hardware. This means that for an image to be displayed, it somehow needs to make its way from the iPhone, through the air, and to the Watch itself." Learn the three ways to make that happen and a lot more very useful must-read tips!
Swift Code
Business
How a $2.99 recipe app became a Top 2 Paid App in the App Store
How to plan and market toward your new app's success.
Swift Thoughts
When asked how many people have done Swift at UIKonf today, I was excited to see that most raised their hand :)
Personal Note: I'll be doing some more off-the-grid traveling through WWDC, so I'll be taking a break from This Week in Swift. Looking forward to continuing the excitement after the anticipated Swift, iOS, and WatchKit announcements at WWDC!