Skip to content

Commit fadba9a

Browse files
committed
SwiftUI: reorganize a few files (NFC)
Move some of the essential types into a new location.
1 parent fa79db1 commit fadba9a

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

Sources/SwiftWin32UI/Essentials/App.swift renamed to Sources/SwiftWin32UI/App Structure and Behaviour/App.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ public protocol App {
1818

1919
/// Creates an instance of the application using the body as the content.
2020
init()
21+
22+
/// Initializes and runs the application.
23+
static func main()
2124
}
2225

2326
extension App {
24-
/// Initializes and runs the application.
2527
public static func main() {
2628
ApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil,
2729
String(describing: String(reflecting: Self.self)))

Sources/SwiftWin32UI/Essentials/Scene.swift renamed to Sources/SwiftWin32UI/App Structure and Behaviour/Scene.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/// A part of the application's user interface.
55
public protocol Scene {
6-
/// Creating a Scene
6+
// MARK - Creating a Scene
77

88
/// The type of scene representing the body of this scene.
99
associatedtype Body: Scene
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// Copyright © 2020 Saleem Abdulrasool <[email protected]>
22
// SPDX-License-Identifier: BSD-3-Clause
33

4+
/// A scene that presents a group of identically structured windows.
45
public struct WindowGroup<Content: View>: Scene {
56
public var body: some Scene {
67
fatalError("\(#function) not yet implemented")
78
}
89

910
// MARK - Creating a Window Group
1011

12+
/// Creates a window group.
1113
public init(@ViewBuilder content: () -> Content) {
1214
}
1315
}

Sources/SwiftWin32UI/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ add_library(SwiftWin32UI SHARED
1111
SceneBuilder.swift
1212
ViewBuilder.swift)
1313
target_sources(SwiftWin32UI PRIVATE
14-
Essentials/App.swift
15-
Essentials/Scene.swift
16-
Essentials/WindowGroup.swift)
14+
"App Structure and Behaviour/App.swift"
15+
"App Structure and Behaviour/Scene.swift"
16+
"App Structure and Behaviour/WindowGroup.swift")
1717
target_sources(SwiftWin32UI PRIVATE
1818
"Views and Controls/View.swift")
1919
target_sources(SwiftWin32UI PRIVATE

0 commit comments

Comments
 (0)