Skip to content

Commit

Permalink
feat: Add navbar (closes #42)
Browse files Browse the repository at this point in the history
  • Loading branch information
smessie committed Nov 7, 2022
1 parent 79efd84 commit fb1ad60
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
55 changes: 55 additions & 0 deletions Hydra iOS/AppTabNavigation.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// AppTabNavigation.swift
// Hydra
//
// Created by Ieben Smessaert on 07/11/2022.
// Copyright © 2022 Zeus WPI. All rights reserved.
//

import SwiftUI

struct AppTabNavigation: View {

enum Tab {
case feed
case resto
}

@State private var selection: Tab = .feed

var body: some View {
TabView(selection: $selection) {
NavigationView {
Overview()
}
.tabItem {
let menuText = Text("Feed", comment: "Feed menu tab title")
Label {
menuText
} icon: {
Image(systemName: "doc.richtext")
}.accessibility(label: menuText)
}
.tag(Tab.feed)

NavigationView {
RestoView()
}
.tabItem {
let menuText = Text("Resto", comment: "Resto menu tab title")
Label {
menuText
} icon: {
Image(systemName: "fork.knife")
}.accessibility(label: menuText)
}
.tag(Tab.resto)
}
}
}

struct AppTabNavigation_Previews: PreviewProvider {
static var previews: some View {
AppTabNavigation()
}
}
21 changes: 21 additions & 0 deletions Hydra iOS/Views/RestoView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// RestoView.swift
// Hydra
//
// Created by Ieben Smessaert on 08/11/2022.
// Copyright © 2022 Zeus WPI. All rights reserved.
//

import SwiftUI

struct RestoView: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
}

struct RestoView_Previews: PreviewProvider {
static var previews: some View {
RestoView()
}
}
8 changes: 8 additions & 0 deletions Hydra.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/* Begin PBXBuildFile section */
F876BA7A2919B705005FA746 /* RefreshableScrollView in Frameworks */ = {isa = PBXBuildFile; productRef = F876BA792919B705005FA746 /* RefreshableScrollView */; };
5EFD9C942919C19C00DDD079 /* AppTabNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EFD9C932919C19C00DDD079 /* AppTabNavigation.swift */; };
5EFD9C962919C83300DDD079 /* RestoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EFD9C952919C83300DDD079 /* RestoView.swift */; };
F8875A5C2908867500EE5B98 /* UgentNewsItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8875A5B2908867500EE5B98 /* UgentNewsItem.swift */; };
F8875A5E2908940500EE5B98 /* EntriesResponseData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8875A5D2908940500EE5B98 /* EntriesResponseData.swift */; };
F8883AE928EF809D00B71E59 /* Hydra_iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8883AE828EF809D00B71E59 /* Hydra_iOSApp.swift */; };
Expand Down Expand Up @@ -46,6 +48,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
5EFD9C932919C19C00DDD079 /* AppTabNavigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTabNavigation.swift; sourceTree = "<group>"; };
5EFD9C952919C83300DDD079 /* RestoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestoView.swift; sourceTree = "<group>"; };
F876BA702919860F005FA746 /* Hydra.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Hydra.entitlements; sourceTree = "<group>"; };
F8875A5B2908867500EE5B98 /* UgentNewsItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UgentNewsItem.swift; sourceTree = "<group>"; };
F8875A5D2908940500EE5B98 /* EntriesResponseData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntriesResponseData.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -140,6 +144,7 @@
F8883AF128EF80AA00B71E59 /* Persistence.swift */,
F8CA83532909B4B500C8C6C1 /* Hydra_iOS.xcdatamodeld */,
F8883AEE28EF80AA00B71E59 /* Preview Content */,
5EFD9C932919C19C00DDD079 /* AppTabNavigation.swift */,
);
path = "Hydra iOS";
sourceTree = "<group>";
Expand Down Expand Up @@ -183,6 +188,7 @@
F8AE2CDA29020FA400D88AA2 /* Overview.swift */,
F8A3BC47290B22AA00210F8E /* NewsEntry.swift */,
F8A3BC4B290B2A4000210F8E /* URLImageView.swift */,
5EFD9C952919C83300DDD079 /* RestoView.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -347,7 +353,9 @@
F8A3BC4C290B2A4000210F8E /* URLImageView.swift in Sources */,
F8875A5C2908867500EE5B98 /* UgentNewsItem.swift in Sources */,
F8CA83552909B4B500C8C6C1 /* Hydra_iOS.xcdatamodeld in Sources */,
5EFD9C962919C83300DDD079 /* RestoView.swift in Sources */,
F893240E290747C50023C663 /* NewsItemStorage.swift in Sources */,
5EFD9C942919C19C00DDD079 /* AppTabNavigation.swift in Sources */,
F8A3BC4A290B27EA00210F8E /* ImageLoader.swift in Sources */,
F8A3BC48290B22AA00210F8E /* NewsEntry.swift in Sources */,
F8875A5E2908940500EE5B98 /* EntriesResponseData.swift in Sources */,
Expand Down

0 comments on commit fb1ad60

Please sign in to comment.