Skip to content

Commit 47006e2

Browse files
authored
Merge pull request #260 from teamterning/Feat/#259-CustomButton
[Feat] #259 - CustomButton ์ƒˆ๋กœ ๊ตฌํ˜„ ํ–ˆ์Šต๋‹ˆ๋‹ค.
2 parents 983360c + f606347 commit 47006e2

File tree

13 files changed

+201
-272
lines changed

13 files changed

+201
-272
lines changed

โ€ŽTerning-iOS/Terning-iOS.xcodeproj/project.pbxprojโ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
710660372D53B0B70065167A /* TextViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 710660362D53B0B70065167A /* TextViewFactory.swift */; };
9393
710660392D53B2510065167A /* UITextView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 710660382D53B2510065167A /* UITextView+.swift */; };
9494
7119B8112CA72FBD00E94E62 /* UIColor+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7119B8102CA72FBD00E94E62 /* UIColor+.swift */; };
95-
7121A1332C396FB40056DB8B /* CustomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7121A1322C396FB40056DB8B /* CustomButton.swift */; };
9695
7121A1352C39CCF60056DB8B /* UIButton+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7121A1342C39CCF60056DB8B /* UIButton+.swift */; };
9796
7121A13A2C3A6CEB0056DB8B /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = 7121A1392C3A6CEB0056DB8B /* RxCocoa */; };
9897
7121A13C2C3A6CEB0056DB8B /* RxRelay in Frameworks */ = {isa = PBXBuildFile; productRef = 7121A13B2C3A6CEB0056DB8B /* RxRelay */; };
@@ -124,6 +123,7 @@
124123
71665AAC2C7C4A94008EB0D7 /* EventView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71665AAB2C7C4A94008EB0D7 /* EventView.swift */; };
125124
71665AAE2C7C4BAA008EB0D7 /* CalendarDateCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71665AAD2C7C4BAA008EB0D7 /* CalendarDateCellView.swift */; };
126125
71665AB12C7C5444008EB0D7 /* TNCalendarRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71665AB02C7C5444008EB0D7 /* TNCalendarRepository.swift */; };
126+
717054FD2D696D7D00B3F2CD /* TerningCustomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 717054FC2D696D7D00B3F2CD /* TerningCustomButton.swift */; };
127127
71780C322C45705C0073B731 /* Encodable+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71780C312C45705C0073B731 /* Encodable+.swift */; };
128128
71780C352C45725E0073B731 /* Providers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71780C342C45725E0073B731 /* Providers.swift */; };
129129
71780C3A2C4577FF0073B731 /* CalendarTargetType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71780C392C4577FF0073B731 /* CalendarTargetType.swift */; };
@@ -281,7 +281,6 @@
281281
710660362D53B0B70065167A /* TextViewFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextViewFactory.swift; sourceTree = "<group>"; };
282282
710660382D53B2510065167A /* UITextView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextView+.swift"; sourceTree = "<group>"; };
283283
7119B8102CA72FBD00E94E62 /* UIColor+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+.swift"; sourceTree = "<group>"; };
284-
7121A1322C396FB40056DB8B /* CustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomButton.swift; sourceTree = "<group>"; };
285284
7121A1342C39CCF60056DB8B /* UIButton+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+.swift"; sourceTree = "<group>"; };
286285
7121A13D2C3A98E10056DB8B /* LabelFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelFactory.swift; sourceTree = "<group>"; };
287286
7121A13F2C3AB9EE0056DB8B /* JobDetailInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JobDetailInfoView.swift; sourceTree = "<group>"; };
@@ -310,6 +309,7 @@
310309
71665AAB2C7C4A94008EB0D7 /* EventView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventView.swift; sourceTree = "<group>"; };
311310
71665AAD2C7C4BAA008EB0D7 /* CalendarDateCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarDateCellView.swift; sourceTree = "<group>"; };
312311
71665AB02C7C5444008EB0D7 /* TNCalendarRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TNCalendarRepository.swift; sourceTree = "<group>"; };
312+
717054FC2D696D7D00B3F2CD /* TerningCustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerningCustomButton.swift; sourceTree = "<group>"; };
313313
71780C312C45705C0073B731 /* Encodable+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Encodable+.swift"; sourceTree = "<group>"; };
314314
71780C342C45725E0073B731 /* Providers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Providers.swift; sourceTree = "<group>"; };
315315
71780C392C4577FF0073B731 /* CalendarTargetType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarTargetType.swift; sourceTree = "<group>"; };
@@ -961,7 +961,6 @@
961961
isa = PBXGroup;
962962
children = (
963963
7121A1412C3AE99D0056DB8B /* Cell */,
964-
7121A1322C396FB40056DB8B /* CustomButton.swift */,
965964
2DAC9E7A2D112AC500A7842E /* CustomCheckButton.swift */,
966965
2D89C7662C486E53002B035F /* CustomSortButton.swift */,
967966
2D4EE3862C3D7CB200E3E95B /* CustomOnboardingButton.swift */,
@@ -974,6 +973,7 @@
974973
7121A13F2C3AB9EE0056DB8B /* JobDetailInfoView.swift */,
975974
719C6DED2C91F150006AF9C9 /* CustomAlertViewController.swift */,
976975
71F004C62C957C8C00CD202B /* EmptyView.swift */,
976+
717054FC2D696D7D00B3F2CD /* TerningCustomButton.swift */,
977977
);
978978
path = UIComponents;
979979
sourceTree = "<group>";
@@ -1617,6 +1617,7 @@
16171617
files = (
16181618
2DC61F012C40825D009F991F /* DetailInfoTableViewCell.swift in Sources */,
16191619
2DC986062C45704600D46729 /* CustomSearchBar.swift in Sources */,
1620+
717054FD2D696D7D00B3F2CD /* TerningCustomButton.swift in Sources */,
16201621
715C0FD72C99077700EDDD60 /* MockCalendarService.swift in Sources */,
16211622
2DF257272C8F692B00B85843 /* ProfileViewModelType.swift in Sources */,
16221623
2DF257292C8F6A7D00B85843 /* ProfileImageUtils.swift in Sources */,
@@ -1735,7 +1736,6 @@
17351736
71B509252C41D027006D8E56 /* CalendarDateHeaderView.swift in Sources */,
17361737
2DC61F192C41B261009F991F /* LoginView.swift in Sources */,
17371738
2DD483802C4B37A0000541E3 /* AccountOptionViewController.swift in Sources */,
1738-
7121A1332C396FB40056DB8B /* CustomButton.swift in Sources */,
17391739
715C0FF12C9F256700EDDD60 /* JobDetailRepositoryInterface.swift in Sources */,
17401740
2D8CCF152D11122F0030E8E5 /* JobCategoryCell.swift in Sources */,
17411741
2D89C7652C486E2E002B035F /* SearchResultView.swift in Sources */,

โ€ŽTerning-iOS/Terning-iOS/Presentation/AccountOption/View/AccountOptionView.swiftโ€Ž

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,17 @@ final class AccountOptionView: UIView {
3333
$0.numberOfLines = 4
3434
}
3535

36-
lazy var yesButton = CustomButton(
36+
lazy var yesButton = TerningCustomButton(
3737
title: "๋กœ๊ทธ์•„์›ƒํ•˜๊ธฐ",
3838
font: .button2,
39-
cornerRadius: 10.adjustedH
39+
radius: 10.adjustedH
4040
)
4141

42-
lazy var noButton = CustomButton(
42+
lazy var noButton = TerningCustomButton(
4343
title: "์ทจ์†Œ",
4444
font: .button2,
45-
cornerRadius: 10.adjustedH
46-
).then {
47-
$0.setColor(bgColor: .grey150, disableColor: .grey150, textColor: .grey400)
48-
}
45+
radius: 10.adjustedH
46+
)
4947

5048
// MARK: - Init
5149

@@ -73,6 +71,8 @@ extension AccountOptionView {
7371
yesButton,
7472
noButton
7573
)
74+
75+
noButton.setAppearance(normalBackgroundColor: .grey100, pressedBackgroundColor: .grey200, textNormal: .grey400)
7676
}
7777

7878
private func setLayout() {
@@ -111,10 +111,10 @@ extension AccountOptionView {
111111
func bind(for viewType: AccountOption) {
112112
if viewType == .logout {
113113
subTitleLabel.text = "์ •๋ง ๋กœ๊ทธ์•„์›ƒ ํ•˜์‹œ๊ฒ ์–ด์š”?"
114-
yesButton.setTitle(title: "๋กœ๊ทธ์•„์›ƒํ•˜๊ธฐ")
114+
yesButton.updateTitle("๋กœ๊ทธ์•„์›ƒํ•˜๊ธฐ")
115115
} else {
116116
subTitleLabel.text = "ํƒˆํ‡ด ์‹œ ๊ณ„์ • ๋ฐ ์ด์šฉ ๊ธฐ๋ก์€ ๋ชจ๋‘ ์‚ญ์ œ๋˜๋ฉฐ,\n์‚ญ์ œ๋œ ๋ฐ์ดํ„ฐ๋Š” ๋ณต๊ตฌ๊ฐ€ ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.\n\nํƒˆํ‡ด๋ฅผ ์ง„ํ–‰ํ• ๊นŒ์š”?"
117-
yesButton.setTitle(title: "ํƒˆํ‡ดํ•˜๊ธฐ")
117+
yesButton.updateTitle("ํƒˆํ‡ดํ•˜๊ธฐ")
118118
}
119119
}
120120
}

โ€ŽTerning-iOS/Terning-iOS/Presentation/Calendar/ViewController/TNCalendarViewController.swiftโ€Ž

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ extension TNCalendarViewController {
165165
})
166166
.disposed(by: disposeBag)
167167

168-
169168
output.dailyData
170169
.drive(onNext: { [weak self] _ in
171170
guard let self = self else { return }
@@ -175,7 +174,6 @@ extension TNCalendarViewController {
175174
})
176175
.disposed(by: disposeBag)
177176

178-
179177
output.patchScrapResult
180178
.drive(onNext: { [weak self] in
181179
guard let self = self else { return }
@@ -192,7 +190,6 @@ extension TNCalendarViewController {
192190
})
193191
.disposed(by: disposeBag)
194192

195-
196193
output.error
197194
.drive(onNext: { [weak self] errorMessage in
198195
guard let self = self else { return }

โ€ŽTerning-iOS/Terning-iOS/Presentation/FilteringSetting/FilteringView/ViewController/FilteringViewController.swiftโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ final class FilteringViewController: UIViewController {
8282
return [jobVC, planVC]
8383
}()
8484

85-
private let saveButton = CustomButton(title: "์ €์žฅํ•˜๊ธฐ")
85+
private let saveButton = TerningCustomButton(title: "์ €์žฅํ•˜๊ธฐ")
8686

8787
// MARK: - Init
8888

โ€ŽTerning-iOS/Terning-iOS/Presentation/Home/View/HomeView.swiftโ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ extension HomeView {
128128
self.userName = userName
129129

130130
// ์ƒˆ๋กœ์šด ๋ ˆ์ด์•„์›ƒ ์ƒ์„ฑ ๋ฐ ์ ์šฉ
131+
let topOffset = userName.count > 6 ? 198.adjustedH : 176.adjustedH
132+
133+
gradientLayerView.snp.updateConstraints {
134+
$0.top.equalToSuperview().offset(topOffset)
135+
}
131136

132137
DispatchQueue.main.async { [weak self] in
133138
let newLayout = CompositionalLayout.createHomeCollectionViewLayout(hasScrapped: hasScrapped, soonData: soonData, userName: userName)

โ€ŽTerning-iOS/Terning-iOS/Presentation/JobDetail/View/JobDetailView.swiftโ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class JobDetailView: UIView {
3030
tableView.showsVerticalScrollIndicator = false
3131
return tableView
3232
}()
33-
33+
3434
private let bottomView = UIView().then {
3535
$0.backgroundColor = .white
3636
$0.layer.shadowColor = UIColor.black.cgColor
@@ -55,8 +55,7 @@ final class JobDetailView: UIView {
5555
$0.setImage(.icScrapFill, for: [.selected, .highlighted])
5656
}
5757

58-
private var goSiteButton = CustomButton(title: "์ง€์› ์‚ฌ์ดํŠธ๋กœ ์ด๋™ํ•˜๊ธฐ")
59-
.setCornerRadius(10)
58+
private var goSiteButton = TerningCustomButton(title: "์ง€์› ์‚ฌ์ดํŠธ๋กœ ์ด๋™ํ•˜๊ธฐ", font: .button2, radius: 10)
6059

6160
// MARK: - Init
6261

โ€ŽTerning-iOS/Terning-iOS/Presentation/Onboarding/View/OnboardingView.swiftโ€Ž

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ final class OnboardingView: UIView {
8686

8787
let customDatePicker = CustomDatePicker()
8888

89-
lazy var nextButton = CustomButton(title: "๋‹ค์Œ์œผ๋กœ")
89+
lazy var nextButton = TerningCustomButton(title: "๋‹ค์Œ์œผ๋กœ")
9090

9191
// MARK: - Init
9292

@@ -107,11 +107,6 @@ final class OnboardingView: UIView {
107107

108108
extension OnboardingView {
109109
private func setUI(viewType: OnboardingViewType) {
110-
nextButton.setColor(
111-
bgColor: .terningMain,
112-
disableColor: .grey200
113-
)
114-
115110
addSubviews(
116111
navigationBar,
117112
progressView,
@@ -152,7 +147,7 @@ extension OnboardingView {
152147

153148
nextButton.snp.makeConstraints {
154149
$0.height.equalTo(54.adjustedH)
155-
$0.horizontalEdges.equalToSuperview().inset(-5.adjusted)
150+
$0.horizontalEdges.equalToSuperview()
156151
$0.bottom.equalToSuperview().inset(12.adjustedH)
157152
}
158153

@@ -310,27 +305,27 @@ extension OnboardingView {
310305
sender.selectButton()
311306

312307
let stringValue: String?
313-
switch viewType {
314-
case .grade:
315-
switch sender.index {
316-
case 0: stringValue = "freshman"
317-
case 1: stringValue = "sophomore"
318-
case 2: stringValue = "junior"
319-
case 3: stringValue = "senior"
320-
default: stringValue = nil
321-
}
322-
323-
case .workingPeriod:
324-
switch sender.index {
325-
case 0: stringValue = "short"
326-
case 1: stringValue = "middle"
327-
case 2: stringValue = "long"
328-
default: stringValue = nil
329-
}
330-
331-
case .graduationDate:
332-
stringValue = nil
308+
switch viewType {
309+
case .grade:
310+
switch sender.index {
311+
case 0: stringValue = "freshman"
312+
case 1: stringValue = "sophomore"
313+
case 2: stringValue = "junior"
314+
case 3: stringValue = "senior"
315+
default: stringValue = nil
333316
}
317+
318+
case .workingPeriod:
319+
switch sender.index {
320+
case 0: stringValue = "short"
321+
case 1: stringValue = "middle"
322+
case 2: stringValue = "long"
323+
default: stringValue = nil
324+
}
325+
326+
case .graduationDate:
327+
stringValue = nil
328+
}
334329

335330
updateOnboardingData(for: viewType, with: stringValue)
336331
optionSelectedSubject.onNext(sender.index)

โ€ŽTerning-iOS/Terning-iOS/Presentation/Profile/View/ProfileView.swiftโ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ final class ProfileView: UIView {
115115
characterSpacing: 0.002
116116
)
117117

118-
let saveButton = CustomButton(title: "์ €์žฅํ•˜๊ธฐ")
118+
let saveButton = TerningCustomButton(title: "์ €์žฅํ•˜๊ธฐ")
119119

120120
// MARK: - Init
121121

@@ -201,7 +201,7 @@ extension ProfileView {
201201
}
202202
saveButton.snp.makeConstraints {
203203
$0.height.equalTo(54.adjustedH)
204-
$0.horizontalEdges.equalToSuperview().inset(-5.adjusted)
204+
$0.horizontalEdges.equalToSuperview()
205205
$0.bottom.equalToSuperview().inset(44.adjustedH)
206206
}
207207

โ€ŽTerning-iOS/Terning-iOS/Presentation/Welcome/View/WelcomeView.swiftโ€Ž

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ final class WelcomeView: UIView {
2929
$0.loopMode = .loop
3030
$0.animationSpeed = 1
3131
}
32-
33-
private let startButton = CustomButton(title: "์‹œ์ž‘ํ•˜๊ธฐ", font: .button0).then {
32+
33+
private let startButton = TerningCustomButton(title: "์‹œ์ž‘ํ•˜๊ธฐ", radius: 10).then {
3434
$0.alpha = 0.0
3535
}
3636

3737
private let skipButton = UIButton().then {
3838
$0.backgroundColor = .clear
3939
$0.tintColor = .grey500
40-
40+
4141
let title = "๊ณ„ํš ๋‚˜์ค‘์— ์ž…๋ ฅํ•˜๊ธฐ"
4242
let attributedTitle = NSAttributedString(
4343
string: title,
@@ -51,7 +51,7 @@ final class WelcomeView: UIView {
5151
}.then {
5252
$0.alpha = 0.0
5353
}
54-
54+
5555
// MARK: - Init
5656

5757
init(viewType: WelcomeViewType) {
@@ -66,9 +66,9 @@ final class WelcomeView: UIView {
6666
fatalError("init(coder:) has not been implemented")
6767
}
6868
}
69-
70-
// MARK: - UI & Layout
71-
69+
70+
// MARK: - UI & Layout
71+
7272
extension WelcomeView {
7373
private func setUI(viewType: WelcomeViewType) {
7474
switch viewType {
@@ -77,7 +77,7 @@ extension WelcomeView {
7777
let animation = LottieAnimation.named("beforeOnboarding")
7878
logoAnimationView.animation = animation
7979
logoAnimationView.play()
80-
startButton.setTitle(title: "์‹œ์ž‘ํ•˜๊ธฐ")
80+
startButton.updateTitle("์‹œ์ž‘ํ•˜๊ธฐ")
8181
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
8282
UIView.animate(withDuration: 0.5) {
8383
self.skipButton.alpha = 1.0
@@ -88,7 +88,7 @@ extension WelcomeView {
8888
let animation = LottieAnimation.named("afterOnboarding")
8989
logoAnimationView.animation = animation
9090
logoAnimationView.play()
91-
startButton.setTitle(title: "๋‚ด ๋งž์ถค ๊ณต๊ณ  ๋ฐ”๋กœ ๋ณด๋Ÿฌ๊ฐ€๊ธฐ")
91+
startButton.updateTitle("๋‚ด ๋งž์ถค ๊ณต๊ณ  ๋ฐ”๋กœ ๋ณด๋Ÿฌ๊ฐ€๊ธฐ")
9292
}
9393

9494
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {

Terning-iOS/Terning-iOS/Resource/Assets.xcassets/Colors/terning_main2.colorset/Contents.json renamed to Terning-iOS/Terning-iOS/Resource/Assets.xcassets/Colors/terning_sub1.colorset/Contents.json

File renamed without changes.

0 commit comments

Comments
ย (0)