Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's new in AppKit on macOS 26

What's new in AppKit on macOS 26

macOS native symposium (https://macos-native.github.io) #11 登壇資料

WWDC25で発表されたmacOS 26の、AppKitでの変更点洗い出しや注目ポイントなど、TahoeのためのmacOSアプリ開発のキャッチアップをお話しします。

Avatar for 1024jp

1024jp

July 11, 2025
Tweet

More Decks by 1024jp

Other Decks in Programming

Transcript

  1. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp ࣗݾ঺հ CotEditor Gapplin Qli application

    works plain-text editor SVG viewer movie player macOS meet-up icon works @1024jp hobby macOS developer/designer ͞ΑͳΒݱߦΞΠίϯͨͪʜ
  2. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 88%$HVJEFGPSNBD04 w /FX%FTJHO w "QQMF*OUFMMJHFODF

    w "QQ*OUFOUTGSBNFXPSLVQEBUFT w .FUBMQPXFSFEHBNFT w 7JEFP& ff FDUT"1* w -JWF"DUJWJUJFT 􀉣 https://developer.apple.com/news/?id=uf3qdaoe ࠓ೥ͷ߲໨ r 88%$ͷϓϥοτϑΥʔϜຖͷ·ͱΊϖʔδ r ηογϣϯಈը͚ͩͰͳ͘ɺ αϯϓϧίʔυ΍ղઆ౳υΩϡϝϯτ΁ͷϦϯΫ΋͋Δ r "QQMFͷਪٕ͠ज़͕ฒΜͰΔ
  3. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp NBD04SFMBUFETFTTJPOTJO88%$ r ࣮࣭ɺ8IBU`T/FXJO"QQ,JU r 5BIPFͷ6*࡮৽ؔ࿈ͷ৘ใ͸͜ΕͰ଍ΓΔɻ

    310 Build an AppKit app with the new design https://developer.apple.com/videos/play/wwdc2025/310 256 What ’ s New in SwiftUI https://developer.apple.com/videos/play/wwdc2025/256 323 Build a SwiftUI app with the new design https://developer.apple.com/videos/play/wwdc2025/323 245 What ’ s New in Swift https://developer.apple.com/videos/play/wwdc2025/245 220 Say hello to the new look of app icons https://developer.apple.com/videos/play/wwdc2025/220 229 Make your Mac app more accessible to everyone https://developer.apple.com/videos/play/wwdc2025/229 ͦͷ΄͔NBD04ʹؔ࿈͢Δجຊηογϣϯ ͓͢͢Ίʂ 219 Meet Liquid Glass https://developer.apple.com/videos/play/wwdc2025/219 356 Get to know the new design system https://developer.apple.com/videos/play/wwdc2025/356
  4. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 88%$/PUFT 􀉣 https://wwdcnotes.com/documentation/wwdcnotes/ r Ͳ͔ͬͰΈͨ͜ͱͷ͋ΔϨΠΞ΢τͷඇެࣜαΠτ

    r ༗ࢤ͕88%$ͷ4FTTJPOಈըΛηογϣϯ͝ͱʹ هࣄͱͯ͠จࣈԽͯ͠·ͱΊ͍ͯΔ r ಈըݟΔͷ͕ͩΔ͍࣌ʹ࠷ద r ݟ΍͍͢ ඇެࣜ
  5. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 8IBU`TOFXJO"QQ,JU 124 What ’ s

    new in AppKit https://developer.apple.com/videos/play/wwdc2024/10124 r ೥·Ͱ͸͋ͬͨ r ೥·Ͱ͸͋ͬͨ
  6. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp "QQ,JUIFBEFSEJ f Xcode-beta.app/ └ Contents/

    └ Developer/ └ Platforms/ └ MacOSX.platform/ └ Developer/ └ SDKs/ └ MacOSX.sdk/ └ System/ └ Library/ └ Frameworks/ └ AppKit.framework/ └ Headers/
  7. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp -JRVJE(MBTTSFMBUFEWJFXT Glass Effect class NSGlassEffectView

    class NSGlassEffectContainerView class NSBackgroundExtensionView 3 1 0 Build an AppKit app with the new design
  8. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 4QMJUWJFXT NSSplitViewItem var automaticallyAdjustsSafeAreaInsets: Bool

    class NSSplitViewItemAccessoryViewController var topAlignedAccessoryViewControllers: [NSSplitViewItemAccessoryViewController] var bottomAlignedAccessoryViewControllers: [NSSplitViewItemAccessoryViewController] func addTopAlignedAccessoryViewController(NSSplitViewItemAccessoryViewController) func insertTopAlignedAccessoryViewController(NSSplitViewItemAccessoryViewController, at: Int) func removeTopAlignedAccessoryViewController(at: Int) func addBottomAlignedAccessoryViewController(NSSplitViewItemAccessoryViewController) func insertBottomAlignedAccessoryViewController(NSSplitViewItemAccessoryViewController, at: Int) func removeBottomAlignedAccessoryViewController(at: Int) 3 1 0 Build an AppKit app with the new design
  9. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp $POUSPMT NSControl NSControl.ControlSize.extraLarge NSButton var

    tintProminence: NSTintProminence var backgroundTintColor: NSColor var borderShape: NSControl.BorderShape NSButton.BezelStyle.glass ˡυΩϡϝϯτ͔Β ɹɹ࿙ΕͯΔ enum NSControl.BorderShape { case automatic case capsule case roundedRectangle case circle } NSSlider var tintProminence: NSTintProminence var naturalValue: Double 3 1 0 Build an AppKit app with the new design NSSegmentedControl var borderShape: NSControl.BorderShape
  10. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 5PPMCBSJUFNT NSToolbarItem var style: NSToolbarItem.Style

    var backgroundTintColor: NSColor var badge: NSItemBadge? NSToolbarItem.Style.prominent 3 1 0 Build an AppKit app with the new design
  11. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 1SFGFSTDPNQBDUDPOUSPMTJ[FNFUSJDT NSView var prefersCompactControlSizeMetrics: Bool

    3 1 0 Build an AppKit app with the new design r NBD04ʹ͓͚Δ-JRVJE(MBTTͷϨΠΞ΢τͷᷤ౻Λࣽ٧Ίͨϑϥά r NBD04Ͱͷίϯτϩʔϧͷେ͖͞มߋΛ཈ࢭͯ͠ɺ NBD04·Ͱͷେ͖͞Λ࠾༻͢Δ
  12. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 􀁌 Label "1*TJOUSPEVDFEJOTFTTJPOTCVUOPUFYJTU NSView struct

    NSView.LayoutRegion func layoutGuide(for region: NSView.LayoutRegion) -> NSLayoutGuide func edgeInsets(for region: NSView.LayoutRegion) -> NSEdgeInsets func directionalEdgeInsets(for region: NSView.LayoutRegion) -> NSDirectionalEdgeInsets func rect(for region: NSView.LayoutRegion) -> NSRect 3 1 0 Build an AppKit app with the new design NSView.LayoutRegions func safeArea(cornerAdaption: AdaptivityAxis?) -> LayoutRegion func margins(cornerAdaption: AdaptivityAxis?) -> LayoutRegion
  13. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 4ZNCPMDPO fi HVSBUJPOT NSImage.SymbolConfiguration convenience

    init(colorRenderingMode: NSImage.SymbolColorRenderingMode) convenience init(variableValueMode: NSImage.SymbolVariableValueMode) r 4'4ZNCPMͷ৽͍͠ඳըελΠϧ r 4XJGU6*ʹ΋ಉ౳ͷ"1*͕͋Δ ͷͰͦͬͪͰௐ΂Δͱ৘ใ͕๛෋ enum SymbolVariableValueMode { case automatic case color case draw } enum SymbolColorRenderingMode { case automatic case flat case gradient } 3 3 7 What ’ s New in SF Symbol 7
  14. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 4ZNCPMDPO fi HVSBUJPOT 3 3

    7 What ’ s New in SF Symbol 7 SymbolEffect static var drawOff: DrawOffSymbolEffect static var drawOn: DrawOnSymbolEffect
  15. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 5FYUMJTUNBSLFST NSTextContainerStorage var includesTextListMarkers: bool

    NSTextList class var includesTextListMarkers: bool NSWritingToolsCoordinator var includesTextListMarkers: bool r ϦετϚʔΧʔΛ಺༰ʹؚΊΔ͔Ͳ͏͔
  16. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp SFTPMWFT/BUVSBM"MJHONFOU8JUI#BTF8SJUJOH%JSFDUJPO var resolvesNaturalAlignmentWithBaseWritingDirection: Bool NSTextField

    NSTextLayoutManager var resolvesNaturalAlignmentWithBaseWritingDirection: Bool r 35-༻ͷϨΠΞ΢τղܾํ๏
  17. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 8SJUJOHUPPMT static var presentationIntent: NSWritingToolsResultOptions

    NSWritingToolsResultOptions r 3FTVMU0QUJPOTͷ͏ͪͷ.plainTextҎ֎ͱͳΔɺ.richText .list .tableΛଋͶͨ΋ͷ
  18. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp "DDFTTJCJMJUZSPMFT NSAccessibility.Role static let headingRole:

    NSAccessibility.Role static let listMarkerRole: NSAccessibility.Role static let webAreaRole: NSAccessibility.Role NSAccessibility.subrole static let suggestionSubrole: NSAccessibility.Subrole 􀌬 FB18556966 New NSAccessibility.Role APIs should omit the `Role` suffix (macOS 26 SDK)
  19. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp "DDFTTJCJMJUZBUUSJCVUFT NSAccessibility.Attribute static let blockQuoteLevelAttribute:

    NSAccessibility.Attribute static let headingLevelAttribute: NSAccessibility.Attribute static let languageAttribute: NSAccessibility.Attribute static let visitedAttribute: NSAccessibility.Attribute NSAccessibility.ParameterizedAttribute static let indexForChildUIElementAttribute: NSAccessibility.ParameterizedAttribute static let indexForChildUIElementInNavigationOrderAttribute: NSAccessibility.ParameterizedAttribute static let uiElementForSearchPredicateParameterizedAttribute: NSAccessibility.ParameterizedAttribute
  20. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp "DDFTTJCJMJUZTFBSDILFZT NSAccessibilitySearchKey anyTypeSearchKey, articleSearchKey, blockquoteSameLevelSearchKey,

    blockquoteSearchKey, boldFontSearchKey, buttonSearchKey, checkBoxSearchKey, controlSearchKey, differentTypeSearchKey, fontChangeSearchKey, fontColorChangeSearchKey, frameSearchKey, graphicSearchKey, headingLevel1SearchKey, headingLevel2SearchKey, headingLevel3SearchKey, headingLevel4SearchKey, headingLevel5SearchKey, headingLevel6SearchKey, headingSameLevelSearchKey, headingSearchKey, italicFontSearchKey, keyboardFocusableSearchKey, landmarkSearchKey, linkSearchKey, listSearchKey, liveRegionSearchKey, misspelledWordSearchKey, outlineSearchKey, plainTextSearchKey, radioGroupSearchKey, sameTypeSearchKey, staticTextSearchKey, styleChangeSearchKey, tableSameLevelSearchKey, tableSearchKey, textFieldSearchKey, textStateChangeTypeKey, textStateSyncKey, underlineSearchKey, unvisitedLinkSearchKey, visitedLinkSearchKey
  21. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp &WFOUT NSGestureRecognizer var modifierFlags: NSEvent.ModifierFlags

    var name: String? func mouseCancelled(NSEvent) NSResponder func mouseCancelled(with: NSEvent) NSEvent.EventType case mouseCancelled 􀌬 FB18618763 New `.mouseCancelled(_:)` method in NSGestureRecognizer on macOS 26 should have `with` argument label
  22. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 1MBDFIPMEFSTUSJOHT NSTextField var placeholderStrings: [String]

    var placeholderAttributedStrings: [NSAttributedString] // Placeholder textField.placeholderString = “Dog” // Placeholder_s_ textField.placeholderStrings = ["Dog", "Cow", "Dogcow"] r ςΩετͷBSSBZΛड͚औΕΔϓϨʔεϗϧμ
  23. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp ͳͲ r ܕɾΞΫλʔ෇͖Ͱ/PUJ fi DBUJPOΛड͚ΒΕΔ

    ͔͍͍ͬ͜΍ͭʢ଴๬ʂʣ r NBD04  r /PUGPS"QQ,JU 5ZQFEOPUJ fi DBUJPOT ਖ਼֬ʹ͍͑͹"QQ,JUͰ΋࢖͑Δͷ͕ͩɺ "QQ,JUͷΫϥεʹ͸͜ͷ"1*༻ͷϝοηʔδ໊͕ ΄ͱΜͲ༻ҙ͞Ε͍ͯͳ͍ɻ 6*8JOEPXͷ༷ࢠ ͳͲ NotificationCenter func addObserver<Message>(of: Message.Subject?, for: Message.Type, using: (Message) async -> Void) -> NotificationCenter.ObservationToken 2 4 5 What ’ s New in Swift
  24. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 5ZQFEOPUJ fi DBUJPOT NSWorkspace struct

    AccessibilityDisplayOptionsDidChangeMessage struct ActiveSpaceDidChangeMessage struct DidActivateApplicationMessage struct DidChangeFileLabelsMessage struct DidDeactivateApplicationMessage struct DidHideApplicationMessage struct DidLaunchApplicationMessage struct DidMountVolumeMessage struct DidRenameVolumeMessage struct DidTerminateApplicationMessage struct DidUnhideApplicationMessage struct DidUnmountVolumeMessage struct DidWakeMessage struct ScreensDidSleepMessage struct ScreensDidWakeMessage struct SessionDidBecomeActiveMessage struct SessionDidResignActiveMessage struct WillLaunchApplicationMessage struct WillSleepMessage struct WillUnmountVolumeMessage /48PSLTQBDF͚ͩ੔උࡁΈ
  25. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp )%3TVQQPSUTVQQSFTTJPO var applicationShouldSuppressHighDynamicRangeContent: Bool NSApplication

    static var shouldBeginSuppressingHighDynamicRangeContent: NotificationCenter .BaseMessageIdentifier<NSApplication.ShouldBeginSuppressingHighDynamicRangeContent> static var shouldEndSuppressingHighDynamicRangeContent: NotificationCenter .BaseMessageIdentifier<NSApplication.ShouldEndSuppressingHighDynamicRangeContent> NotificationCenter.MessageIdentifier struct ShouldBeginSuppressingHighDynamicRangeContent struct ShouldEndSuppressingHighDynamicRangeContent r )%3ͷαϙʔτΛೳಈతʹ੾Γସ͑Δ"1* ͜͜΋/PUJGJDBUJPO͕੔උ͞ΕͯΔ
  26. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 4XJGU6*IPTUJOHTIFFUSFQSFTFOUBUJPO class HostingSheetRepresentation func beginSheet<V>(content:

    () -> V, completionHandler: (() -> Void)?) -> NSWindow.HostingSheetRepresentation<V> func endSheet<V>(NSWindow.HostingSheetRepresentation<V>) NSWindow r /48JOEPX͔Β௚઀4XJGU6*ͷγʔτΛ։ดͰ͖Δ let token = window.beginSheet { Text("Hello Clarus!”) .scenePadding() } window.endSheet(token) .BDͩͱɺ ϝΠϯ΢Πϯυ΢͸4XJGU6*ʹҠͤͳ͍͚Ͳ γʔτ͘Β͍͸4XJGU6*Ͱॻ͍ͨํָ͕ͳ͜ͱ͕ଟ͍ͷͰɺ ͚ͬ͜͏ศརͦ͏ 2 5 6 What ’ s New in SwiftUI
  27. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 4XJGU6*IPTUJOHTDFOFSFQSFTFOUBUJPO NSApplication func addSceneRepresentation<C>(NSHostingSceneRepresentation<C>) @main

    final class AppDelegate: NSApplicationDelegate { let scene = NSHostingSceneRepresentation { Settings { SettingsView() } } func applicationWillFinishLaunching(_ notification: Notification) { NSApplication.shared.addSceneRepresentation(scene) } @IBAction func showAppSettings(_ sender: NSMenuItem) { scene.environment.openSettings() } } 2 5 6 What ’ s New in SwiftUI
  28. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp /4%PDVNFOU $POUSPMMFST IBOEMFST macOS 26

    SDK func save(to url: URL, ofType typeName: String, for saveOperation: NSDocument.SaveOperationType, completionHandler: @escaping @Sendable ((any Error)?)-> Void) func save(to url: URL, ofType typeName: String, for saveOperation: NSDocument.SaveOperationType, completionHandler: @escaping ((any Error)?)-> Void) macOS 15.5 SDK 􀌬 FB18474058 Completion handler of NSDocument.save(to:ofType:for: completionHandler:) should be annotated with @MainActor
  29. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 4XJGU6*TXJGUVOUFSGBDFEJ f w XJOEPXSFTJ[JOH w

    -JTU5BCMFඳըͷ࠷దԽ w %SBH%SPQؔ࿈ w (FTUVSFؔ࿈ w WJTJPO04࿈ܞ r มߋ఺ͨ͘͞Μ͋Δ͠ɺ ࢿྉ΋·ͱ·ͬͯΔͷͰׂѪ r NBD04ݻ༗ͷ࿩୊ͩͱҎԼ͔ɿ 4XJGU6*શൠͷهࣄͩͱ ݴٴ͞Εͳ͍Մೳੑ͋Γ
  30. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 'PVOEBUJPOIFBEFSEJ f NSCalendar.Identifier static let

    bangla: NSCalendar.Identifier static let dangi: NSCalendar.Identifier static let gujarati: NSCalendar.Identifier static let kannada: NSCalendar.Identifier static let malayalam: NSCalendar.Identifier static let marathi: NSCalendar.Identifier static let odia: NSCalendar.Identifier static let tamil: NSCalendar.Identifier static let telugu: NSCalendar.Identifier static let vietnamese: NSCalendar.Identifier static let vikram: NSCalendar.Identifier
  31. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 'PVOEBUJPOIFBEFSEJ f NSStringAttribute.Key static let

    listItemDelimiter: NSAttributedString.Key static let writingDirection: NSAttributedString.Key
  32. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 'PVOEBUJPOIFBEFSEJ f FileManager func fetchLatestRemoteVersionOfItem(at:

    URL, completionHandler: ((NSFileVersion, (any Error)?) -> Void)?) func pauseSyncForUbiquitousItem(at url: URL, completionHandler: (((any Error)?) -> Void)?) func replaceItemAt(_ originalItemURL: URL, withItemAt: URL, backupItemName: String?, options: FileManager.ItemReplacementOptions) throws -> NSURL? func resumeSyncForUbiquitousItem(at url: URL, with: NSFileManagerResumeSyncBehavior, completionHandler: ((any Error)?) -> Void) func uploadLocalVersionOfUbiquitousItem(at url: URL, withConflictResolutionPolicy: NSFileManagerUploadLocalVersionConflictPolicy, completionHandler: ((NSFileVersion, (any Error)?) -> Void)?) struct UbiquityIdentityDidChangeMessage ໋໊͕ࡶ͗͢Δʜ
  33. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 'PVOEBUJPOIFBEFSEJ f URLResourceKey static let

    ubiquitousItemIsSyncPausedKey: URLResourceKey static let ubiquitousItemSupportedSyncControlsKey: URLResourceKey URLSessionConfiguration var enablesEarlyData: Bool
  34. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 6OEPNBOBHFS macOS 26 SDK @MainActor

    @preconcurrency func registerUndo<TargetType>(withTarget target: TargetType, handler: @escaping @MainActor (TargetType) -> Void) r handlerʹ@MainActor͕෇͍ͨɻ ΍ͬͨͶʂ @preconcurrency func registerUndo<TargetType>(withTarget target: TargetType, handler: @escaping (TargetType) -> Void) macOS 15.5 SDK
  35. macOS native 8IBU`TOFXJO"QQ,JU ©2025 1024jp 4FUUJOHTXJOEPXMBZPVU 88%$Ͱ"QQMFͷΤϯδχΞʹ㘤͍ͯΈͨɿ ͦ͏ɺ͜Ε͕৽͍͠ઃఆͷελΠϧɻ ͜Ε͔Β͸طଘΞϓϦ΋ɺͲΜͲΜ ͜ͷελΠϧʹγϑτ͢ΔͷΛΦεεϝʂ

    SwiftUI for macOSΤϯδχΞ AppKitΤϯδχΞ ͍΍͊ɺ.BDͷઃఆ΢Πϯυ΢ͱ͍͑͹͜ ͷैདྷͷͩΑɻʢ$PU&EJUPSͷઃఆ΢Πϯυ ΢Λݟͯʣͦ͏ɺ͜Εɻͦͷ··Ͱ͍͍ ΑɻҠߦͳΜͯඞཁͳ͍͔Βɻ 􀉪 􀉪 9DPEF͸·͊ɺಛघ͔ͩΒͶ͐ɻ ઃఆ߲໨ଟ͍͠ɻ͋Ε͸ྫ֎ɻ