Category: Swift

Spicing up xcode

Spicing Up Xcode

At the third Raizlabs Lightning Talks, I ate a Scotch bonnet pepper and presented 13 tips and tricks about Xcode. If you missed the talk, or wanted to know about one of the slides in more detail, here’s a video and a written version of everything I mentioned, plus a few extras. Spicing Up Xcode was inspired by […]

Read More

computer with typing image

XCTest and Optional Unwrapping

XCTest is the default test harness on iOS and Apple’s other platforms. It provides support for organizing test cases and asserting expectations in your application code, and reporting the status of those expectations. It’s not as fancy as some of the BDD frameworks like Quick and Cedar, but it has gotten much better than it used to be, and is my […]

Read More

computer code and notebooks

Localized Pluralization with Stringsdict

It’s harder to create user-facing strings that contain numbers than it should be. This post should make it easier, with tips on localization and pluralization. This post is not about all the good reasons to do localization (l10n) and internationalization (i18n). For that, I recommend the following excellent posts: Mattt Thompson on NSHipster Josh Johnson on Objective […]

Read More

UIStackView Demystified

UIStackView was released to the public with iOS 9. It is a container view that internally handles layout of its subviews. The layout can be configured by changing its properties axis, distribution, alignment, and spacing. It lets you remove tedious NSLayoutConstraint setup code. Below is a very simple implementation of a UIStackView that contains 4 […]

Read More

IB Free In Practice Logo

IB Free in Practice 1: Managing a Modal

This series of blog posts will provide examples of how we develop Swift applications without IB and demonstrate some general strategies for app architecture. For this first post, I’m going to cover presenting and dismissing a modal view controller over a home view controller. Even though the example is relatively simple, I am going to […]

Read More

Core Data Type Safety with Swift

Core Data has had a long history, and it has emerged as the de facto persistence solution on iOS. An inescapable part of its past is its extremely dynamic nature, and developers’ efforts to get more help from the compiler in the form of code generation. Handcrafted Managed Objects Originally, Apple provided very little support […]

Read More

Linear Interpolation and Fading Hairlines

Linear interpolation is a simple method of finding intermediate values between two endpoints. It has numerous applications in computer graphics, where it is known as lerp, but we are going to use a tidy Swift implementation to add some subtle polish to an iOS app. You can download the source code for the example app […]

Read More


WWDC 2016 Rumor Roundup

Apple’s annual Worldwide Developer Conference is just around the corner. It kicks off Monday, June 13th at 10AM with a keynote. The tech industry is buzzing with rumors about potential upgrades to the hardware and software that Apple so fastidiously builds. This means that, here at Raizlabs, we’re getting excited for the announcements to come. […]

Read More

Introducing Anchorage: Readable Auto Layout Code for iOS

Auto Layout is a declarative layout engine introduced in iOS 6 to allow developers to create adaptive UI that looks good on any device. Its release coincided with the arrival of the 4-inch screen, the first with different dimensions since the original iPhone. The importance of an adaptive interface has only increased with the release […]

Read More