To run the example project, clone the repo, and run pod install
from the Example directory first.
DNFlyingBadges is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'DNFlyingBadges', '~> 0.1.1'
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.
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
}
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() }
}
Author: David Norman
Includes JNWSpringAnimation by JONATHAN WILLING
Includes free icons from: icomoon
DNFlyingBadges is available under the MIT license. See the LICENSE file for more info.