티스토리 뷰
728x90
반응형
오픈 라이브러리 PanModal 사용하기
- 모달창을 띄우고 싶은 뷰컨
import PanModal
//...
// MARK: - @IBAction Properties
@IBAction func sortButton(_ sender: Any) {
let storyboard = UIStoryboard(name: Const.Storyboard.Name.SortPanModal, bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: Const.ViewController.Name.SortPanModal) as! SortPanModalVC
self.presentPanModal(vc)
}
- 모달창 뷰컨
import PanModal
class SortPanModalVC: UIViewController {
// MARK: - View Life Cycle
override func viewDidLoad() {
super.viewDidLoad()
// ...
}
// ...
}
// MARK: - PanModalPresentable
extension SortPanModalVC: PanModalPresentable {
// 스크롤되는 tableview 나 collectionview 가 있다면 여기에 넣어주면 PanModal 이 모달과 스크롤 뷰 사이에서 팬 제스처를 원활하게 전환합니다.
var panScrollable: UIScrollView? {
return nil
}
var shortFormHeight: PanModalHeight {
return .contentHeight(280)
}
var longFormHeight: PanModalHeight {
return .maxHeightWithTopInset(0)
}
}
완성

모달창 높이 속성값
- contentHeight

- contentHeightIgnoringSafeArea

- intrinsicHeight

- maxHeight

- maxHeightWithTopInset

출처
728x90
반응형
'iOS > Open Library' 카테고리의 다른 글
| iOS) Alamofire(알라모파이어) 깃허브 문서를 요약해보자 (0) | 2021.07.25 |
|---|---|
| iOS) 오픈소스 라이브러리 SkeletonView(스켈레톤뷰) 사용해보자 (0) | 2021.07.25 |
| iOS) Moya 사용 (0) | 2021.07.22 |
| iOS) Kingfisher 사용 (0) | 2021.07.22 |
| iOS) Realm 을 이용해서 데이터베이스 구축 (0) | 2021.07.21 |
댓글
TAG
- APNS
- Widget
- SwiftUI
- Algorithm
- async/await
- urlsession
- OpenSourceLibrary
- WWDC
- github
- Firebase
- Notification
- 서버통신
- Protocol
- Swift
- IOS
- YPImagePicker
- configurable widget
- CloneCoding
- WWDC22
- projectsetting
- UserDefaults
- watchOS
- RxCocoa
- MOYA
- Objective-C
- rxswift
- 2022 KAKAO TECH INTERNSHIP
- WidgetKit
- MVVM
- containerBackground
최근에 올라온 글
최근에 달린 댓글
글 보관함
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
링크
- Total
- Today
- Yesterday