Thursday, February 6, 2014

AyalBadgeView

Today I’m going to talk about a simple badge view, which can be applied, to any view. You can simply create object of "AyalBadgeView" with the parent view, which you want to display the badge number and the location of the badge number.

Let's see the how to use the "AyalBadgeView".


UIButton *buttionTwo = [UIButton buttonWithType:UIButtonTypeCustom];
buttionTwo.frame = CGRectMake(100, 150, 150, 40);
buttionTwo.backgroundColor = [UIColor grayColor];
[buttionTwo setTitle:@"My Button" forState:UIControlStateNormal];
[self.view addSubview:buttionTwo];
AyalBadgeView *ayalBadgeViewButton = [[AyalBadgeView alloc] initWithFrame:CGRectMake(140, -10, 16, 16) parentView:buttionTwo];
ayalBadgeViewButton.badgeNumber = 8;
view raw gistfile1.txt hosted with ❤ by GitHub

You can download the github project "AyalBadgeView" from this location and use it in your projects.