Skip to content

Commit 9384699

Browse files
committed
[refactor] #167 피드백 반영
1 parent cc61760 commit 9384699

File tree

16 files changed

+134
-101
lines changed

16 files changed

+134
-101
lines changed

Projects/App/ShareExtension/Sources/ShareRootFeature.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ struct ShareRootFeature {
106106
func handleAsyncAction(_ action: Action.AsyncAction, state: inout State) -> Effect<Action> {
107107
switch action {
108108
case .URL_파싱_수행:
109-
guard let item = state.context?.inputItems.first as? NSExtensionItem,
110-
let itemProvider = item.attachments?.first else {
111-
return .none
112-
}
109+
guard
110+
let item = state.context?.inputItems.first as? NSExtensionItem,
111+
let itemProvider = item.attachments?.first
112+
else { return .none }
113113

114114
return .run { send in
115115
var urlItem: (any NSSecureCoding)? = nil

Projects/App/Sources/AppDelegate/AppDelegateFeature.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public struct AppDelegateFeature {
6060
let setting = await self.userNotifications.getNotificationSettings()
6161
switch setting.authorizationStatus {
6262
case .authorized, .notDetermined:
63-
guard try await self.userNotifications.requestAuthorization([.alert, .sound])
63+
guard
64+
try await self.userNotifications.requestAuthorization([.alert, .sound])
6465
else { return }
6566
default: return
6667
}

Projects/App/Sources/MainTab/MainTabFeature.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ private extension MainTabFeature {
184184
}
185185
)
186186
case .onOpenURL(url: let url):
187-
guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false) else {
188-
return .none
189-
}
187+
guard
188+
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
189+
else { return .none }
190190

191191
let queryItems = components.queryItems ?? []
192-
guard let categoryIdString = queryItems.first(where: { $0.name == "categoryId" })?.value,
193-
let categoryId = Int(categoryIdString) else {
194-
return .none
195-
}
192+
guard
193+
let categoryIdString = queryItems.first(where: { $0.name == "categoryId" })?.value,
194+
let categoryId = Int(categoryIdString)
195+
else { return .none }
196196

197197
return .send(.async(.공유받은_카테고리_조회(categoryId: categoryId)))
198198
case .경고_확인버튼_클릭:

Projects/App/Sources/MainTab/MainTabPath.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ public extension MainTabFeature {
141141
case .contentDetail(.presented(.delegate(.즐겨찾기_갱신_완료))),
142142
.contentDetail(.presented(.delegate(.컨텐츠_조회_완료))),
143143
.contentDetail(.presented(.delegate(.컨텐츠_삭제_완료))):
144-
guard let stackElementId = state.path.ids.last,
145-
let lastPath = state.path.last else {
144+
guard
145+
let stackElementId = state.path.ids.last,
146+
let lastPath = state.path.last
147+
else {
146148
switch state.selectedTab {
147149
case .pokit:
148150
return .send(.pokit(.delegate(.미분류_카테고리_컨텐츠_조회)))

Projects/CoreKit/Sources/CoreNetwork/TokenInterceptor.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,20 @@ public final class TokenInterceptor: RequestInterceptor {
4444
dueTo error: Error,
4545
completion: @escaping (RetryResult) -> Void
4646
) {
47-
guard let response = request.task?.response as? HTTPURLResponse,
48-
response.statusCode == 401 else {
47+
guard
48+
let response = request.task?.response as? HTTPURLResponse,
49+
response.statusCode == 401
50+
else {
4951
completion(.doNotRetryWithError(error))
5052
return
5153
}
5254

5355
print("🚀 Retry: statusCode: \(response.statusCode)")
5456

55-
guard keychain.read(.accessToken) != nil,
56-
let refreshToken = keychain.read(.refreshToken) else {
57+
guard
58+
keychain.read(.accessToken) != nil,
59+
let refreshToken = keychain.read(.refreshToken)
60+
else {
5761
deleteAllToken()
5862
completion(.doNotRetryWithError(error))
5963
return

Projects/CoreKit/Sources/Data/Client/KakaoSDK/Share/KakaoShareClient+LiveKey.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ extension KakaoShareClient: DependencyKey {
4545
buttons: [button]
4646
)
4747

48-
guard ShareApi.isKakaoTalkSharingAvailable(),
49-
let templateJsonData = try? SdkJSONEncoder.custom.encode(template),
50-
let templateJsonObject = SdkUtils.toJsonObject(templateJsonData) else {
48+
guard
49+
ShareApi.isKakaoTalkSharingAvailable(),
50+
let templateJsonData = try? SdkJSONEncoder.custom.encode(template),
51+
let templateJsonObject = SdkUtils.toJsonObject(templateJsonData)
52+
else {
5153
/// 🚨 Error Case [1]: 카카오톡 미설치
52-
guard let url = URL(string: "itms-apps://itunes.apple.com/app/id362057947"),
53-
UIApplication.shared.canOpenURL(url) else {
54-
return
55-
}
54+
guard
55+
let url = URL(string: "itms-apps://itunes.apple.com/app/id362057947"),
56+
UIApplication.shared.canOpenURL(url)
57+
else { return }
5658

5759
UIApplication.shared.open(url, options: [:], completionHandler: nil)
5860
return

Projects/CoreKit/Sources/Data/Client/SocialLogin/Controller/AppleLoginController.swift

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,28 @@ public final class AppleLoginController: NSObject, ASAuthorizationControllerDele
3333
controller: ASAuthorizationController,
3434
didCompleteWithAuthorization authorization: ASAuthorization
3535
) {
36-
guard let credential = authorization.credential as? ASAuthorizationAppleIDCredential else {
36+
guard
37+
let credential = authorization.credential as? ASAuthorizationAppleIDCredential
38+
else {
3739
continuation?.resume(throwing: SocialLoginError.invalidCredential)
3840
continuation = nil
3941
return
4042
}
4143

4244

43-
guard let tokenData = credential.identityToken,
44-
let token = String(data: tokenData, encoding: .utf8) else {
45+
guard
46+
let tokenData = credential.identityToken,
47+
let token = String(data: tokenData, encoding: .utf8)
48+
else {
4549
continuation?.resume(throwing: SocialLoginError.appleLoginError(.invalidIdentityToken))
4650
continuation = nil
4751
return
4852
}
4953

50-
guard let authorizationCode = credential.authorizationCode,
51-
let codeString = String(data: authorizationCode, encoding: .utf8) else {
54+
guard
55+
let authorizationCode = credential.authorizationCode,
56+
let codeString = String(data: authorizationCode, encoding: .utf8)
57+
else {
5258
continuation?.resume(throwing: SocialLoginError.appleLoginError(.invalidAuthorizationCode))
5359
continuation = nil
5460
return

Projects/DSKit/Sources/Components/PokitCalendar.swift

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ public struct PokitCalendar: View {
208208
let year = calendar.component(.year, from: date)
209209
let month = calendar.component(.month, from: date)
210210

211-
guard let range = calendar.range(
212-
of: .day,
213-
in: .month,
214-
for: date
215-
) else {
216-
return dates
217-
}
211+
guard
212+
let range = calendar.range(
213+
of: .day,
214+
in: .month,
215+
for: date
216+
)
217+
else { return dates }
218218

219219
dates = range.map { day in
220220
var components = DateComponents()
@@ -255,13 +255,13 @@ public struct PokitCalendar: View {
255255
return dates
256256
}
257257

258-
guard let monthRange = calendar.range(
259-
of: .day,
260-
in: .month,
261-
for: monthDate
262-
) else {
263-
return dates
264-
}
258+
guard
259+
let monthRange = calendar.range(
260+
of: .day,
261+
in: .month,
262+
for: monthDate
263+
)
264+
else { return dates }
265265

266266
let monthDays = Array(monthRange).suffix(firstWeekday - 1)
267267

@@ -369,25 +369,24 @@ public struct PokitCalendar: View {
369369
}
370370

371371
private func beforeButtonTapped() {
372-
guard let date = calendar.date(
373-
byAdding: .month,
374-
value: -1,
375-
to: currentDate
376-
) else {
377-
return
378-
}
372+
guard
373+
let date = calendar.date(
374+
byAdding: .month,
375+
value: -1,
376+
to: currentDate
377+
) else { return }
379378

380379
self.page = formatter.string(from: date)
381380
}
382381

383382
private func nextButtonTapped() {
384-
guard let date = calendar.date(
385-
byAdding: .month,
386-
value: 1,
387-
to: currentDate
388-
) else {
389-
return
390-
}
383+
guard
384+
let date = calendar.date(
385+
byAdding: .month,
386+
value: 1,
387+
to: currentDate
388+
)
389+
else { return }
391390

392391
self.page = formatter.string(from: date)
393392
}

Projects/DSKit/Sources/Components/PokitSelect.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public struct PokitSelect<Item: PokitSelectItem>: View {
5050
}
5151
.onChange(of: selectedItem) { onChangedSeletedItem($0) }
5252
.sheet(isPresented: $showSheet) {
53-
listSheet
54-
.presentationDragIndicator(.visible)
55-
.pokitPresentationCornerRadius()
56-
.presentationDetents([.height(564)])
57-
.pokitPresentationBackground()
53+
listSheet
54+
.presentationDragIndicator(.visible)
55+
.pokitPresentationCornerRadius()
56+
.presentationDetents([.height(564)])
57+
.pokitPresentationBackground()
5858
}
5959
}
6060

Projects/Feature/FeatureCategoryDetail/Sources/CategoryDetailFeature.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,11 @@ private extension CategoryDetailFeature {
225225

226226
case let .카테고리_목록_조회_API_반영(response):
227227
state.domain.categoryListInQuiry = response
228-
guard let first = response.data?.first(where: { item in
229-
item.id == state.domain.category.id
230-
}) else { return .none }
228+
guard
229+
let first = response.data?.first(where: { item in
230+
item.id == state.domain.category.id
231+
})
232+
else { return .none }
231233
state.domain.category = first
232234
return .none
233235

0 commit comments

Comments
 (0)