Onboarding 페이지 추가

This commit is contained in:
Yu Sung 2023-08-09 17:12:08 +09:00
parent 84d3dd61ca
commit c9c1b5f3c3
31 changed files with 352 additions and 1 deletions

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_guide_0.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_guide_1.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_guide_2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_guide_3.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_guide_4.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_guide_5.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_guide_6.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -2,6 +2,19 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIAppFonts</key>
<array>
<string>gmarket_sans_bold.otf</string>
<string>gmarket_sans_medium.otf</string>
<string>gmarket_sans_light.otf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>

View File

@ -2,6 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIAppFonts</key>
<array>
<string>gmarket_sans_bold.otf</string>

View File

@ -14,6 +14,8 @@ struct ContentView: View {
ZStack {
Color.black.ignoresSafeArea()
MainView()
switch appState.appStep {
case .splash:
SplashView()

View File

@ -17,7 +17,6 @@ enum UserDefaultsKey: String, CaseIterable {
case nickname
case pushToken
case profileImage
case voipPushToken
case devicePushToken
case isContentPlayLoop
case isFollowedCreatorLive

View File

@ -0,0 +1,14 @@
//
// Font.swift
// SodaLive
//
// Created by klaus on 2023/08/09.
//
enum Font: String {
case bold = "GmarketSansBold"
case medium = "GmarketSansMedium"
case light = "GmarketSansLight"
}

View File

@ -0,0 +1,20 @@
//
// HomeView.swift
// SodaLive
//
// Created by klaus on 2023/08/09.
//
import SwiftUI
struct HomeView: View {
var body: some View {
Text("Home View")
}
}
struct HomeView_Previews: PreviewProvider {
static var previews: some View {
HomeView()
}
}

View File

@ -0,0 +1,32 @@
//
// MainView.swift
// SodaLive
//
// Created by klaus on 2023/08/09.
//
import SwiftUI
struct MainView: View {
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
@AppStorage("isViewedOnboardingView") private var isViewedOnboardingView: Bool = UserDefaults.bool(forKey: .isViewedOnboardingView)
var body: some View {
if isViewedOnboardingView {
if token.count > 0 {
HomeView()
} else {
LoginView()
}
} else {
OnboardingView()
}
}
}
struct MainView_Previews: PreviewProvider {
static var previews: some View {
MainView()
}
}

View File

@ -0,0 +1,85 @@
//
// OnboardingView.swift
// SodaLive
//
// Created by klaus on 2023/08/09.
//
import SwiftUI
struct OnboardingView: View {
@State private var selection = 0
var body: some View {
GeometryReader { proxy in
ZStack {
VStack(spacing: 0) {
TabView(selection: $selection) {
Image("img_guide_0")
.resizable()
.scaledToFit()
.tag(0)
Image("img_guide_1")
.resizable()
.scaledToFit()
.tag(1)
Image("img_guide_2")
.resizable()
.scaledToFit()
.tag(2)
Image("img_guide_3")
.resizable()
.scaledToFit()
.tag(3)
Image("img_guide_4")
.resizable()
.scaledToFit()
.tag(4)
Image("img_guide_5")
.resizable()
.scaledToFit()
.tag(5)
Image("img_guide_6")
.resizable()
.scaledToFit()
.tag(6)
}
.tabViewStyle(PageTabViewStyle())
.onAppear {
UIPageControl.appearance().pageIndicatorTintColor = UIColor(hex: "555555", alpha: 0.24)
UIPageControl.appearance().currentPageIndicatorTintColor = UIColor(hex: "1313BC")
}
Text("시작하기")
.font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(Color(hex: "1313BC"))
.frame(width: screenSize().width, height: 60)
.background(Color(hex: "80D8FF"))
.onTapGesture {
UserDefaults.set(true, forKey: .isViewedOnboardingView)
}
if proxy.safeAreaInsets.bottom > 0 {
Rectangle()
.foregroundColor(Color(hex: "80D8FF"))
.frame(width: proxy.size.width, height: 15.3)
}
}
}
}
.ignoresSafeArea()
}
}
struct OnboardingView_Previews: PreviewProvider {
static var previews: some View {
OnboardingView()
}
}

View File

@ -0,0 +1,20 @@
//
// LoginView.swift
// SodaLive
//
// Created by klaus on 2023/08/09.
//
import SwiftUI
struct LoginView: View {
var body: some View {
Text("Login View")
}
}
struct LoginView_Previews: PreviewProvider {
static var previews: some View {
LoginView()
}
}