What's New / App UI: SwiftUI, AppKit & UIKit

What's new in UIKit

+59 New~3 Deprecated−4 RemovediOS · tvOS · watchOS

UIKit is Apple's framework for building app user interfaces. It covers views, controls, view controllers, event handling, and text layout types like NSTextLayoutManager and paragraph styling.

The 27 SDK adds 59 APIs. New types include NSTextViewportRenderingSurface and UIBarButtonItemVisibilityPriority, plus the enums LiftBehavior, ImageVisibility, UIBarMinimizeBehavior, UIBarMinimizationSafeAreaAdjustment, and Placement. New members include UIAction.init, NSTextLayoutManagerDelegate.textLayoutManager, and width and border accessors (setWidth, width, widthValueType, setBorderColor, borderColor). Three APIs are deprecated: supportedInterfaceOrientations, UIApplicationDelegate.application, and displayLink. Four are removed: __NSLAYOUT_MANAGER_SHARED_SECTION__, NSMutableParagraphStyle, UIAccelerationValue, and UIAccelerometerDelegate.

New

59
var

allowsPointerDragBeforeLiftDelay

NewiOS
open var allowsPointerDragBeforeLiftDelay: Bool

For pointer-initiated drags, whether to wait for the lift delay. Similar to liftBehavior, this is useful to disambiguate drag initiation gestures alongside other gestures in the same view.

If YES, then when the pointer moves past its activation hysteresis , the drag will begin, regardless of whether the lift delay has elapsed. If NO, then just like the touch-based drag initiation gesture, the drag waits for the lift delay to elapse first, then checks for the activation hysteresis.

Default is YES on iOS, and NO on macOS.

var

allowsTypeSelect

NewiOS
open var allowsTypeSelect: Bool

Determines if the context menu should enable type-select. This is disabled for certain menus to avoid conflicting with typing. Default is YES.

var

barMinimizationSafeAreaAdjustment

NewiOStvOS
open var barMinimizationSafeAreaAdjustment: UIBarMinimizationSafeAreaAdjustment

The safe area adjustment during navigation bar minimization.

Currently, only the navigation bar supports customizing the safe area adjustment.

The default value is automatic.

var

barMinimizeBehavior

NewiOStvOS
open var barMinimizeBehavior: UIBarMinimizeBehavior

The minimize behavior for the navigation bar.

The default value is automatic. When the navigation bar minimizes, an integrated top tab bar will also minimize.

By default, the safe area adjusts as the navigation bar minimizes. Use barMinimizationSafeAreaAdjustment to customize this.

func

borderColor

NewiOStvOSwatchOS
open func borderColor(for rectEdge: CGRectEdge) -> UIColor?
var

closureConfirmation

NewiOS
open var closureConfirmation: UISceneClosureConfirmation?

A configuration describing a confirmation dialog to be shown when a user action will result in destruction of the scene session and disconnection of the scene.

var

highlightStateUpdateHandler

NewiOStvOS
open var highlightStateUpdateHandler: ((UIMenuElement, Bool) -> Void)?

This block gets called when the element is being highlighted or unhighlighted in a menu. @param element The element being highlighted or unhighlighted. @param isHighlighted YES when the element is highlighted, NO when unhighlighted.

init

init

NewiOStvOS
public convenience init(name: String?)

Creates a scene-configuration object with the specified name.

Scene sessions created from this configuration will have their role automatically set by the system.

var

isPaddingRemoved

NewiOStvOS
open var isPaddingRemoved: Bool

Whether the standard padding around the item should be removed. Default: NO

var

liftBehavior

NewiOS
open var liftBehavior: UIDragInteraction.LiftBehavior

Determines the lift behavior for the drag gesture.

The default value is UIDragLiftBehaviorDefault

protocol

NSTextViewportRenderingSurface

NewiOStvOSwatchOS
public protocol NSTextViewportRenderingSurface : NSObjectProtocol
Declaration
public protocol NSTextViewportRenderingSurface : NSObjectProtocol {
}
func

performBatchUpdates

NewiOStvOS
open func performBatchUpdates(_ updates: () -> Void)

