@@ -26,6 +26,8 @@ public struct ContentSettingFeature {
2626 private var contentClient
2727 @Dependency ( CategoryClient . self)
2828 private var categoryClient
29+ @Dependency ( KeyboardClient . self)
30+ private var keyboardClient
2931 /// - State
3032 @ObservableState
3133 public struct State : Equatable {
@@ -71,6 +73,7 @@ public struct ContentSettingFeature {
7173 var showLinkPreview = false
7274 var isShareExtension : Bool
7375 var pokitAddSheetPresented : Bool = false
76+ var isKeyboardVisible : Bool = false
7477 }
7578
7679 /// - Action
@@ -110,6 +113,7 @@ public struct ContentSettingFeature {
110113 case 선택한_포킷_인메모리_삭제
111114 case 링크팝업_활성화( PokitLinkPopup . PopupType )
112115 case error( Error )
116+ case 키보드_감지_반영( Bool )
113117 }
114118
115119 public enum AsyncAction : Equatable {
@@ -119,6 +123,7 @@ public struct ContentSettingFeature {
119123 case 컨텐츠_수정_API
120124 case 컨텐츠_추가_API
121125 case 클립보드_감지
126+ case 키보드_감지
122127 }
123128
124129 public enum ScopeAction : Equatable { case 없음 }
@@ -188,7 +193,8 @@ private extension ContentSettingFeature {
188193 var mergeEffect : [ Effect < Action > ] = [
189194 . send( . async( . 카테고리_목록_조회_API) ) ,
190195 . send( . inner( . URL_유효성_확인) ) ,
191- . send( . async( . 클립보드_감지) )
196+ . send( . async( . 클립보드_감지) ) ,
197+ . send( . async( . 키보드_감지) )
192198 ]
193199 if let id = state. domain. contentId {
194200 mergeEffect. append ( . send( . async( . 컨텐츠_상세_조회_API( id: id) ) ) )
@@ -356,6 +362,9 @@ private extension ContentSettingFeature {
356362 . inner( . 링크팝업_활성화( . error( title: errorResponse. message) ) ) ,
357363 animation: . pokitSpring
358364 )
365+ case let . 키보드_감지_반영( response) :
366+ state. isKeyboardVisible = response
367+ return . none
359368 }
360369 }
361370
@@ -445,6 +454,13 @@ private extension ContentSettingFeature {
445454 await send ( . inner( . linkPopup( url) ) , animation: . pokitSpring)
446455 }
447456 }
457+
458+ case . 키보드_감지:
459+ return . run { send in
460+ for await detect in await keyboardClient. isVisible ( ) {
461+ await send ( . inner( . 키보드_감지_반영( detect) ) , animation: . pokitSpring)
462+ }
463+ }
448464 }
449465 }
450466
0 commit comments