Pio 的出色的可自定义 ViewController
POViewController
是 UIViewController
的子类,并且易于自定义视图大小和呈现位置。
样式 | 代码 | 图像 |
弹出 |
class PopUpViewController: POViewController {
...
init() {
super.init(
direction: .center,
viewSize: .init(
width: .absolute(200),
height: .fit
),
isSwipeEnabled: false
)
}
...
}
|
|
底部表单 |
class BottomSheetViewController: POViewController {
...
init() {
super.init(
direction: .bottom,
viewSize: .init(
width: .full,
height: .absolute(300)
),
isSwipeEnabled: true
)
}
...
}
|
|
侧边菜单 |
class SideMenuViewController: POViewController {
...
init() {
super.init(
direction: .right,
viewSize: .init(
width: .fit,
height: .full
),
isSwipeEnabled: true
)
}
...
}
|
请参考示例项目。
要运行示例项目,请克隆此仓库,然后在 Example 文件夹中打开 Example.xcodeproj
。
POViewController
使用 Swift 5.5 编写要使用 Swift Package Manager (SPM) 安装 POViewController
,您可以参考 Apple 发布的教程。
https://github.com/kyungpyoda/POViewController.git
以添加软件包依赖项。pod 'POViewController'
欢迎任何形式的贡献! 🤗
POViewController
在 MIT 许可证下可用。有关详细信息,请参阅 LICENSE
。