Animates multiple tab changes as a single update.

Use this method when you need to make several changes to tab properties simultaneously. Changes made inside the updates block are coalesced into a single animated layout pass, preventing intermediate states from being visible to the user.

The updates block is called synchronously. You can safely read and write any mutable tab properties inside this block.

var

preferredImageVisibility

NewiOStvOS
open var preferredImageVisibility: UIMenuElement.ImageVisibility

The preferred visibility of the element's image.

var

prominentTabIdentifier

NewiOS
open var prominentTabIdentifier: String?

The identifier of the tab that should be displayed as prominent. Where supported, the specified tab receives enhanced visual emphasis in the tab bar. If this property is nil, and there is a UISearchTab that could become prominent (when automaticallyActivatesSearch = true), then the search tab will receive the prominent treatment by default.

Default is nil.

func

register

NewiOStvOS
open func register(_ policy: UITextAttachmentViewProviderReusePolicy, forTextAttachmentViewProviderType viewProviderType: AnyClass)

Register the UITextAttachmentViewProviderReusePolicy for all instances of a particular subclass of NSTextAttachmentViewProvider.

func

registerSceneAccessory

NewiOS
open func registerSceneAccessory(_ accessory: UISceneAccessory) -> UISceneAccessoryRegistration

Registers a new scene accessory configuration associated with this view controller.

The delegate type that the configuration defines will be called for all lifecycle events associated with the scene accessory.

Parameters

accessory
A configuration which defines system functionality necessary to present the scene accessory.

ReturnsA registration object which can be used to monitor changes for the scene accessory or unregister it.

func

setBorderColor

NewiOStvOSwatchOS
open func setBorderColor(_ borderColor: UIColor?, rectEdge: CGRectEdge)
func

setProminentTabIdentifier

NewiOS
open func setProminentTabIdentifier(_ identifier: String?, animated: Bool)

Sets the prominent tab identifier with an option to animate the change.

func

setWidth

NewiOStvOSwatchOS
open func setWidth(_ width: CGFloat, type: NSTextBlock.ValueType, for layer: NSTextBlock.Layer, rectEdge: CGRectEdge)
func

textViewportLayoutController

NewiOStvOS
open func textViewportLayoutController(_ textViewportLayoutController: NSTextViewportLayoutController, configureRenderingSurfaceFor textLayoutFragment: NSTextLayoutFragment)

NSTextViewportLayoutControllerDelegate method that the framework calls when the layout controller lays out a text layout fragment in the UI. Requires a call to super.

func

textViewportLayoutControllerDidLayout

NewiOStvOS
open func textViewportLayoutControllerDidLayout(_ textViewportLayoutController: NSTextViewportLayoutController)

NSTextViewportLayoutControllerDelegate method that the framework calls when the text viewport layout controller finishes its layout process. Requires a call to super.

func

textViewportLayoutControllerReceivedSetNeedsLayout

NewiOStvOS
open func textViewportLayoutControllerReceivedSetNeedsLayout(_ textViewportLayoutController: NSTextViewportLayoutController)

NSTextViewportLayoutControllerDelegate method that the framework calls when the text viewport layout controller receives a setNeedsLayout call. Requires a call to super.

func

textViewportLayoutControllerWillLayout

NewiOStvOS
open func textViewportLayoutControllerWillLayout(_ textViewportLayoutController: NSTextViewportLayoutController)

NSTextViewportLayoutControllerDelegate method that the framework calls when the text viewport layout controller starts its layout process. Requires a call to super.

struct

UIBarButtonItemVisibilityPriority

NewiOStvOS
public struct UIBarButtonItemVisibilityPriority : Hashable, Equatable, RawRepresentable, @unchecked Sendable
Declaration
public struct UIBarButtonItemVisibilityPriority : Hashable, Equatable, RawRepresentable, @unchecked Sendable {

    public init(_ rawValue: Int)

    public init(rawValue: Int)
}
extension

UIBarButtonItemVisibilityPriority

NewiOStvOS
extension UIBarButtonItemVisibilityPriority : Comparable
Declaration
extension UIBarButtonItemVisibilityPriority : Comparable {

