Skip to content

Commit

Permalink
Merge pull request #10 from APPSCHOOL3-iOS/TabBarView
Browse files Browse the repository at this point in the history
TabBarView(#1)
  • Loading branch information
Haesus authored Aug 22, 2023
2 parents ab2b9c7 + bdf93d1 commit 05f97de
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
F485B7512A94574200A2F5FF /* FirebaseFirestoreCombine-Community in Frameworks */ = {isa = PBXBuildFile; productRef = F485B7502A94574200A2F5FF /* FirebaseFirestoreCombine-Community */; };
F485B7532A94574200A2F5FF /* FirebaseFirestoreSwift in Frameworks */ = {isa = PBXBuildFile; productRef = F485B7522A94574200A2F5FF /* FirebaseFirestoreSwift */; };
F485B7552A94584400A2F5FF /* AuthViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F485B7542A94584400A2F5FF /* AuthViewModel.swift */; };
FAA6FC222A949FF2005E31DC /* Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAA6FC212A949FF2005E31DC /* Extension.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -27,6 +28,7 @@
9E99CCF42A944A5A00699B6A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
F485B7492A94570F00A2F5FF /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
F485B7542A94584400A2F5FF /* AuthViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthViewModel.swift; sourceTree = "<group>"; };
FAA6FC212A949FF2005E31DC /* Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extension.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -63,9 +65,9 @@
9E99CCEC2A944A5700699B6A /* project02-teamB-OUR-consumer */ = {
isa = PBXGroup;
children = (
FA2585D82A947E3200CFA8CE /* GoogleService-Info.plist */,
9E99CCED2A944A5700699B6A /* project02_teamB_OUR_consumerApp.swift */,
9E99CCEF2A944A5700699B6A /* ContentView.swift */,
FAA6FC212A949FF2005E31DC /* Extension.swift */,
F485B7562A94584800A2F5FF /* ViewModel */,
9E99CCF12A944A5A00699B6A /* Assets.xcassets */,
F485B7492A94570F00A2F5FF /* GoogleService-Info.plist */,
Expand Down Expand Up @@ -173,6 +175,7 @@
9E99CCF02A944A5700699B6A /* ContentView.swift in Sources */,
9E99CCEE2A944A5700699B6A /* project02_teamB_OUR_consumerApp.swift in Sources */,
F485B7552A94584400A2F5FF /* AuthViewModel.swift in Sources */,
FAA6FC222A949FF2005E31DC /* Extension.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,6 @@

import SwiftUI

extension Color {
init(hex: String) {
var hexSanitized = hex.trimmingCharacters(in: .whitespacesAndNewlines)
hexSanitized = hexSanitized.replacingOccurrences(of: "#", with: "")

var rgb: UInt64 = 0

Scanner(string: hexSanitized).scanHexInt64(&rgb)

self.init(
red: Double((rgb & 0xFF0000) >> 16) / 255.0,
green: Double((rgb & 0x00FF00) >> 8) / 255.0,
blue: Double(rgb & 0x0000FF) / 255.0
)
}
}

struct ContentView: View {

enum TabItem {
Expand Down Expand Up @@ -70,7 +53,6 @@ struct ContentView: View {
}
}
.tint(Color(hex: hexColor)) // 메인컬러로 변경

.navigationBarItems(leading: leadingBarItem)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// Extension.swift
// project02-teamB-OUR-consumer
//
// Created by 윤해수 on 2023/08/22.
//

import SwiftUI

//Color extension확장하여 Hex Color 받아서 바꾸기
extension Color {
init(hex: String) {
var hexSanitized = hex.trimmingCharacters(in: .whitespacesAndNewlines)
hexSanitized = hexSanitized.replacingOccurrences(of: "#", with: "")

var rgb: UInt64 = 0

Scanner(string: hexSanitized).scanHexInt64(&rgb)

self.init(
red: Double((rgb & 0xFF0000) >> 16) / 255.0,
green: Double((rgb & 0x00FF00) >> 8) / 255.0,
blue: Double(rgb & 0x0000FF) / 255.0
)
}
}

0 comments on commit 05f97de

Please sign in to comment.