SheetViewController
关于
可定制的原生样式的表格警报控制器,具有三种操作类型:单独、内部、无。
演示
具有 .inner
操作类型的 SheetViewController
交互
单独操作类型
let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .separately)
纵向
横屏
内部操作类型
let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .inner)
竖屏
横屏
无操作类型
let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .none)
竖屏
横屏
示例
要运行示例项目,请克隆仓库,然后从Example目录运行pod install
。
安装
SheetViewController可以通过CocoaPods获得。要安装它,只需将以下行添加到您的Podfile中
inhibit_all_warnings!
target 'YOUR-TARGET-NAME' do
use_frameworks!
pod 'SheetViewController'
end
使用
// 'titleMessage' - title for alert.
// 'message' - message for alert.
// 'cancelTitle' - title for bottom button.
// 'cancelHandler' - the handler of bottom button click.
//
// 'customRowView' - the object of class 'UIView' or his inheritors.
// 'row' - the object of class 'SheetItemActionView'.
let alert = SheetViewController.alert(with: titleMessage, message: message, actionType: .inner)
alert.setCancelButton(title: cancelTitle, and: cancelHandler)
alert.addView(customRowView)
alert.addRow(actionView: row)
present(alert, animated: true, completion: nil)
作者
Anton Yereshchenko
许可证
SheetViewController受MIT许可证的约束。有关更多信息,请参阅LICENSE文件。
灵感来源
在Figma中设计iPhone - https://setproduct.com/ios
用于项目中
图标
Icons8 - https://icons8.com