一个通过动画每个字母翻转来切换文本的标签 - 使用 Swift 编写,使用 POP
要运行示例项目,请克隆仓库,并首先从示例目录运行 pod install
得分板标签可以通过 CocoaPods 获得。要安装它,只需将以下行添加到您的 Podfile 中
pod "ScoreboardLabel"
let font = aFont //any font, any size
let image = anImage //the letter backgroud image
let color = aUIColor
label = ScoreboardLabel(backgroundImage: image! ,text: "TEXT-FROM", flipToText: "TEXT-TO", font:font, textColor:color)
label.interval = Double(0.4) //each letter flip time
label.completionHandler = { (finished:Bool) in
if finished == true {
//label as finished animating
}
}
label.center = view.center
view.addSubview(label)
label.flip(true) //true = flip back and forth between texts. false = flip once from text to text and thats it
label.stopFlipping() //Will stop animating after finishing current flip
可以自由地就想法、问题或拉取请求进行协作。
Noam Bar-on, https://www.linkedin.com/in/noambaron
MIT 许可证 (MIT)
版权所有 © 2015 Noam Bar-on。
特此免费授予任何获得此软件及其相关文档文件(“软件”)副本的任何人以使用、复制、修改、合并、发布、分发、再许可或转售软件副本的权限,允许将软件提供给他人以供其如此使用,但须遵守以下条件
上述版权声明和本许可声明应包含在软件的任何副本或主要部分中。
本软件按“现状”提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途适用性和非侵权性保证。在任何情况下,作者或版权所有者均不对任何索赔、损害或其他责任承担责任,无论此类责任是基于合同、侵权或其他方式而引起的,并与其软件或使用或以其他方式使用软件有关。