Giter Site home page Giter Site logo

googlewearalert's Introduction

GoogleWearAlert

NOTE: Due to the volatility of the Swift language and other commitments this library is no longer actively maintained.

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.

googlewearalert's People

Contributors

ashrobo avatar getfireapp avatar

Watchers

James Cloos avatar ApkDemo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.