Rippleable:Swift 中的涟漪效果按钮
受 iOS 材质设计启发
示例
/// outLined-styled button
let outLinedButton: RippleableButton = {
let button = RippleableButton(type: .outlined)
button.layer.cornerRadius = 5
button.setTitle("Hello World!", for: .normal)
button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 18)
button.primaryColor = .blue
return button
}()
/// cointained-styled button
let containedButton: RippleableButton = {
let button = RippleableButton(type: .contained)
button.layer.cornerRadius = 5
button.setTitle("Hello World!", for: .normal)
button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 18)
button.primaryColor = .blue
return button
}()
/// text-styled button
let textButton: RippleableButton = {
let button = RippleableButton(type: .text)
button.layer.cornerRadius = 5
button.setTitle("Hello World!", for: .normal)
button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 18)
button.primaryColor = .blue
return button
}()
需求
Rippleable 使用 Xcode 11,Swift 5.0,需要 iOS 10.0。
安装
Rippleable 通过 Cocoapods 可用。
pod "Rippleable"
贡献
欢迎 Pull Requests。
作者
sesang06,[email protected]
许可证
Rippleable 使用 MIT 许可证。