Skip to content

normand1/DNFlyingBadge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DNFlyingBadges

Version License Platform

Usage

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

Requirements

Installation

DNFlyingBadges is available through CocoaPods. To install it, simply add the following line to your Podfile:

	pod 'DNFlyingBadges', '~> 0.1.1'

Intro

DNFlyingBadges is an easy to use and fun control for quick contextual user notification. Rather than the traditional loading or alert that often covers the view and requires user interaction DNFlyingBadges are quick and contextually relevant indicators that can be customized for a variety of situations using a single library.

Examples

DNFlyingBadges is built to accomodate many different scernarios. Here are only a few:

To start off you'll want to create a new FlyingBadgeView

var flyingBadgeView = DNFlyingBadgesView(frame: CGRectMake(0, 0, 40, 40), imageName: DNFlyingBadgesView.Image.Hipster)

(Optional) Customize the color if you'd like, the default is green

flyingBadgeView.color = UIColor.greenColor()

Now present the FlyingBadgeView by passing it a view and a point. You can optionally add a single rotation or a continuous spinning rotation

flyingBadgeView.rotateAndAnimateFlyingBadgeFromTopInView(tap.view!, toPoint: point, rotation: M_PI, continuousRotation: true, forTime:4) {
println("finished animation") //Handy Animation Completion Closure
}

Multiple badges at any point

As another example you can easily use DNFlyingBadges with multiple cells of a UITableViewController to provide contextual info about each individual cell.

flyingBadgeView.rotateAndAnimateFlyingBadgeFromBottomInView(self.view, toPoint: CGPointMake(cell!.center.x, cell!.center.y), rotation: M_PI, continuousRotation: false, forTime:1) {
println("animation finished")
self.tableView.reloadData()            }
}

Easy use with Table Cells

Credit

Author: David Norman

Includes JNWSpringAnimation by JONATHAN WILLING

Includes free icons from: icomoon

License

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

About

DNFlyingBadge is an easy to use and fun control for quick contextual user notification

Resources

License

Stars

Watchers

Forks

Packages

No packages published