Skip to content

Commit e64b07f

Browse files
authored
Merge pull request #248 from teamterning/Fix/#247
[Fix] #247 - 3์ฐจ ์Šคํ”„๋ฆฐํŠธ 1์ฐจ QA ๋ฐ˜์˜ ํ–ˆ์Šต๋‹ˆ๋‹ค.
2 parents c64e098 + 3264b00 commit e64b07f

15 files changed

Lines changed: 199 additions & 70 deletions

File tree

โ€ŽTerning-iOS/Terning-iOS/Resource/Amplitude/AmplitudeEventType.swiftโ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public enum AmplitudeEventType: String {
2121
case clickHomeFilteringSave = "click_home_filtering_save" // ํ™ˆ_ํ•„ํ„ฐ๋ง ์žฌ์„ค์ •_์ €์žฅํ•˜๊ธฐ
2222
case scrollHome = "scroll_home" // ํ™ˆ_๋ฆฌ์ŠคํŠธ ํ•˜๋‹จ๊นŒ์ง€ ์Šคํฌ๋กคํ•œ ํšŸ์ˆ˜
2323
case clickFilteredDeadline = "click_filtered_deadline" // ํ™ˆ_์ •๋ ฌ_์ฑ„์šฉ ๋งˆ๊ฐ ์ด๋ฅธ ์ˆœ
24-
case clickFilteredShortTerm = "click_filtered_short_term" // ํ™ˆ_์ •๋ ฌ_์งง์€ ๊ทผ๋ฌด ๊ธฐ๊ฐ„ ์ˆœ
25-
case clickFilteredLongTerm = "click_filtered_long_term" // ํ™ˆ_์ •๋ ฌ_๊ธด ๊ทผ๋ฌด ๊ธฐ๊ฐ„ ์ˆœ
24+
case clickFilteredShortTerm = "click_filtered_short_term" // ํ™ˆ_์ •๋ ฌ_๊ทผ๋ฌด ๊ธฐ๊ฐ„ ์งง์€ ์ˆœ
25+
case clickFilteredLongTerm = "click_filtered_long_term" // ํ™ˆ_์ •๋ ฌ_๊ทผ๋ฌด ๊ธฐ๊ฐ„ ๊ธด ์ˆœ
2626
case clickFilteredScraps = "click_filtered_scraps" // ํ™ˆ_์ •๋ ฌ_์Šคํฌ๋žฉ ๋งŽ์€ ์ˆœ
2727
case clickFilteredHits = "click_filtered_hits" // ํ™ˆ_์ •๋ ฌ_์กฐํšŒ์ˆ˜ ๋งŽ์€ ์ˆœ
2828
case clickHomeInternCard = "click_home_intern_card" // ํ™ˆ_๊ณต๊ณ  ์นด๋“œ ํด๋ฆญ

โ€ŽTerning-iOS/Terning-iOS/Resource/UIComponents/CustomAlertViewController.swiftโ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ final class CustomAlertViewController: UIViewController {
127127
$0.spacing = 5.adjustedH
128128
}
129129

130-
private let centerButton = CustomButton(title: "๋‚ด ์บ˜๋ฆฐ๋”์— ์Šคํฌ๋žฉ ํ•˜๊ธฐ", font: .button3)
130+
private let centerButton = CustomButton(title: "๋‚ด ์บ˜๋ฆฐ๋”์— ์Šคํฌ๋žฉํ•˜๊ธฐ", font: .button3)
131131
private let changeColorButton = CustomButton(title: "์ƒ‰์ƒ ๋ณ€๊ฒฝํ•˜๊ธฐ", font: .button3).setEnabled(false).setAlertViewColor()
132132
private let viewJobDetailButton = CustomButton(title: "๊ณต๊ณ  ์ƒ์„ธ ์ •๋ณด ๋ณด๊ธฐ", font: .button3)
133133
private let closeButton = UIButton()
@@ -249,7 +249,7 @@ final class CustomAlertViewController: UIViewController {
249249
centerButton.snp.makeConstraints {
250250
$0.top.equalTo(detailsVStackView.snp.bottom).offset(20.adjustedH)
251251
$0.horizontalEdges.equalToSuperview().inset(16)
252-
$0.height.equalTo(40)
252+
$0.height.equalTo(40.adjustedH)
253253
}
254254
}
255255

@@ -292,7 +292,7 @@ final class CustomAlertViewController: UIViewController {
292292
centerButton.snp.makeConstraints {
293293
$0.bottom.equalToSuperview().inset(16.adjustedH)
294294
$0.horizontalEdges.equalToSuperview().inset(16)
295-
$0.height.equalTo(40)
295+
$0.height.equalTo(40.adjustedH)
296296
}
297297
}
298298

โ€ŽTerning-iOS/Terning-iOS/Resource/UIComponents/CustomButton.swiftโ€Ž

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ extension CustomButton {
7373
return self
7474
}
7575

76+
@discardableResult
77+
public func setCornerRadius(_ radius: CGFloat) -> Self {
78+
self.layer.cornerRadius = radius
79+
self.clipsToBounds = true
80+
return self
81+
}
82+
7683
/// ๋ฒ„ํŠผ์˜ backgroundColor, textColor ๋ณ€๊ฒฝ
7784
@discardableResult
7885
public func setColor(bgColor: UIColor, disableColor: UIColor, textColor: UIColor = .white) -> Self {
@@ -143,7 +150,7 @@ extension CustomButton {
143150
button.configuration = updatedConfiguration
144151
button.layer.borderColor = UIColor.grey150.cgColor
145152
button.layer.borderWidth = 1
146-
button.layer.cornerRadius = 5
153+
button.layer.cornerRadius = 8
147154
button.clipsToBounds = true
148155
}
149156
self.configurationUpdateHandler = buttonStateHandler

โ€ŽTerning-iOS/Terning-iOS/Source/Data/Network/Service/Login/LoginService.swiftโ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class LoginService: NSObject, LoginServiceProtocol {
2828
return Observable<Bool>.create { observer in
2929
if UserApi.isKakaoTalkLoginAvailable() {
3030
UserApi.shared.loginWithKakaoTalk { (oauthToken, error) in
31-
print("โญ๏ธ kakao = \(oauthToken)")
31+
print("โญ๏ธ kakao = \(String(describing: oauthToken))")
3232

3333
if let error = error {
3434
print("โญ๏ธ kakao Error isKakaoTalkLoginAvailable = \(error.localizedDescription)")
@@ -61,7 +61,7 @@ final class LoginService: NSObject, LoginServiceProtocol {
6161
}
6262
} else {
6363
UserApi.shared.loginWithKakaoAccount { (oauthToken, error) in
64-
print("โญ๏ธ kakao = \(oauthToken)")
64+
print("โญ๏ธ kakao = \(String(describing: oauthToken))")
6565

6666
if let error = error {
6767
print("โ—๏ธ kakao Error loginWithKakaoAccount = \(error.localizedDescription)")

โ€ŽTerning-iOS/Terning-iOS/Source/Data/Network/User/UserManager.swiftโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ final class UserManager {
2626
@UserDefaultWrapper<Int>(key: "userId") public var userId
2727
@UserDefaultWrapper<String>(key: "authId") public var authId
2828
@UserDefaultWrapper<String>(key: "authType") public var authType
29+
@UserDefaultWrapper<String>(key: "userName") public var userName
2930

3031
var hasAccessToken: Bool { return self.accessToken != nil }
3132
var hasKakaoToken: Bool { return self.kakaoAccessToken != nil }

โ€ŽTerning-iOS/Terning-iOS/Source/Domain/Model/Announcements/JobDetailModel.swiftโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct JobDetailModel: Codable {
1212
let dDay: String
1313
let title: String
1414
let workingPeriod: String
15-
let isScrapped: Bool
15+
var isScrapped: Bool
1616
let color: String?
1717
let deadline: String
1818
let startYearMonth: String

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,14 @@ extension TNCalendarViewController {
280280

281281
switch gesture.state {
282282
case .ended:
283-
// ์„ธ๋กœ ๋ฐฉํ–ฅ์˜ ์†๋„๊ฐ€ ํŠน์ • ๊ฐ’์„ ๋„˜๋Š”์ง€ ํ™•์ธ
284-
283+
// ์Šค์™€์ดํ”„ ์†๋„๊ฐ€ 500์„ ๋„˜๊ณ , ์ฃผ๊ฐ„ ๋ชจ๋“œ์ด๋ฉด ์›”๊ฐ„ ๋ชจ๋“œ๋กœ ๋ณ€๊ฒฝ
285284
if velocity.y > 500 && rootView.calendarView.scope == .week {
286285
rootView.calendarView.setScope(.month, animated: true)
286+
287+
// #247: ์„ ํƒ๋œ ๋‚ ์งœ๋ฅผ ํ’€๊ณ , ์บ˜๋ฆฐ๋” reloadData ํ•˜์—ฌ ์•„๋ž˜ ์Šค์™€์ดํ”„์‹œ ์ดˆ๋ก์ƒ‰ ํ„ฐ์น˜ ์˜์—ญ ์—†์• ์ฃผ๊ธฐ
288+
selectedDate = nil
289+
self.rootView.calendarView.reloadData()
287290
}
288-
// } else if velocity.y > 500 {
289-
// if rootView.calendarView.scope == .week {
290-
// rootView.calendarView.setScope(.month, animated: true)
291-
// }
292-
// }
293-
// Comment: ์บ˜๋ฆฐ๋”์—์„œ ์œ„๋กœ ์Šค์™€์ดํ”„ํ•˜๋Š” ๋กœ์ง์ด ํ•„์š”ํ•˜๋‹ค๋ฉด ์ถ”๊ฐ€ ์ž‘์„ฑ ํ•˜๊ธฐ
294291
default:
295292
break
296293
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ final class JobDetailView: UIView {
5656
}
5757

5858
private var goSiteButton = CustomButton(title: "์ง€์› ์‚ฌ์ดํŠธ๋กœ ์ด๋™ํ•˜๊ธฐ")
59+
.setCornerRadius(10)
5960

6061
// MARK: - Init
6162

โ€ŽTerning-iOS/Terning-iOS/Source/Presentation/JobDetail/ViewController/JobDetailViewController.swiftโ€Ž

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ final class JobDetailViewController: UIViewController {
3535
private let addScrapSubject = PublishSubject<(Int, String)>()
3636
private let cancelScrapSubject = PublishSubject<Int>()
3737

38+
// ๊ณต๊ณ  ID์™€ ์ƒˆ๋กœ์šด scrap ์ƒํƒœ๋ฅผ ๊ณต๊ณ  ์™ธ๋ถ€์— ์ „๋‹ฌํ•˜๋Š” ํด๋กœ์ €
39+
var didToggleScrap: ((Int, Bool) -> Void)?
40+
3841
// MARK: - UI Components
3942

4043
private let rootView = JobDetailView()
@@ -113,7 +116,8 @@ extension JobDetailViewController {
113116
extension JobDetailViewController {
114117
@objc
115118
private func scrapButtonDidTapped(_ sender: UIButton) {
116-
guard let model = self.jobDetail else { return }
119+
// var๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ณต๊ณ  ๋ฐ์ดํ„ฐ๋ฅผ ์กฐ์ž‘
120+
guard var model = self.jobDetail else { return }
117121

118122
if self.rootView.scrapButton.isSelected {
119123
let alertSheet = CustomAlertViewController(alertViewType: .info)
@@ -125,6 +129,12 @@ extension JobDetailViewController {
125129
guard let self = self else { return }
126130
track(eventName: .clickDetailCancelScrap)
127131
self.cancelScrapAnnouncement(scrapId: self.internshipAnnouncementId.value)
132+
133+
model.isScrapped.toggle()
134+
rootView.setScrapped(model.isScrapped)
135+
136+
didToggleScrap?(self.internshipAnnouncementId.value, model.isScrapped)
137+
128138
self.dismiss(animated: false)
129139
}
130140

@@ -141,6 +151,11 @@ extension JobDetailViewController {
141151
track(eventName: .clickDetailScrap)
142152
let selectedColorNameRelay = alertSheet.selectedColorNameRelay.value
143153
self.addScrapAnnouncement(scrapId: self.internshipAnnouncementId.value, color: selectedColorNameRelay)
154+
155+
model.isScrapped.toggle()
156+
rootView.setScrapped(model.isScrapped)
157+
158+
didToggleScrap?(self.internshipAnnouncementId.value, model.isScrapped)
144159
self.dismiss(animated: false)
145160
}
146161

โ€ŽTerning-iOS/Terning-iOS/Source/Presentation/MyPage/ViewModel/MyPageViewModel.swiftโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ extension MyPageViewModel {
152152
authType: data.authType
153153
)
154154
self.userInfoRelay.accept(updatedUserInfo)
155+
UserManager.shared.userName = data.name
155156

156157
var updatedSections = self.sectionsRelay.value
157158
updatedSections[0] = SectionData(

0 commit comments

Comments
ย (0)