diff --git a/Workade.xcodeproj/project.pbxproj b/Workade.xcodeproj/project.pbxproj index fca25e1d..89fe260f 100644 --- a/Workade.xcodeproj/project.pbxproj +++ b/Workade.xcodeproj/project.pbxproj @@ -53,6 +53,7 @@ 2170C28F292BB0BC005146C3 /* ExploreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2170C28E292BB0BC005146C3 /* ExploreViewController.swift */; }; 2170C291292C974B005146C3 /* ExploreViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2170C290292C974B005146C3 /* ExploreViewModel.swift */; }; 2170C293292CA689005146C3 /* RegionInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2170C292292CA689005146C3 /* RegionInfoView.swift */; }; + 21723FB8293BA3800064255C /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 21723FB7293BA3800064255C /* GoogleService-Info.plist */; }; 21862A912902675600518EBC /* GalleryDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21862A902902675500518EBC /* GalleryDetailViewController.swift */; }; 21862A93290280BD00518EBC /* CardTransitionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21862A92290280BD00518EBC /* CardTransitionManager.swift */; }; 218DA403290B1AA90089F896 /* LaunchScreenAnimationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 218DA402290B1AA90089F896 /* LaunchScreenAnimationView.swift */; }; @@ -217,6 +218,7 @@ 2170C28E292BB0BC005146C3 /* ExploreViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExploreViewController.swift; sourceTree = ""; }; 2170C290292C974B005146C3 /* ExploreViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExploreViewModel.swift; sourceTree = ""; }; 2170C292292CA689005146C3 /* RegionInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegionInfoView.swift; sourceTree = ""; }; + 21723FB7293BA3800064255C /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../Desktop/GoogleService-Info.plist"; sourceTree = ""; }; 21862A902902675500518EBC /* GalleryDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GalleryDetailViewController.swift; sourceTree = ""; }; 21862A92290280BD00518EBC /* CardTransitionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardTransitionManager.swift; sourceTree = ""; }; 218DA402290B1AA90089F896 /* LaunchScreenAnimationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchScreenAnimationView.swift; sourceTree = ""; }; @@ -597,6 +599,7 @@ isa = PBXGroup; children = ( 5FDC17D228FE7A900060DBB7 /* .swiftlint.yml */, + 21723FB7293BA3800064255C /* GoogleService-Info.plist */, 5FDC17B928FE799C0060DBB7 /* Workade */, 5FDC17B828FE799C0060DBB7 /* Products */, B7DE360250B0A3F5EC254C91 /* Pods */, @@ -922,6 +925,7 @@ 5FDC17D328FE7A900060DBB7 /* .swiftlint.yml in Resources */, 21F6DE5D28FFED5D00ED72C6 /* Pretendard-Regular.otf in Resources */, 2103BBA929261F4D00BBCB2C /* Satoshi-Medium.otf in Resources */, + 21723FB8293BA3800064255C /* GoogleService-Info.plist in Resources */, 21F6DE5E28FFED5D00ED72C6 /* Pretendard-Bold.otf in Resources */, 5FDC17CA28FE799D0060DBB7 /* LaunchScreen.storyboard in Resources */, 21F6DE5C28FFED5D00ED72C6 /* Pretendard-SemiBold.otf in Resources */, diff --git a/Workade/Assets.xcassets/Login/applelogo.imageset/Contents.json b/Workade/Assets.xcassets/Login/applelogo.imageset/Contents.json index 8412987d..a4f134c9 100644 --- a/Workade/Assets.xcassets/Login/applelogo.imageset/Contents.json +++ b/Workade/Assets.xcassets/Login/applelogo.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "applelogo.pdf", + "filename" : "􀣺.svg", "idiom" : "universal" } ], diff --git a/Workade/Assets.xcassets/Login/applelogo.imageset/applelogo.pdf b/Workade/Assets.xcassets/Login/applelogo.imageset/applelogo.pdf deleted file mode 100644 index ad9641a6..00000000 Binary files a/Workade/Assets.xcassets/Login/applelogo.imageset/applelogo.pdf and /dev/null differ diff --git "a/Workade/Assets.xcassets/Login/applelogo.imageset/\364\200\243\272.svg" "b/Workade/Assets.xcassets/Login/applelogo.imageset/\364\200\243\272.svg" new file mode 100644 index 00000000..0ee150cc --- /dev/null +++ "b/Workade/Assets.xcassets/Login/applelogo.imageset/\364\200\243\272.svg" @@ -0,0 +1,3 @@ + + + diff --git a/Workade/Views&ViewModels/Login/Element/LoginButtonView.swift b/Workade/Views&ViewModels/Login/Element/LoginButtonView.swift index 5ec9898c..65c9457b 100644 --- a/Workade/Views&ViewModels/Login/Element/LoginButtonView.swift +++ b/Workade/Views&ViewModels/Login/Element/LoginButtonView.swift @@ -7,33 +7,47 @@ import UIKit +enum LoginCase: String { + case apple + case google + + var name: String { + switch self { + case .apple: + return "Apple" + case .google: + return "Google" + } + } +} + final class LoginButtonView: UIView { var logoImage: UIImage? - var guideance: String + var loginCase: LoginCase private let logoImageView: UIImageView = { let logoImageView = UIImageView() logoImageView.translatesAutoresizingMaskIntoConstraints = false - + logoImageView.contentMode = .scaleAspectFit return logoImageView }() private let textLabel: UILabel = { let textLabel = UILabel() textLabel.translatesAutoresizingMaskIntoConstraints = false - textLabel.font = .customFont(for: .footnote2) - textLabel.textColor = .black + textLabel.font = .systemFont(ofSize: 15, weight: .regular) return textLabel }() - init(logo: UIImage?, guideance: String) { + init(logo: UIImage?, loginCase: LoginCase) { self.logoImage = logo - self.guideance = guideance + self.loginCase = loginCase super.init(frame: .zero) - layer.cornerRadius = 20 - backgroundColor = .theme.groupedBackground + layer.cornerRadius = 12 + backgroundColor = loginCase == .apple ? .theme.primary : .theme.groupedBackground + textLabel.textColor = loginCase == .apple ? .theme.background : .theme.primary setData() setupLayout() @@ -43,23 +57,24 @@ final class LoginButtonView: UIView { fatalError("init(coder:) has not been implemented") } - private func setupLayout() { addSubview(logoImageView) + private func setupLayout() { + addSubview(logoImageView) NSLayoutConstraint.activate([ logoImageView.widthAnchor.constraint(equalToConstant: 24), logoImageView.heightAnchor.constraint(equalToConstant: 24), - logoImageView.centerXAnchor.constraint(equalTo: self.centerXAnchor), - logoImageView.topAnchor.constraint(equalTo: self.topAnchor, constant: 22.5) + logoImageView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16), + logoImageView.centerYAnchor.constraint(equalTo: centerYAnchor) ]) addSubview(textLabel) NSLayoutConstraint.activate([ - textLabel.topAnchor.constraint(equalTo: logoImageView.bottomAnchor, constant: 20), + textLabel.centerYAnchor.constraint(equalTo: self.centerYAnchor), textLabel.centerXAnchor.constraint(equalTo: self.centerXAnchor) ]) } private func setData() { logoImageView.image = logoImage - textLabel.text = guideance + textLabel.text = loginCase.name + "로 로그인" } } diff --git a/Workade/Views&ViewModels/Login/LoginSheetView.swift b/Workade/Views&ViewModels/Login/LoginSheetView.swift index ba5c82e2..b787958c 100644 --- a/Workade/Views&ViewModels/Login/LoginSheetView.swift +++ b/Workade/Views&ViewModels/Login/LoginSheetView.swift @@ -12,11 +12,12 @@ class LoginSheetView: UIView { let logo = UIImageView() logo.translatesAutoresizingMaskIntoConstraints = false logo.image = UIImage(named: "workationlogo") + logo.contentMode = .scaleAspectFit return logo }() - private let guideLable: UILabel = { + private let guideLabel: UILabel = { let guide = UILabel() guide.translatesAutoresizingMaskIntoConstraints = false guide.setLineHeight(lineHeight: 6) @@ -48,14 +49,14 @@ class LoginSheetView: UIView { }() lazy var appleLoginButton: LoginButtonView = { - let loginButton = LoginButtonView(logo: UIImage(named: "applelogo"), guideance: "Apple로 게속하기") + let loginButton = LoginButtonView(logo: UIImage(named: "applelogo"), loginCase: .apple) loginButton.translatesAutoresizingMaskIntoConstraints = false return loginButton }() lazy var googleLoginButton: LoginButtonView = { - let loginButton = LoginButtonView(logo: UIImage(named: "googlelogo"), guideance: "Google로 계속하기") + let loginButton = LoginButtonView(logo: UIImage(named: "googlelogo"), loginCase: .google) loginButton.translatesAutoresizingMaskIntoConstraints = false return loginButton @@ -84,10 +85,10 @@ class LoginSheetView: UIView { logoImageView.heightAnchor.constraint(equalToConstant: 20) ]) - addSubview(guideLable) + addSubview(guideLabel) NSLayoutConstraint.activate([ - guideLable.centerXAnchor.constraint(equalTo: self.centerXAnchor), - guideLable.topAnchor.constraint(equalTo: logoImageView.bottomAnchor, constant: 36.5) + guideLabel.centerXAnchor.constraint(equalTo: self.centerXAnchor), + guideLabel.topAnchor.constraint(equalTo: logoImageView.bottomAnchor, constant: 36.5) ]) addSubview(closeButton) @@ -98,24 +99,24 @@ class LoginSheetView: UIView { closeButton.bottomAnchor.constraint(equalTo: self.topAnchor, constant: 48) // 20 + 28 ]) - let appleTabGesture = UITapGestureRecognizer(target: self, action: #selector(handleAppleLogin)) - appleLoginButton.addGestureRecognizer(appleTabGesture) - addSubview(appleLoginButton) - NSLayoutConstraint.activate([ - appleLoginButton.topAnchor.constraint(equalTo: self.topAnchor, constant: 173), - appleLoginButton.trailingAnchor.constraint(equalTo: self.centerXAnchor, constant: -6), - appleLoginButton.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 30), - appleLoginButton.bottomAnchor.constraint(equalTo: self.topAnchor, constant: 280) - ]) - let googleTabGesture = UITapGestureRecognizer(target: self, action: #selector(handleGoogleLogin)) googleLoginButton.addGestureRecognizer(googleTabGesture) addSubview(googleLoginButton) NSLayoutConstraint.activate([ - googleLoginButton.topAnchor.constraint(equalTo: self.topAnchor, constant: 173), - googleLoginButton.leadingAnchor.constraint(equalTo: self.centerXAnchor, constant: 6), googleLoginButton.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -30), - googleLoginButton.bottomAnchor.constraint(equalTo: self.topAnchor, constant: 280) + googleLoginButton.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 30), + googleLoginButton.heightAnchor.constraint(equalToConstant: 50) + ]) + + let appleTabGesture = UITapGestureRecognizer(target: self, action: #selector(handleAppleLogin)) + appleLoginButton.addGestureRecognizer(appleTabGesture) + addSubview(appleLoginButton) + NSLayoutConstraint.activate([ + appleLoginButton.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -30), + appleLoginButton.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 30), + appleLoginButton.heightAnchor.constraint(equalToConstant: 50), + appleLoginButton.bottomAnchor.constraint(equalTo: self.layoutMarginsGuide.bottomAnchor, constant: 0), + appleLoginButton.topAnchor.constraint(equalTo: googleLoginButton.bottomAnchor, constant: 10) ]) }