Repository navigation
Expand file tree
/
Copy pathExampleApp.swift
More file actions
44 lines (41 loc) · 1.67 KB
/
Copy pathExampleApp.swift
File metadata and controls
44 lines (41 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// The example application: the Storybook (//storybook), compiled for
// every platform. The Storybook apps (com.LoganShire.IsomerStorybook,
// "Storybook") are its one cell per platform, each with that platform's
// renderer:
// * examples/apple/storybook_{ios,macos}_application (Apple's SwiftUI)
// * examples/web/storybook_web_application (React)
// * examples/android/storybook_android_application (Compose)
// * examples/linux/storybook_linux_application (OpenGL)
// * examples/windows/storybook_windows_application (DirectX)
// The rest compile the same source as test cells: delivered as wasm
// (example_full_wasm_*, example_full_feature), the web's GPU renderer
// (example_full_webgpu_*), Electron.
#if canImport(UpdateKit)
import UpdateKit
#endif
import Storybook
import SwiftUI
@main
struct ExampleApplication: App {
init() {
// The example's host-side dependency injection for compiled cells
// (PlatformServicesInstall.swift); a no-op wherever the host injected first.
installPlatformDependenciesIfNeeded()
#if canImport(UpdateKit)
// The build it is, written for Applications at each launch; and its
// updates, told of while it is in front. The iPhone's and the Mac's
// Storybook alone link UpdateKit: elsewhere Applications
// learns the version otherwise (Android's package manager), or not.
AppUpdates.start()
#endif
}
var body: some Scene {
// The title reaches the host as the document/window/task title.
WindowGroup("Storybook") {
StorybookView()
}
#if os(macOS)
.defaultSize(width: 1280, height: 820)
#endif
}
}