WWDC 2023: What’s New In UIKit
Well, I’m Still Using UIKit
This particular article isn’t intended to replace the video from WWDC. Rather it’s an in-situ example of how the code in the video works, so instead of needing to copy-paste the code from the video we have a full working example in the repo along with this article.
This also doesn’t cover everything in the video, just the things that I’ve found most interesting. So my recommendation is to use Apple’s video https://developer.apple.com/videos/play/wwdc2023/10055/ and use this article to help you where needed.
Key Features
UIKit Previews
The new preview macro is great! I can use it to instantiate view controllers programmatically or through the storyboard. Here is an example (which is in the repo):
#Preview("ViewController") {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let customViewController = storyboard.instantiateViewController(withIdentifier: "ViewController")
return customViewController
}
View controller lifecycle
The view controller lifecycle has been updated, and what is better is it has been back deployed to iOS13 so most of us should be able to use it (even when we support users on older iOS versions).