Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

macOS Big Sur changes for developers

(macOS only)

User interface changes

macOS 11 Big Sur introduces many user interface changes that update the appearance of applications and make them more iOS-like. It also adds support for familiar iOS features — such as SF Symbols and text styles.

Icons and Images

macOS 11 refreshes icon design throughout the system and also introduces multipurpose feature icons that can represent items or functions in sidebars and tables. It also adopts iOS SF Symbols. macOS 11 automatically maps AppKit shared images — such as Action, Unlocked, and Share — to specific symbols. In some cases, a symbol might not have the same size or alignment as the AppKit image it replaces, so check your layout.

Application icons

In macOS 11, application icons combine a rounded-rectangle shape, a front-facing perspective, and a consistent drop shadow.

The new design does not preclude judicious expressiveness. For example, the Preview, Xcode, and TextEdit icons continue to combine depictions of the physical objects that best convey the applicationʼs core purpose, while incorporating the new shape, perspective, and shadow.

Document Icons

To compose a document icon, the system combines your application icon with the familiar folded-corner icon shape. If your application opens or creates a large number of document types, you can also supply a custom centre image or background appearance to help people distinguish them.

Feature Icons

A feature icon can represent an item (or category of items), a technology, or a type of information in a table view or in the content sidebar of a preferences window. A feature icon typically uses the macOS 11 rounded rectangle shape to contain a simple, unambiguous glyph, but it can also use custom shapes and colors. For help designing a feature icon, download the production template included in the Apple Design Resources for macOS.

macOS 11 macOS 10.15

Application Accent Colours

In macOS 11, you can specify an accent colour to customize the appearance of your applicationʼs buttons, selection highlighting, and sidebar glyphs. The system applies your accent colour when the current value in the user's General > Accent colour preferences is multicolour.

If users set the Accent colour preferences to a value other than multicolour, the system applies their chosen colour to the relevant items throughout your application, replacing your accent colour. The exception is a sidebar glyph that uses a fixed colour you specify. Because a fixed-colour sidebar glyph uses a specific colour to provide meaning, the system does not override its colour when users change the value of Accent colour preferences. To learn more, see Sidebars.

The iCloud glyph remains teal, even when the other glyphs use orange.

Windows and Views

Throughout macOS 11, windows adopt visual cues from iOS interfaces. For example, windows integrate the sidebar, toolbar, and content areas, use an increased corner radius, and display lightweight controls.

Toolbars and Title Bars

By default, toolbars are taller, window titles can display inline with controls, and toolbar items no longer include a bezel.

macOS 11 macOS 10.15

To match the default toolbar’s increased height, toolbar items automatically use the large control size. The exception is an integrated toolbar-title bar area — such as the one in a Safari window — which continues to use the regular control size. To accommodate the new default size, you’ll probably need to adjust the layout of your toolbar.

macOS 11 macOS 10.15

Continuing to use the minSize and maxSize APIs to set the size of a toolbar item can clip the control, because the current values don’t account for the larger default size. Use constraints if you need to specify minimum or maximum sizes for a toolbar control.

When horizontal space is limited, the toolbar can display the Search button in place of the search bar. When users click the Search button, the bar expands; when they click elsewhere in the window, the search bar collapses and the toolbar displays the button again.

In a preferences window, the toolbar can use SF Symbols, but the title position remains above the toolbar buttons. When needed for clarity, individual toolbar buttons can include colour. To indicate the active preference pane, the window applies a system-provided selection appearance to the selected toolbar button.

macOS 11 macOS 10.15

If your window includes multiple panes, you can align different subsets of toolbar items with each pane, so that as people resize the window, each set of items remains above its associated view.

Sidebars

In macOS 11, a sidebar extends to the full height of the window. Within the sidebar, default item spacing, row height, and glyph size all increase, and the selected-item highlight uses a rounded-corner appearance.

macOS 11 macOS 10.15

A sidebar’s row height, text, and glyph size depend on its overall size, which can be small, medium, or large. You can set the size programmatically, but users can also change it by selecting a different sidebar icon size in General preferences. The table below shows the differences in default sidebar metrics between macOS 11 and previous versions of macOS.

<thead>

</thead> <tbody>

</tbody>

Using SF Symbols is the easiest way to create sidebar glyphs that use the new metrics. Alternatively, you can use PDF template images to create sidebar glyphs; if you must use bitmap images, be sure to create them in small, medium, and large sizes, at both @1x and @2x resolutions.

