Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2021 App Store, Distribution & MarketingEssentialsSwiftUI & UI Frameworks

WWDC21 · 23 min · App Store, Distribution & Marketing / Essentials / SwiftUI & UI Frameworks

Qualities of great iPad and iPhone apps on Macs with M1

It’s easier than ever to offer your existing iPad and iPhone apps on Macs with M1. We’ll show you how to bring your app to macOS, and explore how the system automatically bridges various features of your app to work on the Mac. We’ll also provide guidance on best practices in your iPad app, combined with improvements in macOS Monterey — like Apple Pay support, improved AV handling, and shortcuts — to provide the fullest experience on Macs with M1.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 3 snippets

Limit the range of allowable scene sizes swift · at 7:16 ↗
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
    guard let windowScene = scene as? UIWindowScene, let sizeRestrictions = windowScene.sizeRestrictions else { return }
    sizeRestrictions.minimumSize = CGSize(width: 640, height: 480)
    sizeRestrictions.maximumSize = CGSize(width: 1920, height: 1080)
}
Automatically enable Touch Alternatives xml · at 15:03 ↗
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>defaultEnablement</key>
    <true/>
    <key>version</key>
    <real>1</real>
    <key>requiredOnboarding</key>
    <array>                              <!-- Only include applicable features! -->
        <string>Tap</string>
        <string>Arrow Swipe</string>
        <string>Scroll Drag</string>
        <string>Tilt</string>
        <string>Trackpad Capture</string>
    </array>
</dict>
</plist>
Required delegate method to enable Apple Pay support swift · at 17:17 ↗
optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController,
	didRequestMerchantSessionUpdate
	handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void)

Resources