    /// Returns a Boolean value indicating whether the value of the first
    /// argument is less than that of the second argument.
    ///
    /// This function is the only requirement of the `Comparable` protocol. The
    /// remainder of the relational operator functions are implemented by the
    /// standard library for any type that conforms to `Comparable`.
    ///
    /// - Parameters:
    ///   - lhs: A value to compare.
    ///   - rhs: Another value to compare.
    public static func < (lhs: borrowing UIBarButtonItemVisibilityPriority, rhs: borrowing UIBarButtonItemVisibilityPriority) -> Bool
}
enum

UIBarMinimizationSafeAreaAdjustment

NewiOStvOS
public enum UIBarMinimizationSafeAreaAdjustment : Int, @unchecked Sendable
Declaration
public enum UIBarMinimizationSafeAreaAdjustment : Int, @unchecked Sendable {

    /// The system determines the safe area adjustment.
    case automatic = 0

    /// The safe area adjusts as bars minimize, allowing content to reflow.
    @available(iOS 27.0, *)
    case enabled = 1

    /// The safe area remains unchanged as bars minimize.
    @available(iOS 27.0, *)
    case disabled = 2
}
enum

UIBarMinimizeBehavior

NewiOStvOS
public enum UIBarMinimizeBehavior : Int, @unchecked Sendable
Declaration
public enum UIBarMinimizeBehavior : Int, @unchecked Sendable {

    /// The system determines the minimize behavior.
    case automatic = 0

    /// Bar minimization is disabled.
    @available(iOS 27.0, *)
    case never = 1

    /// Minimize when the user scrolls down.
    @available(iOS 27.0, *)
    case onScrollDown = 2

    /// Minimize when the user scrolls up.
    @available(iOS 27.0, *)
    case onScrollUp = 3
}
func

unregisterSceneAccessory

NewiOS
open func unregisterSceneAccessory(_ registration: UISceneAccessoryRegistration)

Unregisters a scene accessory with the specified registration.

If the scene accessory associated to this registration is currently being presented, it will be dismissed.

func

viewportBounds

NewiOStvOS
open func viewportBounds(for textViewportLayoutController: NSTextViewportLayoutController) -> CGRect

NSTextViewportLayoutControllerDelegate method that the framework calls to request the current viewport, which is the view visible bounds plus the overdraw area. Requires a call to super.

var

visibilityPriority

NewiOStvOS
open var visibilityPriority: UIBarButtonItemVisibilityPriority

Visibility priority for this item when placed in a button bar.

Items with higher priority values are preserved longer when space is constrained. When an item is placed in an implicit group, the group inherits this priority.

The default value is UIBarButtonItemVisibilityPriorityStandard.

func

width

NewiOStvOSwatchOS
open func width(for layer: NSTextBlock.Layer, rectEdge: CGRectEdge) -> CGFloat
func

widthValueType

NewiOStvOSwatchOS
open func widthValueType(for layer: NSTextBlock.Layer, rectEdge: CGRectEdge) -> NSTextBlock.ValueType
func

NSTextLayoutManagerDelegate.textLayoutManager

NewiOStvOS
optional func textLayoutManager(_ textLayoutManager: NSTextLayoutManager, cacheTextAttachmentViewProvider viewProvider: NSTextAttachmentViewProvider, for textAttachment: NSTextAttachment)
func

NSTextLayoutManagerDelegate.textLayoutManager

NewiOStvOS
optional func textLayoutManager(_ textLayoutManager: NSTextLayoutManager, retrieveCachedTextAttachmentViewProviderFor attachment: NSTextAttachment) -> NSTextAttachmentViewProvider?
init

UIAction.init

NewiOStvOS
public convenience init(title: String = "", subtitle: String? = nil, image: UIImage? = nil, selectedImage: UIImage? = nil, preferredImageVisibility: UIMenuElement.ImageVisibility = .automatic, identifier: UIAction.Identifier? = nil, discoverabilityTitle: String? = nil, attributes: UIMenuElement.Attributes = [], state: UIMenuElement.State = .off, handler: @escaping UIActionHandler)
let

