-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
The team has reached a consensus to drop iOS 14 support moving forward. Unfortunately, it's not going to be as easy as incrementing IPHONEOS_DEPLOYMENT_TARGET.
The plan is to migrate to new APIs piece by piece, test each change individually, and then when the app is ready, increment IPHONEOS_DEPLOYMENT_TARGET. I will track the changes in this ticket.
Issue: pcdRpT-2PU-p2
Main deprecations
1. UIButton.Configuration to replace previous options
There is a good post about it. The main change is probably how insets are now managed:
Insets
These are equivalent:
// Swift
if #available(iOS 15.0, *) {
button.configuration = .plain()
button.configuration?.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 6, bottom: 0, trailing: 6)
} else {
button.contentEdgeInsets = UIEdgeInsets(top: 0, left: 6, bottom: 0, right: 6)
}// Objective-C
if (@available(iOS 15, *)) {
// - warning: Unlike Swift, you can't set button.configuration.contentInsets directly
UIButtonConfiguration *configuration = button.configuration;
configuration.contentInsets = NSDirectionalEdgeInsetsMake(0, 6, 0, 6);
button.configuration = configuration;
} else {
button.contentEdgeInsets = UIEdgeInsetsMake(0, 6, 0 ,6);
}You can set title and image separately (ignoring configuration), and it'll still work.
2. kUTType* and other deprecations
Example: kUTTypePNG is now UTType.png.identifier (both returns a unique type identifier, e.g. image.png)
3. UIApplication/windows deprecated
lin72hmomo-ozawa and guarani