Difference between revisions of "macOS Monterey changes for developers"

From Lazarus wiki
Jump to navigationJump to search
(→‎New features: Add virtualisation)
(→‎New features: AppKit new features added)
Line 4: Line 4:
  
 
== New features ==
 
== New features ==
 +
 +
=== AppKit ===
 +
 +
* NSButtons no longer highlight using the accent color when clicked. Before using any subclass that performs custom drawing, inspect the button cell’s interiorBackgroundStyle property to determine if the bezel draws in a normal or emphasized state. (macOS 12 beta)
 +
 +
* NSButtons now support custom tinting with the bezelColor property. This property — previously applied only in the Touch Bar — now functions for all in-window buttons using the NSButtonTypeMomentaryPushIn style. (macOS 12 beta)
 +
 +
* NSSlider: When clicking on the track, for linear sliders, circular sliders, or dial, the slider now animates to the new value.
 +
You can now tint sliders with colorful track fills using the trackFillColor property. This property now functions for all in-window sliders. (macOS 12 beta)
 +
 +
* NSSegmentedControls controls now support custom tinting via the selectedSegmentBezelColor property. This property now functions for all in-window segmented control styles that draw colorful selected segments. (macOS 12 beta)
 +
 +
* NSPopover has a new animation when appearing and dismissing. (macOS 12 beta)
 +
 +
* SF Symbols now support layered symbol images. Layered symbol images use an updated data format to annotate each path element of the symbol with a level in a hierarchy: primary, secondary, tertiary, and so on. At draw time, AppKit can assign different colors to each layer of the symbol using new APIs on NSImage.SymbolConfiguration. Many system-provided symbol images redesigned to include layered versions. (macOS 12 beta)
 +
 +
* NSMenu: The new user preference “Automatically hide and show the menu bar in full screen” in Dock & Menu Bar preferences is enabled by default. In macOS Monterey 12, the user can choose to disable this setting to always show the menu bar in full screen spaces. Standard full screen windows are resized to fit below the menu bar. Some apps assume a full screen-sized window, and don’t work well with this setting. (macOS 12 beta)
 +
 +
* NSTableView 20-point spacing precedes each group row to make the separation between sections more visible. Source lists have a similar, but smaller, 13-point spacing. This applies to the NSTableView.Style.inset and NSTableViewStyleFullWidth effective styles in apps linked against the macOS 12 SDK. NSTableView.Style.plain doesn’t display the spacing. The floating group row transition — previously a push transition — instantly replaces the new floating group row. It occurs when the x-height of the group row’s label meets the bottom of a currently floating group row. (macOS 12 beta)
 +
 +
* NSOutlineView: The disclosure button now aligns with the cell view’s firstBaselineOffsetFromTop. The system overrides it in NSTableCellView so it matches the baseline of its textField (assuming textfield sets the baseline). Overriding the property and returning 0 reverts to the previous behaviour. When collapsing several items, the NSOutlineViewSelectionDidChangeNotification only posts once. Previously, it posted once per collapsed item. (macOS 12 beta)
 +
 +
* NSOpenPanel: Setting canChooseFiles to false automatically disabled files, but all of the directory contents were sent to panel(_:shouldEnable:) or panel:shouldShowFilename:. In macOS Monterey 12, files aren’t sent to the delegate methods unless canChooseFiles is true. In addition, file packages are excluded unless treatsFilePackagesAsDirectoriesis is true. This change allows optimization in the delegate method. (macOS 12 beta)
 +
 +
* TextKit 2 introduces a new text layout engine and its associated API. You can use TextKit 2 alongside the existing TextKit API. (macOS 12 beta)
  
 
=== Networking ===
 
=== Networking ===

Revision as of 03:07, 27 July 2021

macOSlogo.png

This article applies to macOS only.

See also: Multiplatform Programming Guide

Light bulb  Note: Under construction until macOS 12 is released

New features

AppKit

  • NSButtons no longer highlight using the accent color when clicked. Before using any subclass that performs custom drawing, inspect the button cell’s interiorBackgroundStyle property to determine if the bezel draws in a normal or emphasized state. (macOS 12 beta)
  • NSButtons now support custom tinting with the bezelColor property. This property — previously applied only in the Touch Bar — now functions for all in-window buttons using the NSButtonTypeMomentaryPushIn style. (macOS 12 beta)
  • NSSlider: When clicking on the track, for linear sliders, circular sliders, or dial, the slider now animates to the new value.

