Natasha The Robot

Currently learning... Swift!

You can follow me on Twitter here.

Subscribe via RSS here.

Subscribe to my Swift newsletter

Xcode: One Weird Debugging Trick That Will Save Your Life

Over the last few days, I've been watching the Advanced Debugging and the Address Sanitizer Session over breakfast. There is one super cool debugging trick that I have to write down so I remember to actually use it.

iOS: An Optional vs Empty Data Source in Swift

So here is a common scenario in iOS development. You're loading a Table View with data from an API. Initially the Table View is blank, since you're still fetching the data, but very soon (hopefully) the data is fetched and the table view is reloaded as it is meant to be. The issue in Swift is how to represent the data when it is initially blank.

iOS: Using the Wrong dequeueReusableCellWithIdentifier!

For dequeuing table view cells, I’ve been using the dequeueReusableCellWithIdentifier: method for a while now. I guess it just auto-completed for me one time in Objective-C and, since it was shorter than the other auto-completed method – dequeueReusableCellWithIdentifier:forIndexPath:, I just kept using it without thinking much about it. This presented a problem for me in Swift with optionals...

How to Install an Earlier Version of a CocoaPod

I’ve only used CocoaPods to level up to the latest version of whatever library I’m using. However, now with Swift support, I’ve found that I have to use a previous version of a CocoaPod because I’m still using an earlier version of Swift in my project...

Swift 2: “for… in” filtering

While looking through slides for What’s New in Swift again, I’ve decided to instead play around with and write down the new Swift 2 idioms here for easy reference for myself (and hopefully others). This post focusses on the “for… in” filtering...

Swift 2: Pattern Matching with “if case”

While looking through slides for What’s New in Swift again, I’ve decided to instead play around with and write down the new Swift 2 idioms here for easy reference for myself (and hopefully others).

Swift 2 Pattern Matching: Unwrapping Multiple Optionals

With Swift 1.2, we got the really nice shorthand syntax for unwrapping multiple optionals in one simple if let statement. However, you might still encounter a situation where you do actually have to handle the different combinations of existing / missing optional values...

Swift 2: Test Driving the Error Handling

I’d admit it, when Chris Lattner explained the new Swift 2 error handling code on Tuesday at WWDC, I was a bit overwhelmed. It looked pretty alien, Java-like, and unnecessarily complex. I felt like I’d have to sit down for a while to try to understand it. Turns out my worries were unwarranted!

Swift 2 + Xcode 7: Unit Testing Access Made Easy!!!!

One of the biggest challenges to Unit Testing in Swift was the initial setup. Before Swift 2, you either had to make everything public or remember to add all your files to the testing target (more on this in my blog post on testing in Swift here). But as of yesterday, this annoying testing issue has been elegantly solved!

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!