测试测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布上次发布 | 2016年12月 |
SwiftSwift版本 | 3.0 |
SPM支持SPM | ✗ |
由Rogelio Martinez维护。
RMTostada
类提供了用于显示不同样式的tostadas视图的静态方法。RMTostada
能够同时显示多个tostadas视图,每个tostadas视图将追加到队列中。当tostadas视图将要关闭时,队列(屏幕)上的所有后续的tostadas视图将会移动。
基本上有三种不同的tostadas视图
dismissWithId
并传递要关闭的tostada的id来手动关闭。UIActivityIndicatorView
在文本的末端。所有tostadas都将显示在rootViewController视图中,如果有(UIApplication.sharedApplication().windows.first?.rootViewController)
,因此它可以用在基于UITabBarController
的应用程序中,并且所有的tostadas视图在每个标签页上都会可见。
这些样式基于Charles Scalesse的Toast-Swift pod。
使用cocoapod。最小部署目标为iOS 8.0。
pod 'RMTostada'
// Basic usage
RMTostada.showSelfDismissingWithText("Self dismissing with default duration")
RMTostada.showSelfDismissingWithText("Self dismissing with specified duration", duration: 5)
// Custom style
var style = RMTostadaStyle()
style.textColor = UIColor.yellow
style.backgroundColor = UIColor.red
style.contentHorizontalPadding = 3
style.contentVerticalPadding = 3
style.cornerRadius = 3
style.font = UIFont(name: "BradleyHandITCTT-Bold", size: 14)!
style.displayShadow = true
style.shadowColor = UIColor.orange
RMTostada.showSelfDismissingWithText("Self dismissing with custom style", style: style)
// With completition handler
RMTostada.showSelfDismissingWithText("Self dismissing with comp handler", completion: {
RMTostada.showSelfDismissingWithText("From completition handler")
})
// With activity indicator
let defaultStyleId = RMTostada.showActivityWithText("Show activity with default style")
RMTostada.dismissWithId(defaultStyleId)
MIT License
Copyright (c) 2016 Rogelio Martinez Kobashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.