Skip to content

Commit c76c480

Browse files
authored
Merge pull request #134 from IIION/feature/loginViewReDesign
✨ 로그인 버튼의 디자인을 변경했습니다.
2 parents 663ad57 + b8c9fda commit c76c480

File tree

6 files changed

+56
-33
lines changed

6 files changed

+56
-33
lines changed

Workade.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
2170C28F292BB0BC005146C3 /* ExploreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2170C28E292BB0BC005146C3 /* ExploreViewController.swift */; };
5454
2170C291292C974B005146C3 /* ExploreViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2170C290292C974B005146C3 /* ExploreViewModel.swift */; };
5555
2170C293292CA689005146C3 /* RegionInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2170C292292CA689005146C3 /* RegionInfoView.swift */; };
56+
21723FB8293BA3800064255C /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 21723FB7293BA3800064255C /* GoogleService-Info.plist */; };
5657
21862A912902675600518EBC /* GalleryDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21862A902902675500518EBC /* GalleryDetailViewController.swift */; };
5758
21862A93290280BD00518EBC /* CardTransitionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21862A92290280BD00518EBC /* CardTransitionManager.swift */; };
5859
218DA403290B1AA90089F896 /* LaunchScreenAnimationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 218DA402290B1AA90089F896 /* LaunchScreenAnimationView.swift */; };
@@ -217,6 +218,7 @@
217218
2170C28E292BB0BC005146C3 /* ExploreViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExploreViewController.swift; sourceTree = "<group>"; };
218219
2170C290292C974B005146C3 /* ExploreViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExploreViewModel.swift; sourceTree = "<group>"; };
219220
2170C292292CA689005146C3 /* RegionInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegionInfoView.swift; sourceTree = "<group>"; };
221+
21723FB7293BA3800064255C /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../Desktop/GoogleService-Info.plist"; sourceTree = "<group>"; };
220222
21862A902902675500518EBC /* GalleryDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GalleryDetailViewController.swift; sourceTree = "<group>"; };
221223
21862A92290280BD00518EBC /* CardTransitionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardTransitionManager.swift; sourceTree = "<group>"; };
222224
218DA402290B1AA90089F896 /* LaunchScreenAnimationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchScreenAnimationView.swift; sourceTree = "<group>"; };
@@ -597,6 +599,7 @@
597599
isa = PBXGroup;
598600
children = (
599601
5FDC17D228FE7A900060DBB7 /* .swiftlint.yml */,
602+
21723FB7293BA3800064255C /* GoogleService-Info.plist */,
600603
5FDC17B928FE799C0060DBB7 /* Workade */,
601604
5FDC17B828FE799C0060DBB7 /* Products */,
602605
B7DE360250B0A3F5EC254C91 /* Pods */,
@@ -922,6 +925,7 @@
922925
5FDC17D328FE7A900060DBB7 /* .swiftlint.yml in Resources */,
923926
21F6DE5D28FFED5D00ED72C6 /* Pretendard-Regular.otf in Resources */,
924927
2103BBA929261F4D00BBCB2C /* Satoshi-Medium.otf in Resources */,
928+
21723FB8293BA3800064255C /* GoogleService-Info.plist in Resources */,
925929
21F6DE5E28FFED5D00ED72C6 /* Pretendard-Bold.otf in Resources */,
926930
5FDC17CA28FE799D0060DBB7 /* LaunchScreen.storyboard in Resources */,
927931
21F6DE5C28FFED5D00ED72C6 /* Pretendard-SemiBold.otf in Resources */,

Workade/Assets.xcassets/Login/applelogo.imageset/Contents.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"images" : [
33
{
4-
"filename" : "applelogo.pdf",
4+
"filename" : "􀣺.svg",
55
"idiom" : "universal"
66
}
77
],
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Loading

Workade/Views&ViewModels/Login/Element/LoginButtonView.swift

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,47 @@
77

88
import UIKit
99

