From c532fcc1157478fd9b98d761db82dede2be5ccfc Mon Sep 17 00:00:00 2001 From: Alexis Drai Date: Fri, 12 May 2023 11:42:26 +0200 Subject: [PATCH] :lipstick: Create bottom navbar --- PodcastsClone.xcodeproj/project.pbxproj | 8 +++--- PodcastsClone/ContentView.swift | 26 ----------------- PodcastsClone/MainView.swift | 37 +++++++++++++++++++++++++ PodcastsClone/PodcastsCloneApp.swift | 2 +- 4 files changed, 42 insertions(+), 31 deletions(-) delete mode 100644 PodcastsClone/ContentView.swift create mode 100644 PodcastsClone/MainView.swift diff --git a/PodcastsClone.xcodeproj/project.pbxproj b/PodcastsClone.xcodeproj/project.pbxproj index 3facd1d..1fd53ed 100644 --- a/PodcastsClone.xcodeproj/project.pbxproj +++ b/PodcastsClone.xcodeproj/project.pbxproj @@ -8,17 +8,17 @@ /* Begin PBXBuildFile section */ ECB23B932A0E33B000A1C62B /* PodcastsCloneApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB23B922A0E33B000A1C62B /* PodcastsCloneApp.swift */; }; - ECB23B952A0E33B000A1C62B /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB23B942A0E33B000A1C62B /* ContentView.swift */; }; ECB23B972A0E33B200A1C62B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ECB23B962A0E33B200A1C62B /* Assets.xcassets */; }; ECB23B9A2A0E33B200A1C62B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ECB23B992A0E33B200A1C62B /* Preview Assets.xcassets */; }; + ECB23BA12A0E3FDF00A1C62B /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB23BA02A0E3FDF00A1C62B /* MainView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ ECB23B8F2A0E33B000A1C62B /* PodcastsClone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PodcastsClone.app; sourceTree = BUILT_PRODUCTS_DIR; }; ECB23B922A0E33B000A1C62B /* PodcastsCloneApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PodcastsCloneApp.swift; sourceTree = ""; }; - ECB23B942A0E33B000A1C62B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; ECB23B962A0E33B200A1C62B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; ECB23B992A0E33B200A1C62B /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + ECB23BA02A0E3FDF00A1C62B /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -52,9 +52,9 @@ isa = PBXGroup; children = ( ECB23B922A0E33B000A1C62B /* PodcastsCloneApp.swift */, - ECB23B942A0E33B000A1C62B /* ContentView.swift */, ECB23B962A0E33B200A1C62B /* Assets.xcassets */, ECB23B982A0E33B200A1C62B /* Preview Content */, + ECB23BA02A0E3FDF00A1C62B /* MainView.swift */, ); path = PodcastsClone; sourceTree = ""; @@ -137,7 +137,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - ECB23B952A0E33B000A1C62B /* ContentView.swift in Sources */, + ECB23BA12A0E3FDF00A1C62B /* MainView.swift in Sources */, ECB23B932A0E33B000A1C62B /* PodcastsCloneApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/PodcastsClone/ContentView.swift b/PodcastsClone/ContentView.swift deleted file mode 100644 index 2f0a219..0000000 --- a/PodcastsClone/ContentView.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ContentView.swift -// PodcastsClone -// -// Created by etudiant on 2023-05-12. -// - -import SwiftUI - -struct ContentView: View { - var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundColor(.accentColor) - Text("Hello, World!") - } - .padding() - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - } -} diff --git a/PodcastsClone/MainView.swift b/PodcastsClone/MainView.swift new file mode 100644 index 0000000..f8ca36e --- /dev/null +++ b/PodcastsClone/MainView.swift @@ -0,0 +1,37 @@ +// +// MainView.swift +// PodcastsClone +// +// Created by etudiant on 2023-05-12. +// + +import SwiftUI + +struct MainView: View { + var body: some View { + TabView { + Text("Listen Now") + .tabItem { + Label("Listen Now", systemImage: "play") + } + Text("Browse") + .tabItem { + Label("Browse", systemImage: "square.grid.2x2") + } + Text("Library") + .tabItem { + Label("Library", systemImage: "book") + } + Text("Search") + .tabItem { + Label("Search", systemImage: "magnifyingglass") + } + } + } +} + +struct MainView_Previews: PreviewProvider { + static var previews: some View { + MainView() + } +} diff --git a/PodcastsClone/PodcastsCloneApp.swift b/PodcastsClone/PodcastsCloneApp.swift index aca480c..b9969da 100644 --- a/PodcastsClone/PodcastsCloneApp.swift +++ b/PodcastsClone/PodcastsCloneApp.swift @@ -11,7 +11,7 @@ import SwiftUI struct PodcastsCloneApp: App { var body: some Scene { WindowGroup { - ContentView() + MainView() } } }