测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可证 | MIT |
Released最后发布 | 2017年4月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Alex Steiner 维护。
用 Swift 编写的最喜欢的动态按钮
对于手动安装,将源文件夹拖动到您的项目中。
对于使用 CocoaPods,请将此行添加到您的 Podfile
:
pod 'FaveButton', '~> 2.1'
创建一个继承自 FaveButton
的按钮
为 Normal
状态添加图像
将 IBOutlet
委托属性设置为 FaveButtonDelegate
的子类
可选 通过操纵属性来更改按钮设置
@IBInspectable public var dotFirstColor: UIColor
@IBInspectable public var dotSecondColor: UIColor
@IBInspectable public var circleFromColor: UIColor
@IBInspectable public var circleToColor: UIColor
需要稍后添加。
如果您想要不同的点颜色,如 Twitter 的心动动画
,则使用您想要按钮的委托方法。
func faveButtonDotColors(_ faveButton: FaveButton) -> [DotColors]?{
if faveButton == myFaveButton{
// return dot colors
}
return nil
}
在 FaveButtonDemo 中,您可以找到一组导致点以这种方式出现的颜色
FaveButton 吸收了 Twitter 在他们的 应用 中使用的 Like Heart Animation
的灵感。
FaveButton 在 MIT 许可证下发布。