Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- geofencing
- Archive
- Realm
- 개발자
- window
- Session
- Git
- Swift
- rxswift
- JPA
- Code
- darkmode
- shorebird
- Apple
- 이미지
- UIButton
- appstore
- FLUTTER
- SwiftUI
- Firebase
- mac
- IOS
- iOS16
- Notification
- MacOS
- error
- 한글
- 웹뷰
- github
- Xcode
Archives
- Today
- Total
EEYatHo 앱 깎는 이야기
Swift ) popoverPresentationController - EEYatHo iOS 본문
반응형
UIActivityViewController로 action sheet를 띄우거나, share기능을 만들거나 할 때,
iPad 지원을 위해 popoverPresentationController를 설정하곤 한다.
1. popoverPresentation을 띄울 뷰를 설정한다.
vc.popoverPresentationController?.sourceView = view
2. 설정해준 뷰에서, popoverPresentation를 띄울 좌표를 설정 할 수 있다.
vc.popoverPresentationController?.sourceRect = CGRect(x: view.bounds.midX, y: view.bounds.midY, width: 0, height: 0)
3. popoverPresentation는 한 점을 가르키는 화살표를 넣을 수 있는데, 그 화살표의 방향을 설정 할 수 있다.
.left같은 방향을 넣으면, 위에서 설정한 좌표를 화살표로 가르키는 형태가 된다.
[]를 넣으면 화살표가 나오지 않으며, 위에서 설정한 좌표가 popoverPresentation의 중앙이 된다.
vc.popoverPresentationController?.permittedArrowDirections = [] // .left, .right, .up ...
'iOS, Swift' 카테고리의 다른 글
Swift ) Privaterelay Email - EEYatHo (1) | 2021.10.06 |
---|---|
Swift ) 애플로그인 2번째 이후 이메일 - EEYatHo iOS (1) | 2021.10.05 |
Swift ) Dictionary, JSONString, Data - EEYatHo iOS (0) | 2021.10.04 |
Swift ) Set Custom UserAgent - EEYatHo iOS (0) | 2021.10.01 |
Swift ) UINavigationBar shadowImage AutoHide - EEYatHo (0) | 2021.09.27 |
Comments