Skip to content

Commit 73a6c5d

Browse files
authored
Switch to tabs for indentation (#486)
1 parent d620dac commit 73a6c5d

File tree

131 files changed

+6005
-6006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+6005
-6006
lines changed

.editorconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
root = true
33

44
[*]
5-
indent_style = space
6-
indent_size = 4
5+
indent_style = tab
76
trim_trailing_whitespace = true
87
insert_final_newline = true
98
end_of_line = lf

Examples/Showcase/Showcase/App.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import SwiftUI
22

33
@main
44
struct App: SwiftUI.App {
5-
var body: some Scene {
6-
WindowGroup {
7-
AppView()
8-
}
9-
}
5+
var body: some Scene {
6+
WindowGroup {
7+
AppView()
8+
}
9+
}
1010
}
1111

1212
#Preview {
13-
AppView()
13+
AppView()
1414
}

Examples/Showcase/Showcase/AppView.swift

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,69 @@ import SwiftUI
22
import SwiftUIIntrospect
33

44
struct AppView: View {
5-
var body: some View {
6-
ContentView()
7-
#if os(iOS) || os(tvOS) || os(visionOS)
8-
.introspect(
9-
.window,
10-
on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)
11-
) { window in
12-
window.backgroundColor = .brown
13-
}
14-
#elseif os(macOS)
15-
.introspect(.window, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { window in
16-
window.backgroundColor = .lightGray
17-
}
18-
#endif
19-
}
5+
var body: some View {
6+
ContentView()
7+
#if os(iOS) || os(tvOS) || os(visionOS)
8+
.introspect(
9+
.window,
10+
on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)
11+
) { window in
12+
window.backgroundColor = .brown
13+
}
14+
#elseif os(macOS)
15+
.introspect(.window, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { window in
16+
window.backgroundColor = .lightGray
17+
}
18+
#endif
19+
}
2020
}
2121

2222
struct ContentView: View {
23-
@State var selection = 0
23+
@State var selection = 0
2424

25-
var body: some View {
26-
TabView(selection: $selection) {
27-
ListShowcase()
28-
.tabItem { Label("List", systemImage: "1.circle") }
29-
.tag(0)
30-
ScrollViewShowcase()
31-
.tabItem { Label("ScrollView", systemImage: "2.circle") }
32-
.tag(1)
33-
#if !os(macOS)
34-
NavigationShowcase()
35-
.tabItem { Label("Navigation", systemImage: "3.circle") }
36-
.tag(2)
37-
PresentationShowcase()
38-
.tabItem { Label("Presentation", systemImage: "4.circle") }
39-
.tag(3)
40-
#endif
41-
ControlsShowcase()
42-
.tabItem { Label("Controls", systemImage: "5.circle") }
43-
.tag(4)
44-
UIViewRepresentableShowcase()
45-
.tabItem { Label("UIViewRepresentable", systemImage: "6.circle") }
46-
.tag(5)
47-
}
48-
#if os(iOS) || os(tvOS)
49-
.introspect(.tabView, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26)) { tabBarController in
50-
if #available(iOS 26, macOS 26, tvOS 26, *) {
51-
tabBarController.tabBar.backgroundColor = .green
52-
} else {
53-
let appearance = UITabBarAppearance()
54-
appearance.configureWithOpaqueBackground()
55-
appearance.backgroundColor = .green
56-
tabBarController.tabBar.standardAppearance = appearance
57-
tabBarController.tabBar.scrollEdgeAppearance = appearance
58-
}
59-
}
60-
#elseif os(macOS)
61-
.introspect(.tabView, on: .macOS(.v12, .v13, .v14)) { splitView in
62-
splitView.subviews.first?.layer?.backgroundColor = NSColor.green.cgColor
63-
}
64-
#endif
65-
}
25+
var body: some View {
26+
TabView(selection: $selection) {
27+
ListShowcase()
28+
.tabItem { Label("List", systemImage: "1.circle") }
29+
.tag(0)
30+
ScrollViewShowcase()
31+
.tabItem { Label("ScrollView", systemImage: "2.circle") }
32+
.tag(1)
33+
#if !os(macOS)
34+
NavigationShowcase()
35+
.tabItem { Label("Navigation", systemImage: "3.circle") }
36+
.tag(2)
37+
PresentationShowcase()
38+
.tabItem { Label("Presentation", systemImage: "4.circle") }
39+
.tag(3)
40+
#endif
41+
ControlsShowcase()
42+
.tabItem { Label("Controls", systemImage: "5.circle") }
43+
.tag(4)
44+
UIViewRepresentableShowcase()
45+
.tabItem { Label("UIViewRepresentable", systemImage: "6.circle") }
46+
.tag(5)
47+
}
48+
#if os(iOS) || os(tvOS)
49+
.introspect(.tabView, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26)) { tabBarController in
50+
if #available(iOS 26, macOS 26, tvOS 26, *) {
51+
tabBarController.tabBar.backgroundColor = .green
52+
} else {
53+
let appearance = UITabBarAppearance()
54+
appearance.configureWithOpaqueBackground()
55+
appearance.backgroundColor = .green
56+
tabBarController.tabBar.standardAppearance = appearance
57+
tabBarController.tabBar.scrollEdgeAppearance = appearance
58+
}
59+
}
60+
#elseif os(macOS)
61+
.introspect(.tabView, on: .macOS(.v12, .v13, .v14)) { splitView in
62+
splitView.subviews.first?.layer?.backgroundColor = NSColor.green.cgColor
63+
}
64+
#endif
65+
}
6666
}
6767

6868
#Preview {
69-
AppView()
69+
AppView()
7070
}

0 commit comments

Comments
 (0)