• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

ashrobo/GoogleWearAlert: An Android Wear style confirmation view for iOS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ashrobo/GoogleWearAlert

开源软件地址(OpenSource Url):

https://github.com/ashrobo/GoogleWearAlert

开源编程语言(OpenSource Language):

Swift 100.0%

开源软件介绍(OpenSource Introduction):

GoogleWearAlert

Objective-C version kindly written by dimohamdy - https://github.com/dimohamdy/GoogleWearAlert

An Android Wear style confirmation view for iOS - Written in Swift

This library is not intended as fully fledged alert view replacement (it has no buttons) this confirmation view is ideal for giving a success/fail/done/posted etc confirmation to the user.

The view has a number of customisations and you're welcome to tweak the constants to adjust the look/size/colors etc.

There are 4 different types already set up for you: Success, Error, Warning, Message (take a look at the screenshots)

Take a look at the Example project to see how to use this library.

Follow the developer on Twitter: (http://twitter.com/a2hgo) (Ash Robinson)

alt tag

alt tag alt tag alt tag alt tag

Installation

Drag the "GoogleWearAlertView" folder from the example project into your project. This library requires ARC.

To show notifications use the following code:

//Basic init
GoogleWearAlert.showAlert(title: "Success", type: .Success)

//Convenience init
GoogleWearAlert.showAlert(title:"Error", image:nil, type: .Error, duration: 2.0, inViewController: self)

//Full init      
GoogleWearAlert.showAlert(title: "Message", image: nil, type: .Message, duration: 2.0, inViewController: self, atPostion: .Bottom, canBeDismissedByUser: true)

//If using the basic init, it's recommended you set the default controller to present the alert in first
GoogleWearAlert.setDefaultViewController(self)

Consecutive calls will result in the alerts being queued and presented after the previous one has been dismissed.

Set canBeDismissedByUser to true to allow the user to tap to dismiss the alert.

The following properties can be set:

  • viewController: The view controller to show the notification in. This might be the navigation controller.
  • title: The title of the notification view
  • subtitle: The text that is displayed underneath the title (optional)
  • image: A custom icon image that is used instead of the default one (optional)
  • type: The notification type (Message, Warning, Error, Success)
  • duration: The duration the notification should be displayed

Supports iOS7 and iOS8

If you have ideas how to improve this library please let me know or send a pull request.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap