What’s New in the macOS SDK
Learn about the key technologies and capabilities available in the macOS SDK, the toolkit you use to build apps for Mac. For detailed information on API changes in the latest released versions, including each beta release, see the macOS Release Notes.
macOS 12 SDK
With the macOS 12 SDK, you can build apps that bring people together. SharePlay provides easy ways to build all-new shared experiences, whether you’re creating a streaming app that offers shared playback or a collaborative design tool that enables simultaneous edits by users around the world. Games and pro apps take on a new dimension with powerful new features in Metal. And Object Capture in RealityKit helps you create 3D models from photos in record time.
SharePlay and Group Activities
SharePlay offers a new way for people to share your app. Media streaming apps can let users share content through the new Group Activities API with full-fidelity video and all syncing handled by the system. And for shared experiences beyond media streaming, the GroupSessionMessenger API offers a secure data channel that syncs information between multiple instances of your apps across multiple users.
SwiftUI brings new features, such as improved list views, better search experiences, and support for control focus areas. Gain more control over lower-level drawing primitives with the new Canvas API, a modern, GPU-accelerated equivalent of drawRect. And with the new Accessibility Representation API, your custom controls easily inherit full accessibility support from existing standard SwiftUI controls.
To help you do more while managing ever more complex shader code, Metal adds an unparalleled suite of advanced GPU debugging tools and new features to help you realize the full potential of your graphics code. New features include enhanced graphics and compute integration, function stitching, updates to Ray Tracing, GPU-accelerated ML training, and more.
TestFlight for Mac
Later this year, you’ll be able to invite testers to try out your Mac apps and provide valuable feedback before publishing on the Mac App Store.
The macOS 12 SDK brings new and improved APIs for apps built with Mac Catalyst, allowing you display pop-up buttons, tooltips, and a subtitle in a windowʼs titlebar. You can also provide Touch alternatives, keyboard navigation, and support for Siri intents, as well as allow users to print everywhere using Command-P, and more.Many of these features are also available to iPad and iPhone apps running on Apple silicon Macs.
The power of Shortcuts is coming to macOS, so the capabilities of your app can be multiplied by exposing them as building blocks called actions. You can build Shortcuts actions on macOS whether your app is built with Mac Catalyst or AppKit, and your app can even run shortcuts itself.
The Accessibility framework introduces audio graphs, a new way to represent data in your charts and graphs that allows VoiceOver to construct and play an audible representation of it. This framework also adds an API to query information relevant for MFi hearing devices, such as streaming preferences, streaming capabilities, and paired hearing devices.
Turn a series of 2D images from your iPhone or iPad into a photorealistic 3D object that’s optimized for AR using Object Capture in RealityKit 2. This new macOS API gives you access to state-of-the-art photogrammetry software so you can make unique 3D models with no 3D modeling expertise required.
Create ML adds the Hand Pose and Hand Action classifier tasks to both the Create ML API and developer tool included with Xcode. These classifiers recognize hand positions in still images and hand movements in videos, respectively.
Core ML adds ML Packages, a new, future-looking model format that provides the flexibility to edit metadata and visibility to track changes with source control. Core ML also adds ML Programs, a new model type that compiles more efficiently, decouples a model’s architecture from its weights, and offers more control over the computational precision of its intermediate tensors. The new MLShapedArray API lets you work with multidimensional data using idiomatic Swift that improves the code’s type safety and readability.
Tabular Data. Tabular Data makes it easy to programmatically import information from JSON and CSV files and prepare datasets ready for Core ML, Create ML, or your own custom solution. Use Tabular Data’s central DataFrame API to sort, join, group, split, encode, decode, explode, filter, slice, combine, and transform the rows and columns of your tabular data to meet your needs.
Sound Analysis. Sound Analysis adds a new sound classifier that apps can use to identify over 300 unique sounds from live audio or an audio file. A new time window duration API gives you the tune prediction accuracy versus time precision.
Keyboard and mouse alternatives for Macs with M1
iPhone and iPad games that require touch input or game controllers can use the new prebuilt support for keyboard, mouse, and trackpad as alternatives.
GameKit provides new ways to discover and invite players to participate in a game. Players can now invite contacts, message groups, and anyone with a phone number or email address. Players see the status of other players receiving and accepting invitations and, optionally, start with a minimum number of players while waiting for others to join.
StoreKit’s new In-App Purchase API provides a simple, powerful, and secure way to work with your app’s products and transactions. The new API takes advantage of modern Swift features, such as concurrency, to simplify your in-app purchase workflow. Its cryptographically signed transaction and subscription information uses the JSON Web Signature (JWS) format, which is a secure and simple way to parse on the client. A new entitlements API makes it easy to determine which content and services your app should unlock for users. Use the new StoreKit API throughout the in-app purchase process — from displaying in-app purchases, to managing access to content and providing customer service within your app.
Give users more options by adding coupons, deferred payments, recurring payments, shipping dates, and read-only pickup addresses to your Apple Pay transactions
Enrich your app experience with audio recognition. Match music to the millions of songs in Shazam’s vast catalog or make any prerecorded audio recognizable by building your own custom catalog using audio from video, podcasts, and more.
CloudKit builds on top of the new async/await support in Swift 5.5, making the asynchronous API easier to use and more configurable. CloudKit adds Record Zone Sharing, which builds on the existing sharing infrastructure to let users share the entire contents of a record zone with other iCloud users. You can now encrypt a record’s values using new APIs on CKRecord, helping you offer strong privacy guarantees to your users. The new CloudKit Schema Language allows you to retrieve and upload textual representations of your CloudKit schema, which means you can now version it using the same tools as your app’s source code.
CloudKit Console. CloudKit improves your workflows with a brand-new CloudKit Console, an intuitive web-based control panel that you can use throughout the development lifecycle of your app, and cktool command line interface.
Core Data. Core Data provides new APIs that facilitate the sharing of managed objects with other iCloud users, specifically for CloudKit-backed persistent stores. In addition, you can now choose to encrypt an entity’s attributes before they’re saved to iCloud. Spotlight integration has also been enhanced, with additional APIs that allow for fine-grained control over what data is added to the index and when.
Virtual conference extension
Apps that provide virtual conference services can use this new app extension in EventKit to integrate directly into users’ calendar events. You’ll be able to provide custom locations for events, a link that lets people join the conference with a single tap, and additional information, like dial-in details.
With the macOS 11 SDK, your app can take advantage of a redesigned user interface, widgets in Notification Center, and new SwiftUI layouts. Machine learning adds style transfer and action classification to models that are ready to be trained, and offers a CloudKit-based deployment solution. Vision API additions help your app analyze image and video more thoroughly. You can include markups in your emails and websites that help Siri Event Suggestions surface your events. And Safari adds web extensions to further customize the browsing experience, while other browsers can now contribute Screen Time web-usage data.
New User Interface
macOS 11 introduces a redesigned user interface that enhances usability and approachability, and provides greater consistency with iPadOS. Most existing macOS apps that use system-provided controls automatically adopt the new appearance. If your app has a custom appearance, visit the macOS Human Interface Guidelines to learn how to update your app so it continues looking great for users.
AppKit introduces a variety of changes to interface elements, including alerts, browsers, buttons, menus, search fields, segmented controls, and toolbars. For details, see AppKit Release Notes.
App Store Privacy Information
Privacy is at the core of the entire macOS experience, and new privacy information in the Mac App Store gives users even more transparency and control over their personal information. Later this year, the Mac App Store will help users understand apps’ privacy practices, and you’ll need to enter your privacy practice details into App Store Connect for display on your Mac App Store product page.
Widgets give users quick access to timely, at-a-glance information from your app in the macOS Notification Center. macOS 11 offers a redesigned widget experience. Your app can present widgets in multiple sizes, allow user customization, include interactive features, and update content at appropriate times. To learn about designing widgets, see the Human Interface Guidelines. To learn how to support widgets in your app, see the WidgetKit framework.
Apps built with Mac Catalyst automatically adopt the new look of macOS 11 and make full use of the native screen resolution of Mac. macOS 11 has new and improved APIs for keyboards, menus, toolbars, color panels, and more, giving you greater control over the look and behavior of your app. To learn how to get full control of every pixel of the interface and Mac-specific controls, such as pull-down menus and checkboxes, see Choosing a User Interface Idiom for Your Mac App. To learn more about building Mac versions of your iPad apps, see the Mac Catalyst documentation.
Your machine learning apps gain new functionality, flexibility, and security with the updates in macOS 11. Core ML adds model deployment with a dashboard for hosting and deploying models using CloudKit, so you can easily make updates to your models without updating your app or hosting the models yourself. Core ML model encryption adds another layer of security for your models, handling the encryption process and key management for you. The Core ML converter supports direct conversion of PyTorch models to Core ML.
The Create ML app’s new Style Transfer template stylizes photos and videos in real time, and the new Action Classification template classifies a single person’s actions in a video clip. The Object Detection and Word Tagger templates have new transfer learning options to approve model accuracy when training data is limited. Training control helps you explore models and interact with them during model training. And ML Compute takes advantage of GPUs to accelerate training on the Mac. For more information, see the Core ML, Create ML, and ML Compute developer documentation.
With macOS 11, the Vision framework has added APIs for trajectory detection in video, hand and body pose estimation for images and video, contour detection to trace the edges of objects and features in image and video, and optical flow to define the pattern of motion between consecutive video frames. To learn more about these features, see the Vision framework documentation. In particular, read Building a Feature-Rich App for Sports Analysis to find out how these features come together in a sample app.
The Natural Language framework has new API to provide sentence embedding that creates a vector representation of any string; word tagging to train models that classify natural language, customized for your specific domain; and confidence scores that rank the framework’s predictions. For more information, see the Natural Language framework documentation.
SwiftUI provides a selection of new built-in views, including a progress indicator and a text editor. It also supports new view layouts, like grids and outlines. Grids and the new lazy version of stacks load items only as needed.
Starting in Xcode 12, you can now use SwiftUI to define the structure and behavior of an entire app. Compose your app from scenes containing the view hierarchies that define an app’s user interface. Add menu commands, handle life-cycle events, invoke system actions, and manage storage across all of your apps. By incorporating WidgetKit into your app, you can also create widgets that provide quick access to important content right on the iOS Home screen or the macOS Notification Center. For more information, see App Structure and Behavior.
Safari Web Extensions
Users can customize Safari with new functionality and features by adding your extensions. You can now leverage Safari Web Extensions inside Safari and access migration tools that make it easy to convert popular extensions for other browsers to Safari. Safari extensions also give users privacy control — they can decide which sites an extension can work with and give it access just once, all day, or all the time. The new Extensions category on the Mac App Store showcases Safari extensions, with editorial spotlights and top charts.
Family Sharing for In-App Purchases
Family Sharing is a simple way for users to share subscriptions, purchases, and more with everyone in their household. And with macOS 11, you can choose to offer Family Sharing for your users’ in-app purchases and subscriptions so their whole family can enjoy the added benefits. See the SKProduct and SKPaymentTransactionObserver for the new APIs.
Uniform Type Identifiers
Use the new Uniform Type Identifiers framework to describe file formats and in-memory data for transfer, such as the pasteboard; and to identify resources, such as directories, volumes, and packages.
A new Accessibility framework lets your app dynamically deliver a subset of accessible content to a user based on context.
Use the new Apple Archive framework to perform fast, multithreaded, lossless compression of directories, files, and data in macOS.
macOS 11 includes Screen Time APIs for sharing and managing web-usage data and observing changes a parent or guardian makes. For more details, see the Screen Time framework documentation.