1) Add below code into Appdelegate.h
1 |
@property(nonatomic,strong)UILabel *lblbedge2; |
2)Add it into Appdelegate.m
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
_lblbedge2=[[UILabel alloc]initWithFrame:CGRectMake(300,0, 15, 15)]; _lblbedge2.layer.cornerRadius=_lblbedge2.frame.size.width/2; _lblbedge2.layer.masksToBounds=YES; _lblbedge2.textAlignment=NSTextAlignmentCenter; _lblbedge2.textColor=[UIColor whiteColor]; _lblbedge2.text=@"0"; [_lblbedge2 setFont:[UIFont systemFontOfSize:8]]; _lblbedge2.tag=103; [_lblbedge2 setBackgroundColor:[UIColor colorWithRed:77/255.0 green:190/255.0 blue:36/255.0 alpha:1.0]]; _lblbedge2.contentMode = UIViewContentModeScaleAspectFit; [self.navigationController.navigationBar addSubview:_lblbedge2]; [self.navigationController.navigationBar bringSubviewToFront:_lblbedge2]; |
3)Access this label from appdelegate class to your viewcontroller class.

1 2 3 |
AppDelegate *appDel = (AppDelegate *)[UIApplication sharedApplication].delegate; appDel.lblbedge2.text=[NSString stringWithFormat:@"%lu",(unsigned long)[array count]]; |
Thank you.Please comment and share the article if you find something useful. Happy Coding..
Hi,
Pls send me sample to p.saikrishna@outlook.com
Thanks,
Sai
I am not getting image?
Get image from flaticon.com
Thanks For sharing this helpful and informative blog. I love the way that you describe the things. You are an incredible writer, Thank you so much for sharing the blog. Please keep sharing.
Mobile Application Development
Android App Development
IOS App Development
Thanks Your Tutorial Helped me To create my Own Website.
New Mobiles at Cheapest Price also Earn Free Recharges Everyday