You can now tint sliders with colorful track fills using the trackFillColor property. This property now functions for all in-window sliders. (macOS 12 beta)

  • NSSegmentedControls controls now support custom tinting via the selectedSegmentBezelColor property. This property now functions for all in-window segmented control styles that draw colorful selected segments. (macOS 12 beta)
  • NSPopover has a new animation when appearing and dismissing. (macOS 12 beta)
  • SF Symbols now support layered symbol images. Layered symbol images use an updated data format to annotate each path element of the symbol with a level in a hierarchy: primary, secondary, tertiary, and so on. At draw time, AppKit can assign different colors to each layer of the symbol using new APIs on NSImage.SymbolConfiguration. Many system-provided symbol images redesigned to include layered versions. (macOS 12 beta)
  • NSMenu: The new user preference “Automatically hide and show the menu bar in full screen” in Dock & Menu Bar preferences is enabled by default. In macOS Monterey 12, the user can choose to disable this setting to always show the menu bar in full screen spaces. Standard full screen windows are resized to fit below the menu bar. Some apps assume a full screen-sized window, and don’t work well with this setting. (macOS 12 beta)
  • NSTableView 20-point spacing precedes each group row to make the separation between sections more visible. Source lists have a similar, but smaller, 13-point spacing. This applies to the NSTableView.Style.inset and NSTableViewStyleFullWidth effective styles in apps linked against the macOS 12 SDK. NSTableView.Style.plain doesn’t display the spacing. The floating group row transition — previously a push transition — instantly replaces the new floating group row. It occurs when the x-height of the group row’s label meets the bottom of a currently floating group row. (macOS 12 beta)
  • NSOutlineView: The disclosure button now aligns with the cell view’s firstBaselineOffsetFromTop. The system overrides it in NSTableCellView so it matches the baseline of its textField (assuming textfield sets the baseline). Overriding the property and returning 0 reverts to the previous behaviour. When collapsing several items, the NSOutlineViewSelectionDidChangeNotification only posts once. Previously, it posted once per collapsed item. (macOS 12 beta)
  • NSOpenPanel: Setting canChooseFiles to false automatically disabled files, but all of the directory contents were sent to panel(_:shouldEnable:) or panel:shouldShowFilename:. In macOS Monterey 12, files aren’t sent to the delegate methods unless canChooseFiles is true. In addition, file packages are excluded unless treatsFilePackagesAsDirectoriesis is true. This change allows optimization in the delegate method. (macOS 12 beta)
  • TextKit 2 introduces a new text layout engine and its associated API. You can use TextKit 2 alongside the existing TextKit API. (macOS 12 beta)

Networking

  • The default Accept-Language header that URLSession sends has an updated format and corrected values for multiple locales. In addition to the preferred language, the header also includes the current system language as a fallback if it differs from the preferred language. This behavior affects apps that link against macOS 12. (macOS 12 beta)
  • URLSession now includes async functions. (macOS 12 beta)

Virtualisation

  • Interfaces that previously took unsigned long long arguments or returned unsigned long long results have been updated to use the uint64_t type instead. (macOS 12 beta)

Deprecations

  • MKPinAnnotationView and MapPin are deprecated. (macOS 12 beta)
  • Support for clear text HTTP URL schemes for Proxy Automatic Configuration (PAC) is now deprecated. Use only HTTPS URL schemes for PAC. This affects all PAC configurations including, but not limited to, configurations set via Settings, System Preferences, profiles, and URLSession APIs such as connectionProxyDictionary, and CFNetworkExecuteProxyAutoConfigurationURL(_:_:_:_:). If you configure a clear text HTTP PAC URL, the system may upgrade it to HTTPS during PAC file loads. Web Proxy Auto-Discovery (WPAD) Protocol via DNS isn’t affected. Dynamic Host Configuration Protocol (DHCP) Option 252 WPAD may attempt to upgrade clear text HTTP URLs to HTTPS during PAC file loads. (macOS 12 beta)
  • The output Combine publisher property for the message stream is deprecated. The PhotogrammetrySession.outputs property which uses the new Swift feature AsyncSequence replaces it. (macOS 12 beta)
  • Fn (Function) shortcut modifier is deprecated and reserved for system usage. (macOS 12 beta)

Monterey Release Notes