要运行示例项目,请克隆仓库,并首先从 Example 目录中运行 pod install
。
描述:这是一个自定义按钮,带有加载进度动画以及成功和错误状态。
1.Scuess can set Transition
2.Error can set reminder message
3.Error message will autoLayout when show
1. 错误、成功、过渡的演示
2. 设置
3. 设置(错误颜色、顶部边距、字体)
2. 带钩子动画的成功
loadingButton.stopLoading(true, completed: {
print("Scuess Completed")
})
3. 带叉号动画的错误
loadingButton.stopLoading(false, completed: {
print("Error Completed")
})
4. 带叉号、消息和动画的错误
loadingButton.stopWithError("Error !!", hideInternal: 2, completed: {
print ("Fail Message Completed")
})
5. 使用函数添加过渡
loadingBtn.addScuessPresentVC(vc)
如果您以默认过渡方式呈现 presentingViewController,则可以使用以下方式添加自定义过渡:
loadingBtn.addScuessWithDismissVC()
6. 当显示错误消息时自动推送底部视图
MMLoadingButton 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
Swift3
pod "MMLoadingButton"
Swift 2.3
pod ‘MMCardView’,:git => 'https://github.com/MillmanY/MMLoadingButton', :branch => ‘Swift2’
Millman, [email protected]
MMLoadingButton 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。