[UIKit] "keyWindow' was deprecated in iOS 13.0 : Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes" error 에러 해결
2022. 8. 6. 17:43ㆍiOS/UIKit
728x90
반응형
let keyboardHeight = keyboardFrame.cgRectValue.height
let scenes = UIApplication.shared.connectedScenes
let windowScene = scenes.first as? UIWindowScene
let window = windowScene?.windows.first
if self.viewCommentConstraint.constant == 0{
self.viewCommentConstraint.constant += (keyboardHeight-(window?.safeAreaInsets.bottom ?? 0))
}
[키보드 전체코드]
https://nlestory.tistory.com/112
[iOS/Swift] 텍스트필드 입력(클릭) 시 키보드 올리기/내리기
🧸 시작 텍스트필드를 사용할 때 키보드가 위로 올라왔다가 내려갔다가 한다. 키보드가 올라가면서 화면을 가리게 되는 데 입력하는 텍스트필드가 가려질 때가 있다. 그러면 화면에 있는 컴포
nlestory.tistory.com
[참고자료]
https://developer.apple.com/forums/thread/682621
'windows' was deprecated in iOS 15… | Apple Developer Forums
That depends on where you are calling this code from. This is just grabbing the first key window that is found in the whole application, which might not belong to the window scene the view hierarchy belongs to that you are dealing with. If you have a view,
developer.apple.com
728x90
반응형
'iOS > UIKit' 카테고리의 다른 글
[UIKit] 스크롤뷰/테이블뷰 제일 밑으로 이동 (0) | 2022.08.06 |
---|---|
[UIKit] 텍스트필드 입력(클릭) 시 키보드 올리기/내리기 (0) | 2022.08.06 |
[UIKit] 위에서 올라오는 바텀시트(모달창) 만들기 (FloatingPanel 라이브러리) (0) | 2022.08.06 |
[UIKit] 테이블뷰 셀안에 있는 버튼 클릭 이벤트 처리하기 -델리게이트 패턴 (0) | 2022.08.06 |
[UIKit] 네비게이션바 뒤로가기 아이템 설정 변경 (0) | 2022.08.05 |