일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- PyQt
- modal
- library
- UIKit
- Chrats
- Swift
- TableView
- charts
- cocoapods
- PyQt5
- 라이브러리
- Storyboard
- UITableView
- Chart
- Xcode
- Python
- UIButton
- ui
- androidstudio
- 그래프
- Android
- 개발
- graph
- Apple
- ios
- 어플리케이션
- 개발자
- kotlin
- alamofire
- button
Archives
- Today
- Total
Jiwift
[iOS/Swift] safeAreaInsets 상단, 하단 영역 구하기 본문
반응형
safearea의 상단, 하단 insets을 구하는 코드
let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene
let topPadding = scene?.windows.first?.safeAreaInsets.top ?? .zero
let bottomPadding = scene?.windows.first?.safeAreaInsets.bottom ?? .zero
UIApplication을 통해서 top과 bottom의 safeAreaInsets을 구할 수 있다.
connectedScenes는 iOS 13부터 사용할 수 있다.
How can I get the safeAreaInsets i… | Apple Developer Forums
How can I get the safeAreaInsets i… | Apple Developer Forums
In the past, I use UIApplication.shared.windows.first?.safeAreaInsets.bottom to get the bottom safe area, but in iOS 15, there is an warning shows that windows has been deprecated. My project is written in SwiftUI, so is there a way to get the global safeA
forums.developer.apple.com
반응형
'iOS Dev > iOS' 카테고리의 다른 글
[iOS/Swift] Privacy Manifest 최종 정리 (0) | 2024.05.08 |
---|---|
[iOS/Swift] 앱에서 정적 라이브러리(.a)를 사용하는 분들이 있나요?? (0) | 2024.04.26 |
[iOS/Swift] 프로젝트 폴더 구조 구성 (0) | 2024.04.21 |
[iOS/Swift] MapKit 화면 이동 감지 Delegate (0) | 2024.04.15 |
[iOS/Swift] MapKit 추가하기 (0) | 2024.04.14 |