TSnackBarView - 一个简单灵活的UI组件,完全用Swift编写
啪啪啪啪��
TSnackBarView 是一个简单灵活的 UI 组件,完全用 Swift 编写。 TSnackBarView帮助您轻松显示小吃吧3种样式:正常,成功和错误
例
若要运行示例项目,请克隆存储库,然后首先从示例目录运行。pod install
要求
安装
TSnackBarView可通过CocoaPods获得。要安装 它,只需将以下行添加到您的 Podfile 中:
pod 'TSnackBarView'
用法
import TSnackBarView
要显示正常消息:TSnackBarView
TSnackBarServiceImpl.shared.show(on: view,
message: "Normal SnackBar View\nPlease use Normal SnackBar View for displaying normal text message.",
onTapCloseAction: { snackBarView in
snackBarView.dismiss()
})
要显示成功消息,请执行以下操作:TSnackBarView
TSnackBarServiceImpl.shared.show(on: view,
message: "Success SnackBar View\nPlease use Success SnackBar View for displaying success text message.",
style: .success,
onTapCloseAction: { snackBarView in
snackBarView.dismiss()
})
To show with a error message:TSnackBarView
TSnackBarServiceImpl.shared.show(on: view,
message: "Error SnackBar View\nPlease use Error SnackBar View for displaying error text message.",
style: .error,
onTapCloseAction: { snackBarView in
snackBarView.dismiss()
})
Requirements
- iOS 10.0 or later
- Swift 5.0 or later
Author
fanta1ty, thinhnguyen12389@gmail.com
License
TSnackBarView is available under the MIT license. See the LICENSE file for more info.