By default, sidebar glyphs use the current accent colour (to learn more, see Application Accent Colours). If you need to clarify the meaning of an individual sidebar glyph, you can give it a fixed color that persists regardless of the user’s Accent colour preferences. Don’t use the ability to specify a fixed colour to stylize your application as a whole. In macOS, people expect to see their chosen accent colour throughout all the applications they use.

Table Views

In macOS 11, table views are larger overall, using taller rows, a larger font size, and more space between items to increase visual separation within and around table content. macOS 11 introduces three table-view styles to define different appearances that work well in specific window areas: inset, full-width, and automatic. For developer guidance, see NSTableView.style.

The inset style adds insets to the expanded spaciousness of macOS 11 tables. Because the inset style increases the visual space around the content, it works well in tables that fill the area between other views — such as sidebars and toolbars — and echoes the changes in sidebar appearance.

The classic, full-width table style remains available, but automatically includes the required content padding at the beginning and end of each row. The full-width style works best for tables that already have a visual margin around them, such as a table embedded in a preferences pane.

The automatic style means the system uses the table view’s position in the view hierarchy to help determine its appearance.

To create more spacious tables, macOS 11 uses several new table-view metrics. In the diagrams that follow, you can see how the layout of a table row differs between macOS 11 and macOS 10.15 and earlier.

macOS 11 macOS 10.15

The following table lists the values for the table-row layout areas shown above.

Table-view metric macOS 11 macOS 10.15 and earlier
Recommended row height 24pt 17pt
Minimum row height for text-only rows 18pt 17pt
Inset at leading and trailing row edges 10pt (inset style); 0pt (other styles) –
Padding at leading and trailing row edges 6pt –
Intercell spacing (17,0) (3,2)
Text size (style) 13pt (Body) 11pt

In addition to the values listed in the table above, inset-style tables in macOS 11 also include a 10pt vertical inset before the first row and after the last row.

As you adjust the layout of your table content to follow the new metrics:

Tip: TIP In macOS 11, a table's width continues to equal the width of its rows, but the new padding and insets prevent columns and cells from covering the entire row. The system also uses the specified style to determine the space to add to row background features, like selection appearance or alternating row colors. If you need to provide content that completely covers a row — such as a custom background appearance — add it to the row instead of the cells.

Sheets

Sheets no longer unfurl from the bottom edge of the parent window’s toolbar. In macOS 11, a sheet is a rounded rectangle view that floats on top of the dimmed parent window.

macOS 11 macOS 10.15

Alerts

Alerts are cardlike rectangles that use the same corner radius as all windows in macOS 11. Within an alert, most content is center aligned.

You can also use red text to emphasize a destructive action in an alert.

Menus

macOS 11 introduces visual changes to menus and menu content. If you use standard menus and menu items, you get the following default appearances automatically:

macOS 11 macOS 10.15

Controls

Refreshed AppKit controls — such as checkboxes, pop-up buttons, push buttons, and segmented controls — emphasize simplicity and boldness, similar to iOS controls while maintaining familiar appearances. When you use standard AppKit controls in your application, you shouldn’t have to adjust your interface to adopt the new appearances. The exception is the slider, which is taller.

Slider Size macOS 11 (default) macOS 10.15 and earlier (default)
Without tick marks Regular 28pt 19pt
Small 20pt 15pt
Mini 17pt 13pt
With tick marks Regular 28pt 24pt
Small 20pt 18pt
Mini 17pt 15pt

<thead>

</thead> <tbody>

</tbody>

<thead>

</thead> <tbody>

</tbody>

Beginning in macOS 11, the track of a slider with tick marks aligns with the center of the thumb.

Typography

Beginning in macOS 11, SF Pro is available as a variable font. The variable font format delivers a single package that includes the glyphs for all supported weights — such as regular, bold, and ultralight — in both uprights and italics. The variable format also supports optical sizing, which is a way to interpolate between glyphs to create size-specific versions of SF Pro to fit every design. Optical sizing replaces the need for the fixed-range Text and Display variants of SF Pro.

macOS 11 also introduces support for the full range of text styles, such as body, headline, and callout. Dynamic Type is not available in macOS 11. For guidance, see Typography.

Widgets

A widget elevates a small amount of useful content from your application. In macOS 11, you can create widgets in small, medium, and large sizes; people choose the size they want when they add your widget to Notification Center.

