Category: iOS

Fixing Controls in Scroll Views on iOS

Buttons in scroll views have a subtly broken behavior. In this post, we show you a simple workaround to keep your UI feeling smooth and consistent with the design language of iOS. You can download the sample project for this article if you’d like to try it for yourself. Buttons on iOS change color when […]

Read More

Animating Items in a UICollectionView

UICollectionView has been called “the new UITableView“, which is not much of an exaggeration. The incredible flexibility of collection views for displaying and facilitating interaction with a collection of data items makes it one of the most valuable tools in the UIKit toolbox for iOS 6 and above.

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

A desk with a computer, pen, and other tools.

Tools We Love – iOS and Android

This time of year is often associated with greeting cards and chocolate, but the team at Raizlabs is showing the love by opting out of flowers and into sharing our favorite tools. We love developing impactful products that change lives. Our favorite tools help us spend more time writing code, and less time in the […]

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

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

NSAttributedString Creation Helpers

NSAttributedString is a great addition to the iOS SDK. Since the release of iOS 6, we are able to use NSAttributedString with UIKit, assigning it to UILabels and  UITextViews. Here is the code for creating this  NSAttributedString: “(middleContent)” (with bold parentheses and italic middle content):

The above example shows that an abundance of code is required to create […]

Read More

Smarter Animated Row Deselection on iOS

It’s always a good idea to give your users context: at a glance, they should be able to figure out where they are, how they got there, and how to get back where they were before. One subtle but important way to give these cues is with animated deselection. If you’d like, download the sample […]

Read More