Code Monkey home page Code Monkey logo

notie's Introduction

Notie

Build Status Cocoapods Compatible Carthage Compatible Platform License

Undistracted in-app notification in Swift, with added buttons and input box.

Installation

CocoaPods

To integrate Notie into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

pod 'Notie'

Then, run the following command:

$ pod install

And add import Notie to the top of the files using Notie.

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Notie into your Xcode project using Carthage, specify it in your Cartfile:

github "thii/Notie"

Run carthage to build the framework and drag the built Notie.framework into your Xcode project.

Usage

Example

Show a notification with Confirm style

let notie = Notie(view: self.view, message: "Are you sure you want to do that?", style: .Confirm)

notie.leftButtonAction = {
	// Add your left button action here
    notie.dismiss()
}

notie.rightButtonAction = {
	// Add your right button action here
    notie.dismiss()
}

notie.show()

Parameters

The following parameters can be modified to customize the appearance of the notification.

  • style: The style of the notification. .Confirm style includes message view and two confirm buttons. .Input style adds an extra input text field. Default to .Confirm.

  • leftButtonAction: A block to call when the user taps on the left button.

  • rightButtonAction: A block to call when the user taps on the right button.

  • leftButtonTitle: The title of the left button. Default to OK.

  • rightButtonTitle: The title of the left button. Default to Cancel.

  • placeholder: The placeholder of the input text field. Default to nil.

  • animationDuration: How long the slide down animation should last.

  • messageBackgroundColor: The background color of the message view.

  • messageTextColor: The text color of the message view. Default to white color.

  • inputFieldBackgroundColor: The background color of the input text field. Default to white color.

  • inputFieldTextColor: The text color of the input text field. Default to dark gray.

  • leftButtonBackgroundColor: The background color of the left button.

  • leftButtonTextColor: The text color of the left button. Default to white color.

  • rightButtonBackgroundColor: The background color of the right button.

  • rightButtonTextColor: The text color of the right button. Default to white color.

Requirements

iOS 9 or greater.

License

Notie is released under the MIT license. See LICENSE for details.

notie's People

Contributors

thii avatar

Watchers

Sp0tlight 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.