You can also create widgets for iOS and iPadOS. For guidance, see Widgets; for developer guidance, see WidgetKit.

Removed features

Deprecations

New features

Security

macOS Big Sur 11 improves system security by requiring an administrator password when a certificate trust settings change is made in the admin trust domain. Running as the root user alone is no longer sufficient to modify certificate trust. User trust domain settings continue to require confirmation by entering the password for the user’s account. This change may affect you if one of the following is true:

Kernel

Safari

Time Machine

Virtualisation

Built-in dynamic linker cache

New in macOS Big Sur 11, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache.

As the libraries are no longer present on the filesystem, it makes it difficult to disassemble them! Fortunately, there are ways to extract the system libraries from the cache. One way is provided by Apple itself: the dyld_shared_cache_util tool command-line tool. Unfortunately, this tool does not come installed with macOS Big Sur. However, the tool is open source - see dyld_shared_cache_util and for the "fixed to compile as is" Xcode project source see dyld-shared-cache-big-sur.

Other differences: Intel vs aarch64

ARM64/AArch64/Apple Silicon Support

macOS 11 Big Sur is the first macOS version that supports Apple's AArch64 processors on the desktop. FPC trunk supports targeting this platform.

The following instructions assume that you are working on an AArch64 Mac, that you have already installed FPC 3.2.2 for Intel, and that the Xcode.app bundle is located in the /Applications folder. You can place it elsewhere and adjust the paths accordingly so long as there are no spaces in the path.

Note: If you have only installed the standalone Command Line Tools and not the full Xcode package, you will need to replace /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/binwith/Library/Developer/CommandLineTools/usr/bin and /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdkwith/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

  1. Compile a native AArch64 compiler from the FPC trunk source :

make distclean make FPC=ppcx64 OPT="-ap -FD/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" CPU_TARGET=aarch64 -j 4 FPMAKEOPT="-T 4" all > build.log

  1. Copy the created native compiler to a safe place (the delete + copy is to avoid issues with a code signature caching bug in the OS - see Updating a signed file for an explanation) :

rm -f ppca64 ; cp compiler/ppca64 .

  1. Build a complete native FPC distribution for Darwin/AArch64 :

make distclean make FPC=$PWD/ppca64 OPT="-ap -FD/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" -j 4 FPMAKEOPT="-T 4" OVERRIDEVERSIONCHECK=1 all > build.log

  1. Install the built toolchain globally (under /usr/local) :

sudo make FPC=$PWD/ppca64 OPT="-ap -FD/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" install

  1. Enable the fpc binary to find the AArch64 compiler (ppca64). You only need to do this once, even if you build/install newer build later on (unless the version number of trunk would change) :

sudo ln -sf /usr/local/lib/fpc/3.3.1/ppca64 /usr/local/bin

  1. Create a file called ".fpc.cfg" (note the starting ".") in your home directory with the following contents :
  2. include /etc/fpc.cfg

-FD/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

Now you can use either fpc or ppca64 to compile AArch64 programs.

Warning: When you wish to build a newer version later on, make sure to restart at step 1. As always, compiling the trunk sources is only supported when you start with one of the latest two FPC releases, or with a compiler built from the same trunk sources. Starting with a trunk compiler built using previous trunk sources is not and never will be supported.

Creating a universal binary for aarch64 and x86_64

FPC applications

Open a Terminal and use the following commands:

bash
fpc my_app.pas -omy_app_ARM64 -Paarch64
fpc my_app.pas -omy_app_X8664 -Px86_64
lipo -create -output my_app my_app_ARM64 my_app_X8664
strip my_app

You can check that you have created a universal binary with this command:

bash
file my_app

which should produce output similar to this:

text
my_app: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
my_app (for architecture x86_64):   Mach-O 64-bit executable x86_64
my_app (for architecture arm64):    Mach-O 64-bit executable arm64

Lazarus applications

bash
lipo -create -output my_app my_app_ARM64 my_app_X8664
strip my_app

You now have a universal binary with which to replace the symbolic link in your final application bundle's MacOS directory. You can check that you have created a universal binary with this command:

bash
file my_app

which should produce output similar to this:

text
my_app: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
my_app (for architecture x86_64):   Mach-O 64-bit executable x86_64
my_app (for architecture arm64):    Mach-O 64-bit executable arm64

