CustomPopUpView
SCREENSHOT
安装
CustomPopUpView 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod 'CustomPopUpView'
CustomPopUpView
let redView : UIView = {
let view = UIView(frame: .zero)
view.backgroundColor = .red
return view
}()
lazy var customPopUpView : CustomPopUpView = {
let view = CustomPopUpView(frame: .zero, mainView: self.view)
view.delegate = self
view.dataSource = self
return view
}()
CustomPopUpView Open-Close
// Show customPopUpView
customPopUpView.openPopUpMessageView()
// Close customPopUpView
customPopUpView.closePopUpMessageView()
CustomPopUpViewDatasource
//MARK: CustomPopUpViewDataSource
func widhtContainerView() -> CGFloat {
return view.frame.width - 20
}
func heightContainerView() -> CGFloat {
return view.frame.width - 20
}
func containerContentView() -> UIView {
return self.redView
}
func constantContainerContentView() -> UIEdgeInsets {
return UIEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0)
}
CustomPopUpViewDelegate
//MARK:CustomPopUpViewDelegate
func customPopUpViewWillOpen(_ customPopUpView: UIView) {
print("customPopUpViewWillOpen")
}
func customPopUpViewDidOpen(_ customPopUpView: UIView) {
print("customPopUpViewDidOpen")
}
func customPopUpViewWillClose(_ customPopUpView: UIView) {
print("customPopUpViewWillClose")
}
func customPopUpViewDidClose(_ customPopUpView: UIView) {
print("customPopUpViewDidClose")
}
作者
- Yusuf Çınar - https://github.com/cinaryusufiu
许可协议
本项目采用MIT许可协议 - 有关详细信息,请参阅LICENSE.md文件。