Swift实现弹窗管理-SwiftPopuper

SwiftPopuper

源码地址:Github链接
hll-popupsmanager-ios 的swift版本
hll-popupsmanager-ios
hll-popupsmanager-ios技术文档

Install

1
pod 'SwiftPopuper'

使用

创建自定义View,并且遵循SwiftPopuperProtocol

1
2
3
4
5
6
7
8
9
class CustomPopView: UIView, SwiftPopuperProtocol {
func supplyCustomPopupView() -> UIView {
return self
}

func layout(with superView: UIView) {
// layout
}
}

配置弹窗并弹出

1
2
3
4
5
6
7
8
9
10
func showPopup() {
var config = PopuperConfig(identifier: "popupName")
config.sceneStyle = .center
config.clickOutsideDismiss = true
config.cornerRadius = 8
config.popAnimationStyle = .scale
config.isAloneMode = true
let customPopView = CustomPopView()
SwiftPopuper.addPopup(customPopView, options: config)
}

Swift实现弹窗管理-SwiftPopuper
https://houboye.github.io/2023/08/07/ios/230807-SwiftPopuper/
作者
boye
发布于
2023年8月7日
许可协议