Skip to content

Commit 9c86618

Browse files
author
Mithun
committed
Tab Bar
1 parent e0f41ce commit 9c86618

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

DesignCode.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
ABB215DE22DB713300424B38 /* UpdateList.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABB215DD22DB713300424B38 /* UpdateList.swift */; };
1414
ABB215E022DB7F4700424B38 /* UpdateDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABB215DF22DB7F4700424B38 /* UpdateDetail.swift */; };
1515
ABB215E222DC472900424B38 /* UpdateStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABB215E122DC472900424B38 /* UpdateStore.swift */; };
16+
ABB215E422DC7D0000424B38 /* TabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABB215E322DC7D0000424B38 /* TabBar.swift */; };
1617
ABE07CBF22D74F5700D209BE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE07CBE22D74F5700D209BE /* AppDelegate.swift */; };
1718
ABE07CC122D74F5700D209BE /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE07CC022D74F5700D209BE /* SceneDelegate.swift */; };
1819
ABE07CC322D74F5700D209BE /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE07CC222D74F5700D209BE /* ContentView.swift */; };
@@ -28,6 +29,7 @@
2829
ABB215DD22DB713300424B38 /* UpdateList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateList.swift; sourceTree = "<group>"; };
2930
ABB215DF22DB7F4700424B38 /* UpdateDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateDetail.swift; sourceTree = "<group>"; };
3031
ABB215E122DC472900424B38 /* UpdateStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateStore.swift; sourceTree = "<group>"; };
32+
ABB215E322DC7D0000424B38 /* TabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBar.swift; sourceTree = "<group>"; };
3133
ABE07CBB22D74F5700D209BE /* DesignCode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DesignCode.app; sourceTree = BUILT_PRODUCTS_DIR; };
3234
ABE07CBE22D74F5700D209BE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3335
ABE07CC022D74F5700D209BE /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
@@ -70,6 +72,7 @@
7072
children = (
7173
ABE07CBE22D74F5700D209BE /* AppDelegate.swift */,
7274
ABE07CC022D74F5700D209BE /* SceneDelegate.swift */,
75+
ABB215E322DC7D0000424B38 /* TabBar.swift */,
7376
ABE07CC222D74F5700D209BE /* ContentView.swift */,
7477
AB62172622D870540039BC73 /* Home.swift */,
7578
ABB215DD22DB713300424B38 /* UpdateList.swift */,
@@ -173,6 +176,7 @@
173176
AB62172722D870540039BC73 /* Home.swift in Sources */,
174177
ABE07CC322D74F5700D209BE /* ContentView.swift in Sources */,
175178
ABB215DC22DB353800424B38 /* BlurView.swift in Sources */,
179+
ABB215E422DC7D0000424B38 /* TabBar.swift in Sources */,
176180
);
177181
runOnlyForDeploymentPostprocessing = 0;
178182
};

DesignCode/SceneDelegate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
2121
// Use a UIHostingController as window root view controller
2222
if let windowScene = scene as? UIWindowScene {
2323
let window = UIWindow(windowScene: windowScene)
24-
window.rootViewController = UIHostingController(rootView: ContentView())
24+
window.rootViewController = UIHostingController(rootView: TabBar())
2525
self.window = window
2626
window.makeKeyAndVisible()
2727
}

DesignCode/TabBar.swift

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//
2+
// TabBar.swift
3+
// DesignCode
4+
//
5+
// Created by Mithun x on 7/15/19.
6+
// Copyright © 2019 Mithun. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
struct TabBar: View {
12+
var body: some View {
13+
TabbedView {
14+
Home().tabItem {
15+
Image("IconHome")
16+
Text("Home")
17+
}
18+
.tag(1)
19+
ContentView().tabItem {
20+
Image("IconCards")
21+
Text("Certificates")
22+
}
23+
.tag(2)
24+
UpdateList().tabItem {
25+
Image("IconSettings")
26+
Text("Updates")
27+
}
28+
.tag(3)
29+
}
30+
}
31+
}
32+
33+
#if DEBUG
34+
struct TabBar_Previews: PreviewProvider {
35+
static var previews: some View {
36+
TabBar()
37+
}
38+
}
39+
#endif

0 commit comments

Comments
 (0)