Static Tables and Dynamic Type

Apple introduced static table views in Interface Builder way back in iOS 5 and dynamic type in iOS 7. Unfortunately either through design or bugs the two features do not play well together in iOS 9 (or iOS 8). This post covers how to get dynamic type to work with static table views.

Read On →

Readable Content Guides

If you can target iOS 9 Layout Anchors and Layout Guides make Auto Layout a lot easier. In this post I want to cover a special type of layout guide - the readable content guide. If you have text that stretches across the width of the device you can get lines that are so long they become hard to read. This is especially true on larger devices like the iPad. The readable content guide creates an area that can be easily read without you losing track of the lines. Read On →

Natural Text Alignment for RTL Languages

For the most part iOS supports Right-to-Left (RTL) languages such as Arabic with minimal developer effort. Standard UIKit controls take care of switching text alignment and direction automatically as long as you follow some simple guidelines. Handling exceptions to this natural layout has not been so easy. For example, having right-aligned text switch to the left with a right-to-left language. After a quick recap on natural text alignment I look at how to fix this with the new semantic content API added in iOS 9. Read On →

Stretching, Redrawing and Positioning with contentMode

The contentMode property of UIView allows you to control how to layout a view when the view’s bounds change. The system will not, by default, redraw a view each time the bounds change. That would be wasteful. Instead, depending on the content mode, it can scale, stretch or pin the contents to a fixed position. If you have trouble remembering what the different content modes do and which you should use this post should help. Read On →

Adapting Auto Layout Without Interface Builder

I posted last year on how to adapt a stack view to regular or compact size classes. The combination of stack views and Interface Builder simplifies the task and makes it easy to preview layouts for different size classes. But what if you are not using stack views? What if you are not using Interface Builder - either by choice or because you can only create the layout in code? This post looks at how to use auto layout with size classes when you need to do it with code. Read On →
Archives Categories