Tyler Fox Profile picture
He/him. Building things with software. I’m also on Mastodon @smileyborg@mas.to
Sep 7, 2022 7 tweets 2 min read
🆕 Does your app display full-screen media content?

There's a specialized new UIKit API in iOS 16 that will help you display content as large as possible within the safe area of any device, including iPhone 14 Pro:
UIWindow.safeAreaAspectFitLayoutGuide
developer.apple.com/documentation/… How is this new API different from the normal safeAreaLayoutGuide and safeAreaInsets?

The safeAreaAspectFitLayoutGuide is for full-screen content only: you set the aspect ratio of the content on it, then it tells you the largest rect that fits in the device's true safe area.
Jun 21, 2021 9 tweets 3 min read
🆕 iOS 15 brings radical new cell prefetching behavior to UICollectionView and (for the first time ever!) UITableView — this is a quantum leap forward for smooth scrolling performance and power efficiency.

Here's a thread with some key takeaways ⬇️ What's the big deal?

In iOS 15, the system intelligently identifies spare time between frames, and uses that to start work on the next cell, giving you up to 2x time to prepare each cell!

Best part: just build your app with the iOS 15 SDK, and you get it automatically for free!
Jun 13, 2021 10 tweets 3 min read
iOS 15 introduces a new way for you to conveniently update content displayed in existing cells in UICollectionView and UITableView: reconfigure.

When and why should you use reconfigure? How is it different from reloading an item or row?

Let’s dive in with a quick thread. You can think of reconfigure as a lighter-weight version of reload.

Reload: replaces the existing cell with a new cell.

Reconfigure: allows you to directly update the existing cell.

Because reconfigure doesn’t request/create a new cell, it’s significantly more efficient!
Jun 9, 2021 7 tweets 2 min read
A small but very powerful API addition in iOS 15 is the new configurationUpdateHandler property on UICollectionViewCell, UITableViewCell, UITableViewHeaderFooterView, and even UIButton.
developer.apple.com/documentation/… TL;DR: you can set a closure which is called anytime the view's state changes.

If you're familiar with the updateConfiguration(using state:) method introduced last year in iOS 14, this is a closure-based version of it — so you don't need a subclass just to override that anymore!
Oct 16, 2020 7 tweets 2 min read
It’s a good question. There are a number of reasons why these properties are marked as “to be deprecated” in a future release.

Here’s a short thread to explain some of those. For starters, there’s well over a decade of implementation behind these properties and the different cell styles, with layers upon layers of complexity to preserve binary compatibility with all the apps using them. (Old apps in the App Store need to keep working without updates!)