UIBarButtonItemVisibilityPriority.high

NewiOS
public static let high: UIBarButtonItemVisibilityPriority
init

UIBarButtonItemVisibilityPriority.init

NewiOS
public init(lowerThan other: UIBarButtonItemVisibilityPriority)
init

UIBarButtonItemVisibilityPriority.init

NewiOS
public init(higherThan other: UIBarButtonItemVisibilityPriority)
let

UIBarButtonItemVisibilityPriority.low

NewiOS
public static let low: UIBarButtonItemVisibilityPriority
let

UIBarButtonItemVisibilityPriority.standard

NewiOStvOS
public static let standard: UIBarButtonItemVisibilityPriority
case

UIBarMinimizationSafeAreaAdjustment.disabled

NewiOS
case disabled = 2

The safe area remains unchanged as bars minimize.

case

UIBarMinimizationSafeAreaAdjustment.enabled

NewiOS
case enabled = 1

The safe area adjusts as bars minimize, allowing content to reflow.

case

UIBarMinimizeBehavior.never

NewiOS
case never = 1

Bar minimization is disabled.

case

UIBarMinimizeBehavior.onScrollDown

NewiOS
case onScrollDown = 2

Minimize when the user scrolls down.

case

UIBarMinimizeBehavior.onScrollUp

NewiOS
case onScrollUp = 3

Minimize when the user scrolls up.

init

UICommand.init

NewiOStvOS
public convenience init(title: String = "", subtitle: String? = nil, image: UIImage? = nil, selectedImage: UIImage? = nil, preferredImageVisibility: UIMenuElement.ImageVisibility = .automatic, action: Selector, propertyList: Any? = nil, alternates: [UICommandAlternate] = [], discoverabilityTitle: String? = nil, attributes: UIMenuElement.Attributes = [], state: UIMenuElement.State = .off)
var

UIDocumentViewController.subtitle

NewiOS
open var subtitle: String?

The subtitle of the view. Default is nil. If nil, no subtitle will be displayed.

enum

UIDragInteraction.LiftBehavior

NewiOS
public enum LiftBehavior : UInt, @unchecked Sendable

Determines the gesture lift behaviors for the interaction.

Declaration
public enum LiftBehavior : UInt, @unchecked Sendable {

    /// The default lift behavior, which configures the `UIDragInteraction` with the default timing parameters.
    case `default` = 0

    /// An extended lift behavior, which has a longer lift delay for the `UIDragInteraction`, allowing better disambiguation of
    /// gestures in the same view. This is useful for 'canvas' like views where they can be many gestures involved in the manipulation
    /// of objects on screen. For extended lifts, when a second touch is recognized in the view, the gesture will be cancelled.
    case extended = 1
}
init

UIKeyCommand.init

NewiOStvOS
public convenience init(title: String = "", subtitle: String? = nil, image: UIImage? = nil, selectedImage: UIImage? = nil, preferredImageVisibility: UIMenuElement.ImageVisibility = .automatic, action: Selector, input: String, modifierFlags: UIKeyModifierFlags = [], propertyList: Any? = nil, alternates: [UICommandAlternate] = [], discoverabilityTitle: String? = nil, attributes: UIMenuElement.Attributes = [], state: UIMenuElement.State = .off)
init

UIMenu.init

NewiOStvOS
public convenience init(title: String = "", subtitle: String? = nil, image: UIImage? = nil, preferredImageVisibility: UIMenuElement.ImageVisibility = .automatic, identifier: UIMenu.Identifier? = nil, options: UIMenu.Options = [], preferredElementSize: UIMenu.ElementSize = .automatic, children: [UIMenuElement] = [])
enum

UIMenuElement.ImageVisibility

NewiOStvOS
public enum ImageVisibility : Int, @unchecked Sendable

Visibility options for a menu element's image.

Declaration
public enum ImageVisibility : Int, @unchecked Sendable {

    /// The element's image visibility is determined by the platform and context.
    case automatic = 0

    /// The element prefers its image to be visible, even in contexts where
    /// images are not shown by default.
    case visible = 1

