Translation to STPopup
There are two ways to provide,formSheet
、bottomSheet
,and you can customize backgroundView.
You just need to touch the bar and then move down to close.
- Cocoapods
pod MTPopup
- Carthage
github "huangboju/MTPopup"
- BottomSheet
class YourController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
contentSizeInPopup = CGSize(width: 300, height: 200)
landscapeContentSizeInPopup = CGSize(width: 400, height: 200)
}
}
let popupController = MTPopupController(rootViewController: YourController())
popupController.style = .bottomSheet // Default is formSheet
popupController.present(in: self)
- Custom backgroundView
let popupController = MTPopupController(rootViewController: YourController())
let blurEffect = UIBlurEffect(style: .dark)
popupController.backgroundView = UIVisualEffectView(effect: blurEffect)
popupController.backgroundView?.alpha = 0.8
popupController.present(in: self)