Stack View Background Color

How do you set a background color for a stack view? For that matter how do overlay foreground or other decorator views over a stack view? If you have used UIStackView you probably know that it is not a normal subclass of UIView. Setting its backgroundColor has no effect. What we can do is add subviews that are not managed by the stack view.

Read On →

Loading Resources From A Framework

Small iOS applications are likely to contain the resources they need (images, localizations, audio files, etc.) directly in the application bundle. This keeps life simple until the day you decide to move some of the code and resources into a framework to reuse elsewhere.

In this post I look at a code snippet to load an image resource that will still work when moved to a framework and using type(of:) to find the type of a class at runtime (with a caveat).

Read On →

Variable Height Table View Header

Making a table view header that automatically adjusts its height to allow its contents to fit should not be so hard. Unfortunately it is a problem that has been with us for a number of years which means much of the advice on how to do it is out of date. This is what works for me for both iOS 9 and iOS 10.

Read On →

Extra Space When Embedding Table Views

If you embed a table view (or other type of scroll view) in a container view that has a navigation bar you will most likely hit what seems to be a strange problem. You get some extra unwanted space between the bottom of the bar and the first row of the table. This is nothing new, it came with iOS 7, and the fix is simple but it can drive you crazy if you don’t realise what is happening.

Read On →

Container View Controllers

Massive View Controllers are a common pain with iOS development. A quick search will give you much good advice on how to slim down these monsters. In this post I want to give some attention to the often overlooked use of Container View Controllers.

Read On →
Archives Categories
No time to watch WWDC videos?

Sign up to get my iOS posts direct to your inbox and I will send you a free PDF of my iOS Size Classes Cheat Sheet.

OK! Check your inbox (or spam folder) for an email to confirm your details and download your free guide to iOS Size Classes.

There was an error submitting your subscription. Please try again.

Unsubscribe at any time.