diff --git a/AsyncSwift.xcodeproj/project.pbxproj b/AsyncSwift.xcodeproj/project.pbxproj index 9aba15d..2212f9d 100644 --- a/AsyncSwift.xcodeproj/project.pbxproj +++ b/AsyncSwift.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + B2E1083128C9CD6900C3DD59 /* AppData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2E1083028C9CD6900C3DD59 /* AppData.swift */; }; C68DE93628C7685800CA4CC8 /* AsyncSwiftApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C68DE93528C7685800CA4CC8 /* AsyncSwiftApp.swift */; }; C68DE93828C7685800CA4CC8 /* MainTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C68DE93728C7685800CA4CC8 /* MainTabView.swift */; }; C68DE93A28C7685900CA4CC8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C68DE93928C7685900CA4CC8 /* Assets.xcassets */; }; @@ -23,6 +24,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + B2E1083028C9CD6900C3DD59 /* AppData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppData.swift; sourceTree = ""; }; C68DE93228C7685800CA4CC8 /* AsyncSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AsyncSwift.app; sourceTree = BUILT_PRODUCTS_DIR; }; C68DE93528C7685800CA4CC8 /* AsyncSwiftApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncSwiftApp.swift; sourceTree = ""; }; C68DE93728C7685800CA4CC8 /* MainTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTabView.swift; sourceTree = ""; }; @@ -116,6 +118,7 @@ isa = PBXGroup; children = ( C6F7798A28C9CBC60036773B /* EventView+Observed.swift */, + B2E1083028C9CD6900C3DD59 /* AppData.swift */, ); path = Observed; sourceTree = ""; @@ -206,6 +209,7 @@ C68DE93828C7685800CA4CC8 /* MainTabView.swift in Sources */, C68DE93628C7685800CA4CC8 /* AsyncSwiftApp.swift in Sources */, C6F7798D28C9CBD80036773B /* EventResponse.swift in Sources */, + B2E1083128C9CD6900C3DD59 /* AppData.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -335,7 +339,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"AsyncSwift/Preview Content\""; - DEVELOPMENT_TEAM = 76AJ433CP5; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AsyncSwift/Info.plist; @@ -366,7 +370,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"AsyncSwift/Preview Content\""; - DEVELOPMENT_TEAM = 76AJ433CP5; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AsyncSwift/Info.plist; diff --git a/AsyncSwift/Assets.xcassets/Seminar002Ticket.imageset/Contents.json b/AsyncSwift/Assets.xcassets/Seminar002Ticket.imageset/Contents.json new file mode 100644 index 0000000..0aad74f --- /dev/null +++ b/AsyncSwift/Assets.xcassets/Seminar002Ticket.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "Seminar002.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/AsyncSwift/Assets.xcassets/Seminar002Ticket.imageset/Seminar002.pdf b/AsyncSwift/Assets.xcassets/Seminar002Ticket.imageset/Seminar002.pdf new file mode 100644 index 0000000..a32f66f Binary files /dev/null and b/AsyncSwift/Assets.xcassets/Seminar002Ticket.imageset/Seminar002.pdf differ diff --git a/AsyncSwift/Assets.xcassets/UpcomingConference001.imageset/Contents.json b/AsyncSwift/Assets.xcassets/UpcomingConference001.imageset/Contents.json new file mode 100644 index 0000000..0e5ec76 --- /dev/null +++ b/AsyncSwift/Assets.xcassets/UpcomingConference001.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "UpcomingConference001.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/AsyncSwift/Assets.xcassets/UpcomingConference001.imageset/UpcomingConference001.pdf b/AsyncSwift/Assets.xcassets/UpcomingConference001.imageset/UpcomingConference001.pdf new file mode 100644 index 0000000..4e48d85 Binary files /dev/null and b/AsyncSwift/Assets.xcassets/UpcomingConference001.imageset/UpcomingConference001.pdf differ diff --git a/AsyncSwift/AsyncSwiftApp.swift b/AsyncSwift/AsyncSwiftApp.swift index dc32af1..255fa6e 100644 --- a/AsyncSwift/AsyncSwiftApp.swift +++ b/AsyncSwift/AsyncSwiftApp.swift @@ -10,9 +10,12 @@ import SwiftUI @main struct AsyncSwiftApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate + @ObservedObject var appData: AppData = AppData() + var body: some Scene { WindowGroup { MainTabView() + .environmentObject(appData) } } } diff --git a/AsyncSwift/Identifiable/EventResponse.swift b/AsyncSwift/Identifiable/EventResponse.swift index e6d872c..4cc2f30 100644 --- a/AsyncSwift/Identifiable/EventResponse.swift +++ b/AsyncSwift/Identifiable/EventResponse.swift @@ -8,5 +8,6 @@ import Foundation struct EventResponse: Codable, Identifiable { + let id: Int } diff --git a/AsyncSwift/Observed/AppData.swift b/AsyncSwift/Observed/AppData.swift new file mode 100644 index 0000000..b3a3dfd --- /dev/null +++ b/AsyncSwift/Observed/AppData.swift @@ -0,0 +1,21 @@ +// +// AppData.swift +// AsyncSwift +// +// Created by Inho Choi on 2022/09/08. +// + +import UIKit + +final class AppData: ObservableObject { + @Published var currentTab: Tab = .event + +} + + +enum Tab: String { + case event + case ticketing + case stamp +} + diff --git a/AsyncSwift/Views/MainTabView.swift b/AsyncSwift/Views/MainTabView.swift index 8c6dc64..b4bc54b 100644 --- a/AsyncSwift/Views/MainTabView.swift +++ b/AsyncSwift/Views/MainTabView.swift @@ -8,23 +8,16 @@ import SwiftUI struct MainTabView: View { + @EnvironmentObject var appData: AppData var body: some View { TabView { - EventView() - .tabItem { - Label("Event", systemImage: "calendar") - } - - TicketingView() - .tabItem { - Label("Ticketing", systemImage: "banknote") - } - StampView() - .tabItem { - Label("Stamp", systemImage: "checkmark.square") + ForEach(Tab.allCases, id: \.self) { tab in + tab.view.tabItem { + Image(systemName: tab.systemImageName) + Text(tab.title) } + } } - } } struct ContentView_Previews: PreviewProvider { diff --git a/AsyncSwift/Views/TicketingView.swift b/AsyncSwift/Views/TicketingView.swift index af93383..469d8e6 100644 --- a/AsyncSwift/Views/TicketingView.swift +++ b/AsyncSwift/Views/TicketingView.swift @@ -8,13 +8,30 @@ import SwiftUI struct TicketingView: View { - var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) - } -} + var body: some View { + NavigationView { + ScrollView { + VStack(spacing: 30) { + Image("Seminar002Ticket") + .resizable() + .aspectRatio(contentMode: .fit) + .shadow(color: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 0.15), radius: 20, x: 0, y: 4) + + Image("UpcomingConference001") + .resizable() + .aspectRatio(contentMode: .fit) + } + .aspectRatio(contentMode: .fit) + .padding(30) + + } + .navigationTitle("Ticketing") + } // NavigationView + } // body +} // View struct TicketView_Previews: PreviewProvider { - static var previews: some View { - TicketingView() - } + static var previews: some View { + TicketingView() + } }