New Features in iOS 17
3 min readMay 27, 2024
A full list of new APIs available in UIKit in iOS 17
General
- Preview your views and view controllers alongside your code using the new
#Preview
Swift macro. - Take advantage of a new view controller appearance callback,
viewIsAppearing(
_:), to run code that depends on the view’s initial geometry. The system calls this method when both the view and view controller have an up-to-date trait collection, and after the superview adds the view to the hierarchy and lays it out. This method deploys back to iOS 13. - Learn about enhancements to the trait system, which let you define custom traits for your own data, quickly change trait values throughout the view hierarchy, and register for trait changes in more flexible ways. For more information, see WWDC23 session 10057: Unleash the UIKit trait system.
- Display and manage empty state consistently in your app with
UIContentUnavailableConfigurat
ion, which provides new system standard styles and layouts for common empty states. Help people understand why no content is present, and when possible, provide guidance on how to add content. - Create a powerful text experience in your app. Define richer interactions by changing the default tap or menu behavior when interacting with a text item. If you implement a custom UI for displaying text, support the redesigned text cursor by adopting the new text selection UI. Mark up text fields with additional text content types to help people fill out forms even faster. For more information, see WWDC23 session 10058: What’s new with text and text interactions.
- Let people drop supported files and content onto your app icon on the Home Screen to open them in your app. To make sure your app is properly configured, verify that your
Info.plist
file specifies the file types your app supports using CFBundleDocumentTypes.
Accessibility and internationalization
- Simplify how you maintain your accessibility code with block-based setters for accessibility attributes. Make sure people receive the most important information first by specifying a default, low, or high priority for announcements. Enhance custom accessibility elements with the new toggle and zoom accessibility traits.
- Create a great text experience for international users by testing your UI in all languages. Adopt text styles to take advantage of enhancements to the font system, like improved wrapping and hyphenation for Chinese, German, Japanese, and Korean, as well as enhancements for variable line heights that improve legibility in several languages, including Arabic, Hindi, Thai, and Vietnamese. Access localized variants of symbol images by specifying a locale.
iPadOS
- Help people customize their Stage Manager configuration by including a larger target area for dragging windows. Leverage new resizing behavior for split view controllers to get the most out of your UI in Stage Manager.
- Support scrolling of your scroll view content with hardware keyboard shortcuts. This behavior is enabled by default, which you can override using
allowsKeyboardScroll
ing. - Simplify document management in your document-centric apps. Set your
UIDocument
subclass as the rename delegate of a navigation item to handle file renaming automatically. Build your content view controller fromUIDocumentViewController
, which provides a system default experience for managing documents: automatically configuring the title menu, sharing, drag and drop, key commands, and more. For more information, see WWDC23 session 10056: Build better document-centric apps. - Enhance the Apple Pencil experience in your iPadOS app. Give your app a sense of depth by using
UIHoverGestureRecogni
zer to draw a preview of the stroke. Support the beautiful new inks in PencilKit, including monoline, fountain pen, watercolor, and crayon.
Views and controls
- Animate symbol images with new symbol effects, including bounce, pulse, variable color, scale, appear, disappear, and replace.
- Build even more performant apps with flexible layouts using collection views. Apply diffable data source snapshots and perform batch updates with even better performance. Use the
uniformAcrossSiblings(estimat
e:) dimension for compositional layouts to specify uniform size across sibling items, with smaller items increasing in size to match their largest sibling. - Simplify spring animations by providing duration and bounce parameters for the new view animation method,
animate(springDuration:bounce:initialSpringVelocity:delay:options:animations:completio
n:). - Represent fractional progress through a page of content with page controls.
- Display and manipulate high dynamic range (HDR) images.
- Display your menu as a palette with
displayAsPale
tte for it to appear as a row of menu elements for choosing from a collection of items. - Take advantage of the
UIStatusBarStyle.defa
ult status bar style, which now automatically chooses a light or dark appearance that maintains contrast with the content underneath it.
Cheers!