@@ -23,6 +23,8 @@ public struct PokitCategorySettingFeature {
2323 var categoryClient
2424 @Dependency ( UserClient . self)
2525 var userClient
26+ @Dependency ( KeyboardClient . self)
27+ var keyboardClient
2628 /// - State
2729 @ObservableState
2830 public struct State : Equatable {
@@ -55,6 +57,7 @@ public struct PokitCategorySettingFeature {
5557 var isProfileSheetPresented : Bool = false
5658 var isKeywordSheetPresented : Bool = false
5759 var pokitNameTextInpuState : PokitInputStyle . State = . default
60+ var isKeyboardVisible : Bool = false
5861 @Shared ( . inMemory( " SelectCategory " ) ) var categoryId : Int ?
5962 /// - 포킷 수정 API / 추가 API
6063 /// categoryName
@@ -100,11 +103,13 @@ public struct PokitCategorySettingFeature {
100103 case 프로필_목록_조회_API_반영( images: [ BaseCategoryImage ] )
101104 case 포킷_오류_핸들링( BaseError )
102105 case 카테고리_인메모리_저장( BaseCategoryItem )
106+ case 키보드_감지_반영( Bool )
103107 }
104108
105109 public enum AsyncAction : Equatable {
106110 case 프로필_목록_조회_API
107111 case 클립보드_감지
112+ case 키보드_감지
108113 }
109114
110115 public enum ScopeAction {
@@ -251,7 +256,8 @@ private extension PokitCategorySettingFeature {
251256 /// 단순 조회API들의 나열이라 merge사용
252257 return . merge(
253258 . send( . async( . 프로필_목록_조회_API) ) ,
254- . send( . async( . 클립보드_감지) )
259+ . send( . async( . 클립보드_감지) ) ,
260+ . send( . async( . 키보드_감지) )
255261 )
256262 case . 포킷명지우기_버튼_눌렀을때:
257263 state. domain. categoryName = " "
@@ -290,6 +296,10 @@ private extension PokitCategorySettingFeature {
290296 case let . 카테고리_인메모리_저장( response) :
291297 state. categoryId = response. id
292298 return . none
299+
300+ case let . 키보드_감지_반영( isVisible) :
301+ state. isKeyboardVisible = isVisible
302+ return . none
293303 }
294304 }
295305
@@ -310,6 +320,13 @@ private extension PokitCategorySettingFeature {
310320 await send ( . delegate( . linkCopyDetected( url) ) , animation: . pokitSpring)
311321 }
312322 }
323+
324+ case . 키보드_감지:
325+ return . run { send in
326+ for await detect in await keyboardClient. isVisible ( ) {
327+ await send ( . inner( . 키보드_감지_반영( detect) ) , animation: . pokitSpring)
328+ }
329+ }
313330 }
314331 }
315332
0 commit comments