Last updated 5 months ago
Was this helpful?
⟩ ⟩ Scene (protocol)
A that a must conform to.
管理應用程式的「起始畫面」與「顯示範圍」。
WindowGroup:自訂介面(可以有多個視窗)
DocumentGroup:自動處理文件開啟、儲存、關閉等功能
SettingsScene:建立應用程式的設定介面(主要用於 macOS)
import SwiftUI @main struct MyApp: App { // ⭐️ `App` protocol requirement var body: some Scene { WindowGroup { ContentView() } } }
📁 custom scene
struct MyScene: Scene { // ⭐️ `Scene` protocol requirement var body: some Scene { WindowGroup { MyRootView() } } }
⟩ ⟩ ⟩
heckj ⟩