Skip to content

Commit 33c70b7

Browse files
authored
Merge pull request #194 from YAPP-Github/fix/#193-qa
fix: 2.0.0 QA[1]
2 parents 7f904f1 + 76eac74 commit 33c70b7

31 files changed

+490
-264
lines changed

Projects/App/Sources/MainTab/MainTabFeatureView.swift

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -272,50 +272,53 @@ private extension MainTabView {
272272
var action: (TabAddSheetType) -> Void
273273

274274
var body: some View {
275-
HStack(spacing: 20) {
276-
Spacer()
277-
278-
ForEach(TabAddSheetType.allCases, id: \.self) { type in
279-
Button(action: { action(type) }) {
280-
VStack(spacing: 4) {
281-
Spacer()
282-
283-
type.icon
284-
.renderingMode(.template)
285-
.resizable()
286-
.aspectRatio(contentMode: .fit)
287-
.frame(width: 28, height: 28)
288-
.foregroundStyle(.pokit(.icon(.inverseWh)))
289-
290-
Text(type.title)
291-
.pokitFont(.b3(.m))
292-
.foregroundStyle(.pokit(.text(.inverseWh)))
293-
294-
Spacer()
295-
}
296-
.padding(.horizontal, 24)
297-
.background {
298-
RoundedRectangle(cornerRadius: 12, style: .continuous)
299-
.foregroundStyle(.pokit(.bg(.brand)))
275+
GeometryReader { proxy in
276+
let bottomSafeArea = proxy.safeAreaInsets.bottom
277+
HStack(spacing: 20) {
278+
Spacer()
279+
280+
ForEach(TabAddSheetType.allCases, id: \.self) { type in
281+
Button(action: { action(type) }) {
282+
VStack(spacing: 4) {
283+
Spacer()
284+
285+
type.icon
286+
.renderingMode(.template)
287+
.resizable()
288+
.aspectRatio(contentMode: .fit)
289+
.frame(width: 28, height: 28)
290+
.foregroundStyle(.pokit(.icon(.inverseWh)))
291+
292+
Text(type.title)
293+
.pokitFont(.b3(.m))
294+
.foregroundStyle(.pokit(.text(.inverseWh)))
295+
296+
Spacer()
297+
}
298+
.padding(.horizontal, 24)
299+
.background {
300+
RoundedRectangle(cornerRadius: 12, style: .continuous)
301+
.foregroundStyle(.pokit(.bg(.brand)))
302+
}
303+
.frame(height: 96)
300304
}
301-
.frame(height: 96)
302305
}
306+
307+
Spacer()
303308
}
304-
305-
Spacer()
306-
}
307-
.padding(.top, 36)
308-
.padding(.bottom, 48)
309-
.pokitPresentationCornerRadius()
310-
.pokitPresentationBackground()
311-
.presentationDragIndicator(.visible)
312-
.readHeight()
313-
.onPreferenceChange(HeightPreferenceKey.self) { height in
314-
if let height {
315-
self.height = height
309+
.padding(.bottom, 48 - bottomSafeArea)
310+
.padding(.top, 36)
311+
.pokitPresentationCornerRadius()
312+
.pokitPresentationBackground()
313+
.presentationDragIndicator(.visible)
314+
.readHeight()
315+
.onPreferenceChange(HeightPreferenceKey.self) { height in
316+
if let height {
317+
self.height = height
318+
}
316319
}
320+
.presentationDetents([.height(self.height)])
317321
}
318-
.presentationDetents([.height(self.height)])
319322
}
320323
}
321324
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//
2+
// KeyboardClient+LiveKey.swift
3+
// CoreKit
4+
//
5+
// Created by 김민호 on 3/31/25.
6+
//
7+
8+
import UIKit
9+
import Combine
10+
import Dependencies
11+
12+
extension KeyboardClient: DependencyKey {
13+
public static let liveValue: Self = {
14+
.init(
15+
isVisible: {
16+
AsyncStream { continuation in
17+
let notificationCenter = NotificationCenter.default
18+
19+
let showObserver = notificationCenter
20+
.publisher(for: UIResponder.keyboardWillShowNotification)
21+
.map { _ in true }
22+
23+
let hideObserver = notificationCenter
24+
.publisher(for: UIResponder.keyboardWillHideNotification)
25+
.map { _ in false }
26+
27+
let cancellable = Publishers.Merge(showObserver, hideObserver)
28+
.removeDuplicates()
29+
.sink { isVisible in
30+
continuation.yield(isVisible)
31+
}
32+
33+
continuation.onTermination = { _ in cancellable.cancel() }
34+
}
35+
}
36+
)
37+
}()
38+
}
39+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// KeyboardClient+TestKey.swift
3+
// CoreKit
4+
//
5+
// Created by 김민호 on 3/31/25.
6+
//
7+
8+
import Foundation
9+
10+
import Dependencies
11+
12+
extension KeyboardClient: TestDependencyKey {
13+
public static let previewValue = Self.noop
14+
}
15+
16+
extension KeyboardClient {
17+
public static let noop = Self(
18+
isVisible: { .finished }
19+
)
20+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// KeyboardClient.swift
3+
// CoreKit
4+
//
5+
// Created by 김민호 on 3/31/25.
6+
//
7+
8+
import Foundation
9+
10+
import DependenciesMacros
11+
12+
@DependencyClient
13+
public struct KeyboardClient: Sendable {
14+
public var isVisible: @Sendable () async -> AsyncStream<Bool> = { .finished }
15+
}

Projects/DSKit/Sources/Components/PokitAlert.swift

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,54 +31,58 @@ public struct PokitAlert: View {
3131
}
3232

3333
public var body: some View {
34-
VStack(spacing: 0) {
35-
VStack(spacing: 8) {
36-
title
34+
GeometryReader { proxy in
35+
let bottomSafeArea = proxy.safeAreaInsets.bottom
36+
VStack(spacing: 0) {
37+
VStack(spacing: 8) {
38+
title
39+
40+
if message != nil {
41+
messageLabel
42+
}
43+
}
44+
.padding(.top, 36)
45+
.padding(.bottom, 20)
3746

38-
if message != nil {
39-
messageLabel
47+
PokitBottomSwitchRadio {
48+
PokitPartSwitchRadio(
49+
labelText: "취소",
50+
selection: .constant(false),
51+
to: true,
52+
style: .stroke
53+
) {
54+
cancelAction?()
55+
dismiss()
56+
}
57+
.background()
58+
59+
PokitPartSwitchRadio(
60+
labelText: confirmText,
61+
selection: .constant(true),
62+
to: true,
63+
style: .filled,
64+
action: action
65+
)
66+
.background()
4067
}
68+
.pokitMaxWidth()
4169
}
42-
.padding(.top, 36)
43-
.padding(.bottom, 20)
44-
45-
PokitBottomSwitchRadio {
46-
PokitPartSwitchRadio(
47-
labelText: "취소",
48-
selection: .constant(false),
49-
to: true,
50-
style: .stroke
51-
) {
52-
cancelAction?()
53-
dismiss()
70+
.pokitPresentationBackground()
71+
.pokitPresentationCornerRadius()
72+
.presentationDragIndicator(.visible)
73+
.padding(.bottom, 36 - bottomSafeArea)
74+
.readHeight()
75+
.onPreferenceChange(HeightPreferenceKey.self) { height in
76+
if let height {
77+
self.height = height
5478
}
55-
.background()
56-
57-
PokitPartSwitchRadio(
58-
labelText: confirmText,
59-
selection: .constant(true),
60-
to: true,
61-
style: .filled,
62-
action: action
63-
)
64-
.background()
6579
}
66-
.pokitMaxWidth()
67-
}
68-
.pokitPresentationBackground()
69-
.pokitPresentationCornerRadius()
70-
.presentationDragIndicator(.visible)
71-
.readHeight()
72-
.onPreferenceChange(HeightPreferenceKey.self) { height in
73-
if let height {
74-
self.height = height
80+
.presentationDetents([.height(self.height)])
81+
.onAppear {
82+
UINotificationFeedbackGenerator()
83+
.notificationOccurred(.warning)
7584
}
7685
}
77-
.presentationDetents([.height(self.height)])
78-
.onAppear {
79-
UINotificationFeedbackGenerator()
80-
.notificationOccurred(.warning)
81-
}
8286
}
8387

8488
private var title: some View {

Projects/DSKit/Sources/Components/PokitBottomButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public struct PokitBottomButton: View {
3737
}
3838
.disabled(state == .disable)
3939
.padding(.top, 16)
40-
.padding(.bottom, 36)
40+
// .padding(.bottom, 36)
4141
}
4242

4343
private var label: some View {

Projects/DSKit/Sources/Components/PokitBottomSwitchRadio.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public struct PokitBottomSwitchRadio<Content: View>: View {
2020
}
2121
.padding(.horizontal, 20)
2222
.padding(.top, 16)
23-
.padding(.bottom, 28)
23+
// .padding(.bottom, 28)
2424
.background(.pokit(.bg(.base)))
2525
}
2626
}

Projects/DSKit/Sources/Components/PokitDeleteBottomSheet.swift

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,51 +22,56 @@ public struct PokitDeleteBottomSheet: View {
2222
}
2323

2424
public var body: some View {
25-
VStack(spacing: 0) {
26-
/// - 텍스트 영역
27-
VStack(spacing: 8) {
28-
Text(type.sheetTitle)
29-
.foregroundStyle(.pokit(.text(.primary)))
30-
.pokitFont(.title2)
31-
Text(type.sheetContents)
32-
.fixedSize(horizontal: false, vertical: true)
33-
.multilineTextAlignment(.center)
34-
.foregroundStyle(.pokit(.text(.secondary)))
35-
.pokitFont(.b2(.m))
25+
GeometryReader { proxy in
26+
let bottomSafeArea = proxy.safeAreaInsets.bottom
27+
28+
VStack(spacing: 0) {
29+
/// - 텍스트 영역
30+
VStack(spacing: 8) {
31+
Text(type.sheetTitle)
32+
.foregroundStyle(.pokit(.text(.primary)))
33+
.pokitFont(.title2)
34+
Text(type.sheetContents)
35+
.fixedSize(horizontal: false, vertical: true)
36+
.multilineTextAlignment(.center)
37+
.foregroundStyle(.pokit(.text(.secondary)))
38+
.pokitFont(.b2(.m))
39+
}
40+
.padding(.top, 36)
41+
.padding(.bottom, 20)
42+
/// - 취소 / 삭제 버튼 영역
43+
HStack(spacing: 8) {
44+
PokitBottomButton(
45+
"취소",
46+
state: .default(.primary),
47+
action: { delegateSend?(.cancelButtonTapped) }
48+
)
49+
50+
PokitBottomButton(
51+
"삭제",
52+
state: .filled(.primary),
53+
action: { delegateSend?(.deleteButtonTapped) }
54+
)
55+
}
3656
}
37-
.padding(.top, 36)
38-
.padding(.bottom, 20)
39-
/// - 취소 / 삭제 버튼 영역
40-
HStack(spacing: 8) {
41-
PokitBottomButton(
42-
"취소",
43-
state: .default(.primary),
44-
action: { delegateSend?(.cancelButtonTapped) }
45-
)
46-
47-
PokitBottomButton(
48-
"삭제",
49-
state: .filled(.primary),
50-
action: { delegateSend?(.deleteButtonTapped) }
51-
)
57+
.padding(.horizontal, 20)
58+
.padding(.bottom, 36 - bottomSafeArea)
59+
.background(.white)
60+
.pokitPresentationCornerRadius()
61+
.pokitPresentationBackground()
62+
.presentationDragIndicator(.visible)
63+
.readHeight()
64+
.onPreferenceChange(HeightPreferenceKey.self) { height in
65+
if let height {
66+
self.height = height
67+
}
5268
}
53-
}
54-
.padding(.horizontal, 20)
55-
.background(.white)
56-
.pokitPresentationCornerRadius()
57-
.pokitPresentationBackground()
58-
.presentationDragIndicator(.visible)
59-
.readHeight()
60-
.onPreferenceChange(HeightPreferenceKey.self) { height in
61-
if let height {
62-
self.height = height
69+
.presentationDetents([.height(self.height)])
70+
.onAppear {
71+
UINotificationFeedbackGenerator()
72+
.notificationOccurred(.warning)
6373
}
6474
}
65-
.presentationDetents([.height(self.height)])
66-
.onAppear {
67-
UINotificationFeedbackGenerator()
68-
.notificationOccurred(.warning)
69-
}
7075
}
7176
}
7277
//MARK: - Delegate

0 commit comments

Comments
 (0)