macOS 26 appkit 如何适配

Asked on 2025-09-19

1 search

To adapt your AppKit app for macOS 26, you should consider the following updates and practices:

  1. Control Heights and Sizes: The Mini, small, and medium controls are now slightly taller, providing more space around the control label and enhancing the click target size. Use auto layout to adapt to these varying control heights and avoid hard coding the heights of controls. For compatibility with existing high-density layouts, use the PrefersCompact Control Size Metrics property on NSView to request control sizes that match previous macOS releases. This property is inherited down the view hierarchy and, when set to true, reverts controls to sizing compatible with previous macOS versions. Build an AppKit app with the new design

  2. New Design System: The new design of macOS introduces the liquid glass material, a translucent surface that reflects and refracts light, creating a sense of depth and dynamism. AppKit provides APIs to adopt this new design, including the Scroll Edge effect for legibility atop edge-to-edge scrolling content. Build an AppKit app with the new design

  3. Adopting New APIs: Incrementally adopt SwiftUI with new menu and animation APIs, and adopt new system standard components like content type, pickers, cursors, and text entry suggestions. Ensure your toolbars support all display modes. What’s new in AppKit

  4. Liquid Glass Effects: When you rebuild your app with Xcode 26, standard controls will automatically be rendered with the new design and materials. You can then identify opportunities where Liquid Glass can enhance your app, particularly for custom controls and views. Platforms State of the Union

These updates will help ensure your AppKit app is well-adapted to the new design principles introduced in macOS 26.