10+
enum LoginCase: String {
11+
case apple
12+
case google
13+
14+
var name: String {
15+
switch self {
16+
case .apple:
17+
return "Apple"
18+
case .google:
19+
return "Google"
20+
}
21+
}
22+
}
23+
1024
final class LoginButtonView: UIView {
1125
var logoImage: UIImage?
12-
var guideance: String
26+
var loginCase: LoginCase
1327

1428
private let logoImageView: UIImageView = {
1529
let logoImageView = UIImageView()
1630
logoImageView.translatesAutoresizingMaskIntoConstraints = false
17-
31+
logoImageView.contentMode = .scaleAspectFit
1832
return logoImageView
1933
}()
2034

2135
private let textLabel: UILabel = {
2236
let textLabel = UILabel()
2337
textLabel.translatesAutoresizingMaskIntoConstraints = false
24-
textLabel.font = .customFont(for: .footnote2)
25-
textLabel.textColor = .black
38+
textLabel.font = .systemFont(ofSize: 15, weight: .regular)
2639

2740
return textLabel
2841
}()
2942

30-
init(logo: UIImage?, guideance: String) {
43+
init(logo: UIImage?, loginCase: LoginCase) {
3144
self.logoImage = logo
32-
self.guideance = guideance
45+
self.loginCase = loginCase
3346
super.init(frame: .zero)
3447

35-
layer.cornerRadius = 20
36-
backgroundColor = .theme.groupedBackground
48+
layer.cornerRadius = 12
49+
backgroundColor = loginCase == .apple ? .theme.primary : .theme.groupedBackground
50+
textLabel.textColor = loginCase == .apple ? .theme.background : .theme.primary
3751

3852
setData()
3953
setupLayout()
@@ -43,23 +57,24 @@ final class LoginButtonView: UIView {
4357
fatalError("init(coder:) has not been implemented")
4458
}
4559

46-
private func setupLayout() { addSubview(logoImageView)
60+
private func setupLayout() {
61+
addSubview(logoImageView)
4762
NSLayoutConstraint.activate([
4863
logoImageView.widthAnchor.constraint(equalToConstant: 24),
4964
logoImageView.heightAnchor.constraint(equalToConstant: 24),
50-
logoImageView.centerXAnchor.constraint(equalTo: self.centerXAnchor),
51-
logoImageView.topAnchor.constraint(equalTo: self.topAnchor, constant: 22.5)
65+
logoImageView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
66+
logoImageView.centerYAnchor.constraint(equalTo: centerYAnchor)
5267
])
5368

5469
addSubview(textLabel)
5570
NSLayoutConstraint.activate([
56-
textLabel.topAnchor.constraint(equalTo: logoImageView.bottomAnchor, constant: 20),
71+
textLabel.centerYAnchor.constraint(equalTo: self.centerYAnchor),
5772
textLabel.centerXAnchor.constraint(equalTo: self.centerXAnchor)
5873
])
5974
}
6075

6176
private func setData() {
6277
logoImageView.image = logoImage
63-
textLabel.text = guideance
78+
textLabel.text = loginCase.name + "로 로그인"
6479
}
6580
}

Workade/Views&ViewModels/Login/LoginSheetView.swift

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ class LoginSheetView: UIView {
1212
let logo = UIImageView()
1313
logo.translatesAutoresizingMaskIntoConstraints = false
1414
logo.image = UIImage(named: "workationlogo")
15+
logo.contentMode = .scaleAspectFit
1516

1617
return logo
1718
}()
1819

19-
private let guideLable: UILabel = {
20+
private let guideLabel: UILabel = {
2021
let guide = UILabel()
2122
guide.translatesAutoresizingMaskIntoConstraints = false
2223
guide.setLineHeight(lineHeight: 6)
@@ -48,14 +49,14 @@ class LoginSheetView: UIView {
4849
}()
4950

5051
lazy var appleLoginButton: LoginButtonView = {
51-
let loginButton = LoginButtonView(logo: UIImage(named: "applelogo"), guideance: "Apple로 게속하기")
52+
let loginButton = LoginButtonView(logo: UIImage(named: "applelogo"), loginCase: .apple)
5253
loginButton.translatesAutoresizingMaskIntoConstraints = false
5354

5455
return loginButton
5556
}()
5657

5758
lazy var googleLoginButton: LoginButtonView = {
58-
let loginButton = LoginButtonView(logo: UIImage(named: "googlelogo"), guideance: "Google로 계속하기")
59+
let loginButton = LoginButtonView(logo: UIImage(named: "googlelogo"), loginCase: .google)
5960
loginButton.translatesAutoresizingMaskIntoConstraints = false
6061

6162
return loginButton
@@ -84,10 +85,10 @@ class LoginSheetView: UIView {
8485
logoImageView.heightAnchor.constraint(equalToConstant: 20)
8586
])
8687

87-
addSubview(guideLable)
88+
addSubview(guideLabel)
8889
NSLayoutConstraint.activate([
89-
guideLable.centerXAnchor.constraint(equalTo: self.centerXAnchor),
90-
guideLable.topAnchor.constraint(equalTo: logoImageView.bottomAnchor, constant: 36.5)
90+
guideLabel.centerXAnchor.constraint(equalTo: self.centerXAnchor),
91+
guideLabel.topAnchor.constraint(equalTo: logoImageView.bottomAnchor, constant: 36.5)
9192
])
9293

9394
addSubview(closeButton)
@@ -98,24 +99,24 @@ class LoginSheetView: UIView {
9899
closeButton.bottomAnchor.constraint(equalTo: self.topAnchor, constant: 48) // 20 + 28
99100
])
100101

101-
let appleTabGesture = UITapGestureRecognizer(target: self, action: #selector(handleAppleLogin))
102-
appleLoginButton.addGestureRecognizer(appleTabGesture)
103-
addSubview(appleLoginButton)
104-
NSLayoutConstraint.activate([
105-
appleLoginButton.topAnchor.constraint(equalTo: self.topAnchor, constant: 173),
106-
appleLoginButton.trailingAnchor.constraint(equalTo: self.centerXAnchor, constant: -6),
107-
appleLoginButton.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 30),
108-
appleLoginButton.bottomAnchor.constraint(equalTo: self.topAnchor, constant: 280)
109-
])
110-
111102
let googleTabGesture = UITapGestureRecognizer(target: self, action: #selector(handleGoogleLogin))
112103
googleLoginButton.addGestureRecognizer(googleTabGesture)
113104
addSubview(googleLoginButton)
114105
NSLayoutConstraint.activate([
115-
googleLoginButton.topAnchor.constraint(equalTo: self.topAnchor, constant: 173),
116-
googleLoginButton.leadingAnchor.constraint(equalTo: self.centerXAnchor, constant: 6),
117106
googleLoginButton.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -30),
118-
googleLoginButton.bottomAnchor.constraint(equalTo: self.topAnchor, constant: 280)
107+
googleLoginButton.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 30),
108+
googleLoginButton.heightAnchor.constraint(equalToConstant: 50)
109+
])
110+
111+
let appleTabGesture = UITapGestureRecognizer(target: self, action: #selector(handleAppleLogin))
112+
appleLoginButton.addGestureRecognizer(appleTabGesture)
113+
addSubview(appleLoginButton)
114+
NSLayoutConstraint.activate([
115+
appleLoginButton.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -30),
116+
appleLoginButton.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 30),
117+
appleLoginButton.heightAnchor.constraint(equalToConstant: 50),
118+
appleLoginButton.bottomAnchor.constraint(equalTo: self.layoutMarginsGuide.bottomAnchor, constant: 0),
119+
appleLoginButton.topAnchor.constraint(equalTo: googleLoginButton.bottomAnchor, constant: 10)
119120
])
120121
}
121122

0 commit comments

Comments
 (0)