Skip to content

Commit 436c173

Browse files
authored
Merge pull request #169 from YAPP-Github/develop
release 1.0.6
2 parents b04f89b + 3261557 commit 436c173

File tree

97 files changed

+1975
-1421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1975
-1421
lines changed

Projects/App/Resources/Pokit-info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundlePackageType</key>
2222
<string>APPL</string>
2323
<key>CFBundleShortVersionString</key>
24-
<string>1.0.5</string>
24+
<string>1.0.6</string>
2525
<key>CFBundleURLTypes</key>
2626
<array>
2727
<dict>

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: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import FeaturePokit
1111
import FeatureRemind
1212
import FeatureContentDetail
1313
import Domain
14+
import DSKit
1415
import Util
1516
import CoreKit
1617

@@ -28,7 +29,7 @@ public struct MainTabFeature {
2829
public struct State: Equatable {
2930
var selectedTab: MainTab = .pokit
3031
var isBottomSheetPresented: Bool = false
31-
var isLinkSheetPresented: Bool = false
32+
var linkPopup: PokitLinkPopup.PopupType?
3233
var isErrorSheetPresented: Bool = false
3334
var link: String?
3435

@@ -40,6 +41,7 @@ public struct MainTabFeature {
4041
@Presents var contentDetail: ContentDetailFeature.State?
4142
@Shared(.inMemory("SelectCategory")) var categoryId: Int?
4243
@Shared(.inMemory("PushTapped")) var isPushTapped: Bool = false
44+
var categoryOfSavedContent: BaseCategoryItem?
4345

4446
public init() {
4547
self.pokit = .init()
@@ -64,7 +66,7 @@ public struct MainTabFeature {
6466
public enum View: Equatable {
6567
case addButtonTapped
6668
case addSheetTypeSelected(TabAddSheetType)
67-
case linkCopyButtonTapped
69+
case 링크팝업_버튼_눌렀을때
6870
case onAppear
6971
case onOpenURL(url: URL)
7072
case 경고_확인버튼_클릭
@@ -75,6 +77,8 @@ public struct MainTabFeature {
7577
case 공유포킷_이동(sharedCategory: CategorySharing.SharedCategory)
7678
case 경고_띄움(BaseError)
7779
case errorSheetPresented(Bool)
80+
case 링크팝업_활성화(PokitLinkPopup.PopupType)
81+
case 카테고리상세_이동(category: BaseCategoryItem)
7882
}
7983
public enum AsyncAction: Equatable {
8084
case 공유받은_카테고리_조회(categoryId: Int)
@@ -93,6 +97,10 @@ public struct MainTabFeature {
9397
/// - Reducer Core
9498
private func core(into state: inout State, action: Action) -> Effect<Action> {
9599
switch action {
100+
case .binding(\.linkPopup):
101+
guard state.linkPopup == nil else { return .none }
102+
state.categoryOfSavedContent = nil
103+
return .none
96104
case .binding:
97105
return .none
98106
case let .pushAlertTapped(isTapped):
@@ -156,9 +164,8 @@ private extension MainTabFeature {
156164
case .포킷추가: return .send(.delegate(.포킷추가하기))
157165
}
158166

159-
case .linkCopyButtonTapped:
160-
state.isLinkSheetPresented = false
161-
return .run { send in await send(.delegate(.링크추가하기)) }
167+
case .링크팝업_버튼_눌렀을때:
168+
return linkPopupButtonTapped(state: &state)
162169

163170
case .onAppear:
164171
if state.isPushTapped {
@@ -177,15 +184,15 @@ private extension MainTabFeature {
177184
}
178185
)
179186
case .onOpenURL(url: let url):
180-
guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false) else {
181-
return .none
182-
}
187+
guard
188+
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
189+
else { return .none }
183190

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

190197
return .send(.async(.공유받은_카테고리_조회(categoryId: categoryId)))
191198
case .경고_확인버튼_클릭:
@@ -198,7 +205,10 @@ private extension MainTabFeature {
198205
switch action {
199206
case let .linkCopySuccess(url):
200207
guard let url else { return .none }
201-
state.isLinkSheetPresented = true
208+
state.linkPopup = .link(
209+
title: Constants.복사한_링크_저장하기_문구,
210+
url: url.absoluteString
211+
)
202212
state.link = url.absoluteString
203213
return .none
204214

@@ -209,7 +219,18 @@ private extension MainTabFeature {
209219
case let .errorSheetPresented(isPresented):
210220
state.isErrorSheetPresented = isPresented
211221
return .none
212-
222+
223+
case let .링크팝업_활성화(type):
224+
state.linkPopup = type
225+
return .none
226+
case let .카테고리상세_이동(category):
227+
if category.categoryName == "미분류" {
228+
state.selectedTab = .pokit
229+
state.path.removeAll()
230+
return .send(.pokit(.delegate(.미분류_카테고리_활성화)))
231+
}
232+
state.path.append(.카테고리상세(.init(category: category)))
233+
return .none
213234
default: return .none
214235
}
215236
}
@@ -238,4 +259,19 @@ private extension MainTabFeature {
238259
func handleDelegateAction(_ action: Action.DelegateAction, state: inout State) -> Effect<Action> {
239260
return .none
240261
}
262+
263+
func linkPopupButtonTapped(state: inout State) -> Effect<Action> {
264+
switch state.linkPopup {
265+
case .link:
266+
state.linkPopup = nil
267+
return .send(.delegate(.링크추가하기))
268+
case .success:
269+
state.linkPopup = nil
270+
guard let category = state.categoryOfSavedContent else { return .none }
271+
state.categoryOfSavedContent = nil
272+
return .send(.inner(.카테고리상세_이동(category: category)))
273+
case .error, .text, .warning, .none:
274+
return .none
275+
}
276+
}
241277
}

Projects/App/Sources/MainTab/MainTabFeatureView.swift

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,10 @@ public extension MainTabView {
7373
}
7474
}
7575

76-
if self.store.isLinkSheetPresented {
76+
if self.store.linkPopup != nil {
7777
PokitLinkPopup(
78-
"복사한 링크 저장하기",
79-
isPresented: $store.isLinkSheetPresented,
80-
type: .link(url: self.store.link ?? ""),
81-
action: { send(.linkCopyButtonTapped) }
78+
type: $store.linkPopup,
79+
action: { send(.링크팝업_버튼_눌렀을때, animation: .pokitSpring) }
8280
)
8381
}
8482
}
@@ -94,12 +92,10 @@ private extension MainTabView {
9492
tabView
9593
.overlay(alignment: .bottom) {
9694
VStack(spacing: 0) {
97-
if store.isLinkSheetPresented {
95+
if store.linkPopup != nil {
9896
PokitLinkPopup(
99-
"복사한 링크 저장하기",
100-
isPresented: $store.isLinkSheetPresented,
101-
type: .link(url: store.link ?? ""),
102-
action: { send(.linkCopyButtonTapped) }
97+
type: $store.linkPopup,
98+
action: { send(.링크팝업_버튼_눌렀을때, animation: .pokitSpring) }
10399
)
104100
.padding(.bottom, 20)
105101
}
@@ -265,7 +261,8 @@ private extension MainTabView {
265261
}
266262
.padding(.horizontal, 28)
267263
.onTapGesture {
268-
UIImpactFeedbackGenerator(style: .rigid).impactOccurred()
264+
UIImpactFeedbackGenerator(style: .light)
265+
.impactOccurred()
269266
store.send(.binding(.set(\.selectedTab, tab)))
270267
}
271268
}

Projects/App/Sources/MainTab/MainTabPath.swift

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import FeatureContentSetting
1616
import FeatureContentList
1717
import FeatureCategorySharing
1818
import Domain
19+
import Util
1920

2021
@Reducer
2122
public struct MainTabPath {
@@ -140,8 +141,10 @@ public extension MainTabFeature {
140141
case .contentDetail(.presented(.delegate(.즐겨찾기_갱신_완료))),
141142
.contentDetail(.presented(.delegate(.컨텐츠_조회_완료))),
142143
.contentDetail(.presented(.delegate(.컨텐츠_삭제_완료))):
143-
guard let stackElementId = state.path.ids.last,
144-
let lastPath = state.path.last else {
144+
guard
145+
let stackElementId = state.path.ids.last,
146+
let lastPath = state.path.last
147+
else {
145148
switch state.selectedTab {
146149
case .pokit:
147150
return .send(.pokit(.delegate(.미분류_카테고리_컨텐츠_조회)))
@@ -173,13 +176,17 @@ public extension MainTabFeature {
173176
return .none
174177

175178
/// - 링크추가 및 수정에서 저장하기 눌렀을 때
176-
case let .path(.element(stackElementId, action: .링크추가및수정(.delegate(.저장하기_완료)))):
179+
case let .path(.element(stackElementId, action: .링크추가및수정(.delegate(.저장하기_완료(contentId))))):
180+
state.categoryOfSavedContent = contentId
177181
state.path.removeLast()
178182
switch state.path.last {
179183
case .검색:
180-
return .send(.path(.element(id: stackElementId, action: .검색(.delegate(.컨텐츠_검색)))))
184+
return .merge(
185+
.send(.path(.element(id: stackElementId, action: .검색(.delegate(.컨텐츠_검색))))),
186+
.send(.inner(.링크팝업_활성화(.success(title: Constants.링크_저장_완료_문구))), animation: .pokitSpring)
187+
)
181188
default:
182-
return .none
189+
return .send(.inner(.링크팝업_활성화(.success(title: Constants.링크_저장_완료_문구))), animation: .pokitSpring)
183190
}
184191
/// - 각 화면에서 링크 복사 감지했을 때 (링크 추가 및 수정 화면 제외)
185192
case let .path(.element(_, action: .알림함(.delegate(.linkCopyDetected(url))))),
@@ -216,7 +223,7 @@ public extension MainTabFeature {
216223
),
217224
title: content.title,
218225
data: content.data,
219-
memo: content.memo,
226+
memo: content.memo ?? "",
220227
createdAt: content.createdAt,
221228
favorites: nil,
222229
alertYn: .no

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/CoreKit/Sources/Data/DTO/Base/ContentBaseResponse.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ public struct ContentBaseResponse: Decodable {
1313
public let data: String
1414
public let domain: String
1515
public let title: String
16+
public let memo: String?
1617
public let thumbNail: String
1718
public let createdAt: String
1819
public let isRead: Bool?
20+
public let isFavorite: Bool?
1921
}
2022

2123
extension ContentBaseResponse {
@@ -29,9 +31,11 @@ extension ContentBaseResponse {
2931
data: "https://www.youtube.com/watch?v=wtSwdGJzQCQ",
3032
domain: "youtube",
3133
title: "신서유기",
34+
memo: nil,
3235
thumbNail: "https://i.ytimg.com/vi/NnOC4_kH0ok/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLDN6u6mTjbaVmRZ4biJS_aDq4uvAQ",
3336
createdAt: "2024.08.08",
34-
isRead: false
37+
isRead: false,
38+
isFavorite: true
3539
)
3640
}
3741
}

0 commit comments

Comments
 (0)