RMTostada 1.0.2

RMTostada 1.0.2

测试测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2016年12月
SwiftSwift版本3.0
SPM支持SPM

Rogelio Martinez维护。



RMTostada 1.0.2

RMTostada

RMTostada类提供了用于显示不同样式的tostadas视图的静态方法。RMTostada能够同时显示多个tostadas视图,每个tostadas视图将追加到队列中。当tostadas视图将要关闭时,队列(屏幕)上的所有后续的tostadas视图将会移动。

基本上有三种不同的tostadas视图

  • 自动关闭:这些tostadas视图将在一段时间后自动关闭。
  • 手动关闭:这些tostadas需要通过调用dismissWithId并传递要关闭的tostada的id来手动关闭。
  • 手动关闭并显示活动指示器:手动关闭类似,只是这些会包含一个UIActivityIndicatorView在文本的末端。

所有tostadas都将显示在rootViewController视图中,如果有(UIApplication.sharedApplication().windows.first?.rootViewController),因此它可以用在基于UITabBarController的应用程序中,并且所有的tostadas视图在每个标签页上都会可见。

这些样式基于Charles Scalesse的Toast-Swift pod。

截图

Screenshot

安装

使用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.