Code Monkey home page Code Monkey logo

aanotifier's Introduction

Table of Contents

#AANotifier

Swift 3.0 Carthage compatible CocoaPods License MIT Build Status License MIT CocoaPods

##Description

AANotifier allows you to create UIView based fragments to be appear on screen at runtime. It is designed to make custom elements in UIView even from xib based views to animate on screen.

##Demonstration

AANotifier can be a custom popup view, action bar, message display banner etc.

To run the example project, clone the repo, and run pod install from the Example directory first.

##Requirements

  • iOS 8.0+
  • Xcode 8.0+
  • Swift 3+

Installation

AANotifier can be installed using CocoaPods, Carthage, or manually.

##CocoaPods

AANotifier is available through CocoaPods. To install CocoaPods, run:

$ gem install cocoapods

Then create a Podfile with the following contents:

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

target '<Your Target Name>' do
pod 'AANotifier'
end

Finally, run the following command to install it:

$ pod install

##Carthage

To install Carthage, run (using Homebrew):

$ brew update
$ brew install carthage

Then add the following line to your Cartfile:

github "EngrAhsanAli/AANotifier" "master"

Then import the library in all files where you use it:

import AANotifier

##Manual Installation

If you prefer not to use either of the above mentioned dependency managers, you can integrate AANotifier into your project manually by adding the files contained in the Classes folder to your project.

#Getting Started

##Define your notifier!

You can simply define your notifier with options as lazy initialization in your view controller.

Usage:

lazy var myNotifier: AANotifier = {
let notifierView = UIView.fromNib(nibName: "MyNotifier")!
let options: [AANotifierOptions] = [
.duration(0.4), // Time interval for animation
.transitionA(.fromBottom), // Show notifier animation
.transitionB(.toBottom), // Hide notifier animation
.position(.bottom), // notifier position
.preferedHeight(50), // notifier height
.margins(H: 60, V: 40) // notifier margins
]
let notifier = AANotifier(notifierView, withOptions: options)
return notifier
}()

##Show your notifier! You can simply show the notifier by show method or animateNotifer for animation options.

Usage:

// Show simply!
myNotifier.show()

// Show with options
myNotifier.animateNotifer(true, deadline: 2, didTapped: {
notifier.hide()
})

##Hide your notifier!

You can simply hide the notifier by hide method.

Usage:

// Show hide!
myNotifier.hide()

##AANotifier options

You can use following notifier options for your notifier:

Options Types Description
duration TimeInterval Animation time interval
preferedHeight CGFloat AANotifier height
hideStatusBar Bool Status bar visibility flag
transitionA AAViewAnimators Animator for showing notifier
transitionB AAViewAnimators Animator for hiding notifier
position AANotifierPosition AANotifier position
hideOnTap Bool Flag for hide on tap
margins (CGFloat?, CGFloat?) Horizontal and vertical margins respectively

#Contributions & License

AANotifier is available under the MIT license. See the LICENSE file for more info.

Pull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.

I would love to know if you are using AANotifier in your app, send an email to Engr. Ahsan Ali

aanotifier's People

Watchers

James Cloos avatar  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.