App Services / 14:03

Use SwiftUI with AppKit and UIKit

App ServicesSwiftUI & UI Frameworksiosipadosmacos

Key Points

  • Shows how to incrementally adopt SwiftUI in the existing AppKit or UIKit app.
  • Also explains how to add complete SwiftUI scenes to an app without changing the overall architecture.
  • The session moves through Observation in AppKit, Hosting SwiftUI in AppKit, AppKit gestures in SwiftUI, SwiftUI in the main menu, SwiftUI scenes in AppKit.
  • Key concepts include SwiftUI, AppKit, UIKit, NSSlider, NSSwitch, NSSegmentedControl, UpdateConstraints, NSViewController.
  • Platform coverage: ios, ipados, macos.

Condensed Flow

01

Observation in AppKit:

Focuses on AppKit, UpdateConstraints, NSViewController.

02

Hosting SwiftUI in AppKit:

Focuses on SwiftUI, AppKit, CoreGraphics, NSHostingView.

03

AppKit gestures in SwiftUI:

Focuses on AppKit, SwiftUI, NSViewRepresentable, NSViews.

04

SwiftUI in the main menu:

Focuses on SwiftUI.

05

SwiftUI scenes in AppKit:

Focuses on SwiftUI, AppKit, NSHostingSceneRepresentation.

More Detail

Additional details

  • Detailed flow: Observation in AppKit -> Hosting SwiftUI in AppKit -> AppKit gestures in SwiftUI -> SwiftUI in the main menu -> SwiftUI scenes in AppKit.
  • APIs and concepts to recognize: SwiftUI, AppKit, UIKit, NSSlider, NSSwitch, NSSegmentedControl, UpdateConstraints, NSViewController, CoreGraphics, NSHostingView, NSViewRepresentable, NSViews.
  • Implementation focus: SwiftUI, ColorModel, NSHostingMenu, NSMenu.

Resources