Natasha The Robot

Currently learning... Swift!

You can follow me on Twitter here.

Subscribe via RSS here.

Subscribe to my Swift newsletter

XCode Tip: Autocomplete

I personally love XCode, especially compared to other IDEs I've worked with in the past (looking at you Eclipse!). The fonts and colors are beautiful, and it does what I want for the most part. But recently, autocomplete is not working as smoothly...

Swift: The Problem with Trailing Closure Syntax

Two closures walk into a bar...

Swift: The Curious Case of NSDecimalNumber

It’s crazy how much I’m used to Swift failable initializers already. Just yesterday I was working with NSDecimalNumber, when I encountered the following scenario...

XCode Tip: Block Select Mode

Sometimes, when you comment something out in XCode, uncommenting using the standard Command + Slash might not work (it just adds another row of // commented out code, instead of uncommenting!). Previously, I just manually removed the // from each line of code. But yesterday, I learned that there is another, better / cooler solution out there!

Swift: Failable Enums with Optionals

A few weeks ago, I wrote about a cool way to store and use multiple Segue Identifiers using Swift enums in your iOS project. As I was trying to use this pattern in a project this week in XCode 6.1, it no longer worked!

How To Test Locale In Your Playground in Swift

Today I was preparing a fancy Playground for my talk at Wearables + Things Conference. This is the first time I created a Playground for educational purposes, so naturally I thought it would be super cool to demonstrate how values change based on locale! However, I quickly ran into a problem changing the locale for the entire playground. After tweeting out for help, @ayanonagon provided this beautiful solution...

How To Find A Substring In Range of a Swift String

Swift Ranges are wildly different than NSRange in Objective-C. I therefore find myself always spending way more time working with Swift Ranges than I ever think I would! Of course, in retrospect, Swift Ranges make a lot of sense, but they're hard to work with out of the box.

Feature Testing with KIF in Swift

One of the things I’m currently working on is getting back into my old Rails habit of testing my code. With KIF and XCTest frameworks, testing has become a lot simpler in iOS. However, as I started with KIF in my Swift app, I ran into an issue, which was luckily easy enough to resolve. But as I’ve been writing my tests in Swift, I’ve also found some new Swift-only patterns that I’ve been enjoying and wanted to share.

XCode: Search in Assistant Editor

I'm often in a situation where I have my storyboard open in XCode, then I open up the Assistant Editor to connect something from the storyboard, to my code, only to find the wrong file in the Assistant Editor! Here is how to easily search in your Assistant Editor...

iOS: Working with Segues in Swift

I love how easy Swift makes it to encapsulate small pieces of information compared to Objective-C. With tuples, enums, and structs, code becomes a lot more readable. I got reminded of this just yesterday, when @nickoneill showed an example of how to use enums to work with Segue Identifiers at the Swift Hack Day.