    /// The element prefers its image to be hidden, even in contexts where
    /// images are shown by default.
    case hidden = 2
}
var

UIMenuLeaf.preferredImageVisibility

NewiOStvOS
var preferredImageVisibility: UIMenuElement.ImageVisibility { get set }

The preferred visibility of the element’s image.

var

UIScene.sceneAccessoryUserInfo

NewiOS
open var sceneAccessoryUserInfo: Any? { get }

An optional user info object, provided when creating the UISceneAccessory for this scene accessory.

This object can be used to associate data to the scene accessory configuration to be passed to the scene delegate when the scene connects.

var

UITabBarController.isAvailable

NewiOS
open var isAvailable: Bool { get }

Indicates when the tab sidebar is available to be displayed in the current context. When available, the sidebar is either visible, or can become visible depending on isHidden. Use this property to gate behaviors or UI that is dependent on the availability of the sidebar (like child tabs, or landing pages for groups).

Implement the delegate method tabBarController:sidebarAvailabilityDidChange: to be notified when the value of this property changes.

var

UITabBarController.preferredPlacement

NewiOS
open var preferredPlacement: UITabBarController.Sidebar.Placement

The preferred placement for the tab bar controller when the sidebar and tab bar are mutually exclusive, and only one placement can be displayed.

When set to UITabBarControllerSidebarPlacementAutomatic, the system resolves to the platform default. On iOS, this resolves to showing the tab bar by default. This property has no effect on platforms where multiple placements are supported, like on iPadOS, where the sidebar can be minimized into the top tab bar.

Default is UITabBarControllerSidebarPlacementAutomatic.

enum

UITabBarController.Sidebar.Placement

NewiOS
public enum Placement : Int, @unchecked Sendable
Declaration
public enum Placement : Int, @unchecked Sendable {

    /// The system determines the appropriate placement.
    case automatic = 0

    /// Display the sidebar when it is supported.
    case sidebar = 1

    /// Display the tab bar.
    case tabBar = 2
}
func

UITabBarController.Sidebar.Delegate.tabBarController

NewiOS
optional func tabBarController(_ tabBarController: UITabBarController, sidebarAvailabilityDidChange sidebar: UITabBarController.Sidebar)

Notifies the delegate when UITabBarController.Sidebar.isAvailable changes.

func

UIWindowSceneDelegate.supportedInterfaceOrientations

NewiOS
optional func supportedInterfaceOrientations(for windowScene: UIWindowScene) -> UIInterfaceOrientationMask

Returns the interface orientations supported by the window scene. The returned value replaces the app's UISupportedInterfaceOrientations Info.plist value for this scene. If not implemented, the Info.plist value is used.

Deprecated

3
func

supportedInterfaceOrientations

DeprecatediOS
open func supportedInterfaceOrientations(for window: UIWindow?) -> UIInterfaceOrientationMask
func

UIApplicationDelegate.application

DeprecatediOS
optional func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask

Removed

4
var

__NSLAYOUT_MANAGER_SHARED_SECTION__

RemovediOS
public var __NSLAYOUT_MANAGER_SHARED_SECTION__: Int32 { get }
RemovedAbsent from the 27 SDK interface. Declaration shown is from the 26 SDK.
extension

NSMutableParagraphStyle

RemovediOS
extension NSMutableParagraphStyle
RemovedAbsent from the 27 SDK interface. Declaration shown is from the 26 SDK.
Declaration
extension NSMutableParagraphStyle {

    open var alignment: NSTextAlignment
}
typealias

UIAccelerationValue

RemovediOS
public typealias UIAccelerationValue = Double
RemovedAbsent from the 27 SDK interface. Declaration shown is from the 26 SDK.
protocol

UIAccelerometerDelegate

RemovediOS
public protocol UIAccelerometerDelegate : NSObjectProtocol
RemovedAbsent from the 27 SDK interface. Declaration shown is from the 26 SDK.
Declaration
@MainActor public protocol UIAccelerometerDelegate : NSObjectProtocol {
}

No APIs match your filter.

← More in App UI: SwiftUI, AppKit & UIKit