Natasha The Robot

Currently learning... Swift!

You can follow me on Twitter here.

Subscribe via RSS here.

Subscribe to my Swift newsletter

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.

XCode 6: How To Debug The View Hierarchy In Your Storyboard

Reveal is one of the products that got sherlocked by Apple with the release of XCode 6. Well, almost. Not sure the XCode 6 version is as sophisticated as Reveal, but it does have most of the similar functionality and the big bonus is that it is in XCode, so it’s very easy to use and activate (once you know how to activate it).

XCode 6: How To Add Image Assets To Your Playground

As I mentioned earlier today at the Swift Hack Day, the new Playground files in XCode 6 are one of those things that I didn’t know I needed, but now can’t live without. I like to experiment in Playgrounds a lot, and that includes playing with images...

Swift Access Controls: How To Avoid The ‘Private’ Keyword Repetition

A few weeks ago, I contributed an article about Swift functions in objc.io, where I mentioned that I prefer to put all my private functions together at the bottom of my class, separated by a landmark. So I wish there was a way in Swift, like in other languages, to say that all functions below this on are private. In response, @chromophoreapp had the following idea...

iOS: How to Change UITableViewCell’s Selection Color App Wide

As part of your app branding, you might want to use a different selection color for all your tableViewCells! Here is how you can easily do this...

Don’t Miss These Navigation Bar Interactions in iOS8

Have you noticed how nicely the mobile Safari navigation bar condenses on scroll, and how the tab bar disappears? Here are the new navigation bar interactions in iOS8.