What's New in UIKit in iOS 27
A tour of the new UIKit APIs in iOS 27 — TextKit 2 tables, scene accessories, Liquid Glass bar minimization, menus, and more — found by diffing the SDK headers.
A quick run down of the UIKit changes in iOS 27, derived from diffing the public UIKit.framework headers between the iOS 26.2 SDK (Xcode 26.2) and the iOS 27 SDK (Xcode 27 beta), plus looking at the WWDC26 sample Enriching your text in text views (video), example code.
iOS 27's UIKit is a tiny release in terms of API changes, but does have some changes. There are no new top-level paradigms, but there's an new addition to TextKit 2, a new scene accessory API, Liquid-Glass-era bar minimization controls, and a small amount of quality-of-life additions to menus, tab bars, and drag interactions.
Full ObjC API Diff of UIKit from iOS 26.2 to iOS 27 (beta 1): gist.github.com
1. TextKit 2 grows: tables, viewport rendering, and attachment reuse
This is the main new feature in UIKit for iOS 27, and is what the WWDC26 TextKit sample code showcases.
Real tables in attributed text
UIKit gained a full NSTextBlock / NSTextTable / NSTextTableBlock family (long available on macOS, now on iOS), and NSParagraphStyle / NSMutableParagraphStyle picked up a textBlocks property to attach them:
let table = NSTextTable()
table.numberOfColumns = 3
table.layoutAlgorithm = .automatic
let cell = NSTextTableBlock(
table: table,
startingRow: 0,
rowSpan: 1,
startingColumn: 0,
columnSpan: 1
)
let style = NSMutableParagraphStyle()
style.textBlocks = [cell] // 🆕 iOS 27
A viewport rendering surface API
UITextView now conforms to NSTextViewportLayoutControllerDelegate and exposes a set of overridable hooks so you can decorate or react to layout as the viewport scrolls — without recomputing the whole document.
The new surface protocols are NSTextViewportRenderingSurface and NSTextViewportRenderingSurfaceKey, and the new UITextView methods are:
textViewportLayoutControllerWillLayout(_:) // and …DidLayout(_:)
textViewportLayoutController(_:configureRenderingSurfaceFor:)
textViewportLayoutControllerReceivedSetNeedsLayout(_:)
viewportBounds(for:)
The sample uses these to implement section collapsing (hiding body paragraphs under a collapsed header) and a line-number gutter that stays in sync while scrolling:
final class CollapsibleTextView: UITextView, NSTextContentStorageDelegate {
override func textViewportLayoutController(
_ controller: NSTextViewportLayoutController,
configureRenderingSurfaceFor fragment: NSTextLayoutFragment)
{
super.textViewportLayoutController(controller, configureRenderingSurfaceFor: fragment)
// Position disclosure chevrons relative to the current viewport.
}
}
Reusable attachment view providers
Previously, NSTextAttachmentViewProvider-backed views were recreated as they scrolled in and out of view. iOS 27 adds a reuse policy so a provider (and its rendering surface) survives scrolling and edits.
UITextView gains registerTextAttachmentViewProviderReusePolicy(_:forTextAttachmentViewProviderType:), configured with the new UITextAttachmentViewProviderReusePolicy option set, and NSTextLayoutManagerDelegate gains cache/retrieve hooks:
textView.register(
[.onScrollingOutOfViewport, .onEditingInlineParagraphs], // UITextAttachmentViewProviderReusePolicy
forTextAttachmentViewProviderType: AnimatedAttachmentViewProvider.self
)
This is what lets the sample keep an AVPlayer-backed inline attachment alive (and playing) as you scroll.
2. Scene accessories & closure confirmation
iOS 27 introduces a model for attaching accessories to scenes and for confirming before a scene closes.
UISceneAccessory/UISceneAccessoryRegistration— register an accessory against a view controller:
let registration = viewController.registerSceneAccessory(accessory)
// …later
viewController.unregisterSceneAccessory(registration)
Plus a factory for external, non-interactive accessories: UISceneAccessory.externalNonInteractive(sceneConfiguration:userInfo:), surfaced back to you via UISceneConnectionOptions.sceneAccessoryUserInfo.
UISceneClosureConfirmation— setUIWindowScene.closureConfirmationto prompt with a title, message, andUIAlertActions before the scene goes away.
let closeAction = UIAlertAction(title:"End meeting for all", style:.destructive, handler: nil)
let cancelAction = UIAlertAction(title:"Stay in meeting", style:.cancel, handler:nil)
let myAction = UIAlertAction(title:"Leave & Assign new host", style:.default, handler: { action in
// work to do before the window closes
})
var closureConfirmation: UISceneClosureConfirmation = UISceneClosureConfirmation(
title:"Leave or End meeting?",
message:"You are the host. Would you like to end the meeting for all participants?",
actions: [closeAction, cancelAction, myAction]
)
windowScene.closureConfirmation = closureConfirmation
UISceneConfigurationgained a properinit(name:).
3. Display links move to the scene
Tied to the multi-scene push above, the display-link APIs on UIScreen and UIApplication are deprecated in favor of a scene-scoped equivalent:
// Deprecated in iOS 27:
screen.displayLink(target:selector:)
// Use instead:
windowScene.displayLink(target: self, selector: #selector(step))
4. Liquid Glass bars: minimization & flexible buttons
The Liquid Glass navigation/toolbar story continues with controls for how bars minimize and how bar buttons prioritize space.
-
UINavigationItem.barMinimizeBehavior(UIBarMinimizeBehavior) andbarMinimizationSafeAreaAdjustment(UIBarMinimizationSafeAreaAdjustment).
UIBarButtonItemVisibilityPriority, a comparable type with init(higherThan:) / init(lowerThan:)) and paddingRemoved for tighter custom layouts.
// UIBarMinimizeBehavior
navigationItem.barMinimizeBehavior = UIBarMinimizeBehavior.onScrollDown
// UIBarButtonItemVisibilityPriority
saveButton.visibilityPriority = UIBarButtonItemVisibilityPriority(higherThan: shareButton.visibilityPriority)
5. Menus: image visibility, subtitles, and live highlighting
UIMenuElement (and the UIMenuLeaf protocol) gained:
preferredImageVisibility(UIMenuElementImageVisibility) — show/hide an element's image.subtitle— secondary text under a menu item.highlightStateUpdateHandler— a block invoked as the element's highlight state changes, for live previews.
action.preferredImageVisibility = .hidden
action.subtitle = "Sends a copy to your team"
6. Tab bars & sidebars
-
UITabBarController.performBatchUpdates(_:)for animating multiple tab changes together. -
UITabBarController.prominentTabIdentifier(+setProminentTabIdentifier(_:animated:)) to emphasize a tab. -
UITabBarControllerSidebar.preferredPlacement(UITabBarControllerSidebarPlacement). -
Plus a
sidebarVisibilityWillChange:animator:UITabBarController.Sidebar.Delegate callback for coordinating sidebar show/hide animations.
7. Drag, pointer, and a new look-to-scroll interaction
-
UIDragInteraction.liftBehavior(UIDragLiftBehavior) andallowsPointerDragBeforeLiftDelaygive finer control over the lift gesture. -
UILookToScrollInteraction— a newUIInteractionfor eye-tracking-driven scrolling, withexclusionRegionInteractionfor opting regions out.
Deprecations & removals
UIAccelerometer,UIAcceleration,UIAccelerationValueare now obsoleted (previously deprecated) — use the CoreMotion framework.UIScreen.displayLink(target:selector:)andUIApplication's equivalent are deprecated → useUIWindowScene.displayLink(target:selector:).UIApplicationDelegate.application(_:supportedInterfaceOrientationsFor:)is deprecated → useUIWindowSceneDelegate.supportedInterfaceOrientations(for:)(the newsupportedInterfaceOrientationsForWindowScene:method).
No public UIKit classes were removed in iOS 27.
Miscellaneous other changes
UIImage.symbolWeight()— returns a symbol image'sUIImage.SymbolWeight. (This is the only genuinely-new Swift-overlay addition in iOS 27.)UIContextMenuConfiguration.allowsTypeSelect— type-to-select within context menus.UIDocumentViewControllerLaunchOptions.subtitle— subtitle on the document launch experience.- New protocol conformances:
UITextView:NSTextViewportLayoutControllerDelegate,NSTextContainer:NSTextLayoutOrientationProvider,NSTextLayoutFragment:NSTextViewportRenderingSurfaceKey. - Concurrency annotations: iOS 27 marks a large number of existing UIKit value types as explicitly non-
Sendable(~Swift.Sendable) in the Swift interface. This isn't new API — but it dominates a naive diff of the Swift module interface. - 11 new enums / option sets, including
NSTextBlockDimension,NSTextBlockLayer,NSTextBlockValueType,NSTextBlockVerticalAlignment,NSTextTableLayoutAlgorithm,UIBarMinimizeBehavior,UIBarMinimizationSafeAreaAdjustment,UIDragLiftBehavior,UIMenuElementImageVisibility,UITabBarControllerSidebarPlacement, andUITextAttachmentViewProviderReusePolicy.
Picked up from iOS 26 point releases
These post-date the iOS 26.2 SDK, so they show in the diff but shipped in iOS 26.x updates rather than 27.0:
UITab.selectedImage(iOS 26.1)UITabGroup.collapsedByDefault(iOS 26.1)UISearchTab.identifier(iOS 26.4)UITextInput.unobscuredContentRect(iOS 26.4)
Methodology: changes were extracted by asking Claude Codex, Opus 4.8, to diff the public ObjC headers and Swift module interface of UIKit.framework (iPhoneOS device SDK, arm64e) between Xcode 26.2 and the Xcode 27 beta. Summary counts: 7 new classes, 0 removed, 2 obsoleted, 23 modified classes, 2 new protocols, 11 new enums.