NeatTipView
实时文档
是什么?
NeatTipView 允许您显示消息提示,这可以用作行动号召或信息提示。
- 支持不同的提示位置。
- 多种动画风格。
- 智能放置动态字符串。
- 全 NSAttributtedString 支持。
安装
NeatTipView 通过 CocoaPods 和 Carthage 提供。
CocoaPods
要安装它,只需在 Podfile 中添加以下行
pod "NeatTipView"
Carthage
要安装它,只需将以下行添加到您的 Cartfile
github "rootstrap/NeatTipView"
使用方法
1. 自定义首选项
首选项被封装在 NeatViewPreferences
结构体中,请查看内部文档以获取更多关于可用定制点的信息。
示例
var preferences = NeatViewPreferences()
preferences.animationPreferences.appearanceAnimationType = .fromBottom
preferences.animationPreferences.disappearanceAnimationType = .toBottom
2. 初始化并呈现提示
let tipView = NeatTipView(
superview: view,
centerPoint: center,
attributedString: attributedString(),
preferences: preferences,
arrowPosition: arrowPosition
)
tipView.show()
示例
要运行示例项目,请先克隆存储库,然后从 Example 目录中运行 pod install
。
许可协议
NeatTipView 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。