Category: Swift

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

Introducing BentoMap

BentoMap was designed to make it easy to store and retrieve a large amount  of map annotation data. It includes the concept of clustered annotations, and uses generics to allow flexible data storage. In order to handle large data sets efficiently, the annotations are stored using quadtrees. BentoMap is freely available under the MIT license […]

Read More

Introducing BonMot 4: Now With Dynamic Type

I wrote BonMot quite by accident. I just wanted to document some typographic tips and tricks that I had learned. NSAttributedString and TextKit are powerful, but they can be impenetrable, and I wanted to shed some light on the situation. However, as I collected my thoughts, I realized that a unified interface for accessing disparate typographic features […]

Read More

Cleaner Credit Card Detection in Swift

When developing in Swift, I will often find myself wondering, “is there a better way to express this?” More often than not, there is a Swift language feature that allows for clearer expression. I encountered this recently when working on credit card type detection and validation. Rather than making your users enter their card number […]

Read More

SIGTRAP: Decoding A Cryptic Objective-C + Swift Crash

In 2015, Raizlabs switched over to Swift for all iOS development. The move has been rewarding; Swift’s commitment to type safety and optional handling decreased our overall defect and crash rates (and increased developer happiness.) While this increased safety is awesome for Swift-only apps, it can introduce some hiccups in legacy Objective-C + Swift hybrid […]

Read More

A table showing a summary of the interactions between reference types and modifiers and their effect on Swift method dispatch.

Method Dispatch in Swift

Method Dispatch is how a program selects which instructions to execute when invoking a method. It’s something that happens every time a method is called, and not something that you tend to think a lot about. Knowing how method dispatch works is vital when writing performant code, and can illuminate some of the confusing behavior […]

Read More

Introducing RIGImageGallery

RIGImageGallery is a component from the Raizlabs Interface Guidelines, which is a set of UI components that offer sensible defaults to help a project get off the ground quickly and feel native to the platform, and with easy-to-use customization options. RIGImageGallery is designed to display a gallery of images with the expected behaviors established by […]

Read More