Removing duplicate resources in universal binaries

When creating universal binaries any resources will be duplicated in each executable which increases the file size of the universal binaries, sometimes quite substantially depending on the size of the resources.

The Free Pascal Compiler supports loading external resources on Darwin using the -We command line option. For usage examples, see:

Code signing - Intel vs M1

On Intel systems running Big Sur very little is required to be signed except for kernel and system extensions and related code which require special approval from Apple.

The situation is different on M1 Apple Silicon (aarch64) systems running Big Sur. There are a few situations to consider:

Checking the status of code signing for FPC and/or FPC and Lazarus native code executables shows:

pascal
$ codesign -dv -r- ./program
Executable=/Users/trev/Documents/fpc_adhoc_test/program
Identifier=program
Format=Mach-O thin (arm64)
CodeDirectory v=20400 size=3392 flags=0x20002(adhoc,linker-signed) hashes=103+0 location=embedded
Signature=adhoc
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
# designated => cdhash H"6d17593d42b7b10d8af344197c48df47beda2779"
text
$ codesign -dv -r- DemoDownload.app
Executable=/Users/trev/Documents/laz_resume_dload/DemoDownload.app/Contents/MacOS/DemoDownload
Identifier=DemoDownload
Format=app bundle with Mach-O thin (arm64)
CodeDirectory v=20400 size=110533 flags=0x20002(adhoc,linker-signed) hashes=3451+0 location=embedded
Signature=adhoc
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
# designated => cdhash H"bb0a310c980906bd6320deaabc72f543dc725bbb"

So, it appears that the macOS linker is doing the ad hoc code signing for us and generating the all-important cdhash.

What happens if you edit the executable with the cdhash (I changed a single occurrence of Assertion to ASsertion) ?

pascal
 $ ./program 
 Killed

and:

pascal
Process:               DemoDownload [7888] 
Path:                  /Users/USER/Documents/*/DemoDownload.app/Contents/MacOS/DemoDownload
Identifier:            com.company.DemoDownload
Version:               0.1 (1)
Code Type:             ARM-64 (Native)
Parent Process:        ??? [1]
Responsible:           DemoDownload [7888]
User ID:               501
pascal
Date/Time:             2021-03-14 15:52:46.806 +1100
OS Version:            macOS 11.2.3 (20D91)
Report Version:        12
Anonymous UUID:        FDB6D79D-592D-3959-8F4F-9EC29A74836C
pascal
Time Awake Since Boot: 5300 seconds
pascal
System Integrity Protection: enabled
pascal
Crashed Thread:        0  Dispatch queue: com.apple.main-thread
pascal
Exception Type:        EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes:       0x0000000000000032, 0x00000001023bd758
Exception Note:        EXC_CORPSE_NOTIFY
pascal
Termination Reason:    Namespace CODESIGNING, Code 0x2

Beware if you use a workflow involving tools that modify a binary after linking (eg strip or install_name_tool). In these situations you will almost certainly need to manually use codesign as an additional build phase to properly ad-hoc sign your binary.

What does this mean for natively compiled FPC and Lazarus aarch64 binaries?

If you deploy:

1) an unsigned binary to your endusers, they will NOT be able to execute the binary on an M1 Apple Silicon computer. Note, however, that if the binary was linked on an M1 Apple Silicon computer, the macOS linker will have ad hoc signed the binary for you.

2) an ad hoc signed binary to your endusers, they will be able to execute the binaries on an M1 Apple Silicon computer. This is because these new signatures are not bound to the specific machine that was used to build the executable; they can be verified on any other system and will be sufficient to comply with the new default code signing requirement on Macs with Apple silicon. However, given that these signatures do not bear any valid identity, binaries signed this way cannot pass Gatekeeper.

For manual ad hoc code signing of an application bundle (note that a dash is using for the signing identity after the -s argument):

text
codesign --force --deep -s - MyApp.app

Also note that you cannot sign an application bundle where the executable is a symlink (eg an application compiled with Lazarus) unless you replace the symlink with the linked executable.

For manual ad hoc signing of a command line utility:

text
codesign --force -s - MyExe

Code signing an x86_64 binary on an aarch64 machine

Apple Big Sur "New Look" external links

Apple Silicon external links

Big Sur Release Notes


From the Free Pascal wiki, page "macOS Big Sur changes for developers", as it stood on 2022-05-08 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 3, last changed by WikiArchive .