Application License


  • Perpetual license (does not expire)
  • 1 application
  • Can distribute binary products only
  • Commercial use allowed
  • 6 months support
$12.99 Read License

Developer License


  • Perpetual license (does not expire)
  • Unlimited projects
  • Can distribute code and binary products
  • Commercial use allowed
  • 6 months support
$99.99 Read License

14 Day money-back guarantee

Full refund within 14 days of purchase date.

You need to log-in or create an account
  • Create an account
  • Log-in

Please use your real name.

Activation link will be sent to this address.

Minimum 8 characters

Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

Badge Notification for iOS

Badge Notification for iOS
Developed by Lucid Vapor LLC, Released Apr 11, 2012

An easy to use badge template similar to the badges found in UIKit. Fully customizable, self contained, and easy to install. No need for external images. No need to link or import dependent libraries.

Objective-C

Tags: alert , badge , count , ezbadgeview

iOS only allows badges in two very specific situations. When these are not sufficient, this component will allow you to have badges anywhere in your apps.

Features:

  • Fully customizable fonts, colors, borders, effects, and more.
  • No image files needed (fully self-contained using Core Graphics).
  • Automatic alignment so you don't have to worry about frame dimensions.
  • Only a few lines of code gets you up and running.
  • A thorough How-To Guide and Reference Documentation.
  • Works for both iPhone and iPad.
  • Fully retina display compatible.
  • Can use either strings or integers to set the text inside the badge.
  • Supports both ARC and non-ARC

Installation

To install EZBadgeView, simply drag the EZBadgeView.h and the EZBadgeView.m files to your Xcode project. Be sure to import the EZBadgeView.h file at the top of any class you wish to use it in.

#import "EZBadgeView.h"

Easy Mode

To easily show an EZBadgeView, simply call:

EZBadgeView *badgeView = [[EZBadgeView alloc] init];
badgeView.badgeValue = @"off";
[myView addSubview:badgeView];

How about one that stretches to the right using alignment left:

EZBadgeView *badgeView = [[EZBadgeView alloc] init];
badgeView.badgeAlignment = EZBadgeAlignmentLeft;
badgeView.badgeValue = @"stretches right";
[myView addSubview:badgeView];

This one stretches to the left:

EZBadgeView *badgeView = [[EZBadgeView alloc] init];
badgeView.badgeAlignment = EZBadgeAlignmentRight;
badgeView.badgeValue = @"stretches left";
[myView addSubview:badgeView];

And center:

EZBadgeView *badgeView = [[EZBadgeView alloc] init];
badgeView.badgeAlignment = EZBadgeAlignmentCenter;
badgeView.badgeValue = @"stretches center";
[myView addSubview:badgeView];

How about one that’s aligned with a particular right edge:

EZBadgeView *badgeView = [[EZBadgeView alloc] initWithRightEdge:CGRectGetMaxX(myView.bounds)];
badgeView.badgeValue = @"off";
[myView addSubview:badgeView];

A particular right point:

CGPoint point = CGPointMake(CGRectGetMaxX(myView.bounds), 25.0f);
EZBadgeView *badgeView = [[EZBadgeView alloc] initWithTopRightPoint:point];
badgeView.badgeValue = @"off";
[myView addSubview:badgeView];

Of course you can set the frame to anything you want and it will adhere to any alignment you set:

EZBadgeView *badgeView = [[EZBadgeView alloc] initWithFrame:CGRectMake(32, 19, 0, 0)];
badgeView.badgeValue = @"off";
[myView addSubview:badgeView];

Just need to work with integer values and don’t want to mess with strings?:

EZBadgeView *badgeView = [[EZBadgeView alloc] init];
badgeView.badgeIntValue = 36;
[myView addSubview:badgeView];

Don’t like the fancy shmancy?

EZBadgeView *badgeView = [[EZBadgeView alloc] initWithPlainBackgroundColor:[EZBadgeView classicBlueGrayColor] textColor:[UIColor whiteColor]];
badgeView.badgeValue = @"off";
[myView addSubview:badgeView];

Advanced Features

There are many visual attributes that you can customize:

badgeView.badgeBackgroundColor = [UIColor blueColor];

You can remove all the fancy effects by calling:

[badgeView makePlain];

To reverse, call [badgeView makeFancy];

Other various effects can be customized like so:

badgeView.badgeIntValue = 456;
badgeView.shouldShowShine = NO;
badgeView.shouldShowShadow = YES;
badgeView.shouldShowGradient = NO;
badgeView.shouldShowBorder = YES;
badgeView.badgeBorderWidth = 1.0;
badgeView.badgeBorderColor = [UIColor orangeColor];
badgeView.badgeTextColor = [UIColor brownColor];
badgeView.badgeTextFont = [UIFont fontWithName:@"Arial" size:12.0f];
badgeView.badgeBackgroundColor = [UIColor whiteColor];

See the EZBadgeView Reference for all of the property settings available.

User Reviews

No reviews have been submitted yet.
Read all 4 comments »

Questions & Comments


Or enter your name and Email
  • Hartmut Wilms License holderApplication License 1 year ago
    Hi,

    price tag states "starting from $ 12.99" so there should be a basic license, right? View pricing shows a developer license, only?
    • Lucid Vapor LLC Developer 1 year ago
      Sorry. Not sure how that occurred. It should be available as a basic license now.
  • barney mills 1 year ago
    Hi... great code thank you.... can you tell me the best way to hide the badge when the value is 0 ...
    • Lucid Vapor LLC Developer 1 year ago
      Simply set the badgeValue to nil and it should hide. If you're asking how to automatically make a zero value hide the badge, there are probably several ways of doing that. For the most part you could put an "if statement" in an intercepting location that checks for zero, and sets it to nil. Hope that helps.
You must be logged-in to vote. Log-in to your account or register now.