Skip to content

Commit 5751b1d

Browse files
Use Swift UI for the Conjugate App (#604)
* feat:use swift ui for conjugate app * chore: removed unncessary files in build phase * fix:linting issues * Update ConjugateTab.swift with license header Removed unnecessary comments and added SPDX license header. * Update Scribe-i18n to fix merge conflicts --------- Co-authored-by: Andrew Tavis McAllister <andrew.t.mcallister@gmail.com>
1 parent ef0a658 commit 5751b1d

12 files changed

Lines changed: 296 additions & 800 deletions

File tree

Conjugate/AppNavigation.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import SwiftUI
4+
5+
struct AppNavigation<Content: View>: View {
6+
let content: () -> Content
7+
8+
var body: some View {
9+
if #available(iOS 16, *) {
10+
NavigationStack {
11+
content()
12+
}
13+
} else {
14+
NavigationView {
15+
content()
16+
}
17+
}
18+
}
19+
}

Conjugate/Base.lproj/ConjugateAppScreen.storyboard

Lines changed: 0 additions & 636 deletions
This file was deleted.

Conjugate/ConjugateApp.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import SwiftUI
4+
5+
@main
6+
struct ConjugateApp: App {
7+
var body: some Scene {
8+
WindowGroup {
9+
ContentView()
10+
}
11+
}
12+
}

Conjugate/ContentView.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import SwiftUI
4+
5+
struct ContentView: View {
6+
var body: some View {
7+
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
8+
}
9+
}
10+
11+
#Preview {
12+
ContentView()
13+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import SwiftUI
4+
5+
struct AppNavigation<Content: View>: View {
6+
@ViewBuilder let content: () -> Content
7+
8+
var body: some View {
9+
if #available(iOS 16, *) {
10+
NavigationStack {
11+
content()
12+
}
13+
} else {
14+
NavigationView {
15+
content()
16+
}
17+
}
18+
}
19+
}

Conjugate/Views/ContentView.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import SwiftUI
4+
5+
struct ContentView: View {
6+
var body: some View {
7+
TabView {
8+
ConjugateTab()
9+
.tabItem {
10+
Label("Conjugate", systemImage: "character.book.closed")
11+
}
12+
13+
SettingsTab()
14+
.tabItem {
15+
Label("Settings", systemImage: "gearshape")
16+
}
17+
18+
AboutTab()
19+
.tabItem {
20+
Label("About", systemImage: "info.circle")
21+
}
22+
}
23+
}
24+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import SwiftUI
4+
5+
struct AboutTab: View {
6+
var body: some View {
7+
AppNavigation {
8+
Text("About")
9+
.font(.largeTitle)
10+
.navigationTitle("About")
11+
}
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import SwiftUI
4+
5+
struct ConjugateTab: View {
6+
var body: some View {
7+
AppNavigation {
8+
Text("Conjugate")
9+
.font(.largeTitle)
10+
.navigationTitle("Conjugate")
11+
}
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import SwiftUI
4+
5+
struct ConjugateTab: View {
6+
var body: some View {
7+
AppNavigation {
8+
Text("Conjugate")
9+
.font(.largeTitle)
10+
.navigationTitle("Conjugate")
11+
}
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import SwiftUI
4+
5+
struct SettingsTab: View {
6+
var body: some View {
7+
AppNavigation {
8+
Text("Settings")
9+
.font(.largeTitle)
10+
.navigationTitle("Settings")
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)