Goku是一个用swift 3编写的alert视图,支持action sheet和alert view样式。现在提供6种样式来显示您的alert。如果您想使用Swift 3的世界,您需要Xcode 8及以上版本。
提供默认的alert视图主题。因此,您可以使用此默认主题或创建您喜欢的主题。
import Goku
// 🌟 Usage 👇
self.goku.presentAlert(animated: true, closure: { (make) in
make.theme
.actionSheet
.title("Okay/Cancel")
.message("A customizable action sheet message.")
.cancel("Cancel")
.destructive("OK")
.normal(["Button1", "Button2"])
.tapped({ (index) in
print("Tapped index is \(index)")
}
)
})
self.goku.presentAlert(animated: true, closure: { (make) in
make.theme
.alert
.success
.title("Congratulations!")
.message("You've just displayed this awesome Pop Up View.")
.cancel("Cancel")
.normal(["Default 1", "Default 2"])
.tapped({ (index) in
print("Tapped index is \(index)")
}
)
})
有关更多使用,请参阅示例
图标来自SCLAlertView
Goku通过Cocoapods提供。
将以下行添加到您的Podfile
pod 'Goku', '~> 1.0'
SnapKit
的使用Goku是根据MIT许可协议发布的。有关详细信息,请参阅LICENSE。