Ready to Level-Up?

This just in! If your rusty iOS skills could use some refining, or if you're just starting out and you want to level-up fast, consider signing up for our upcoming iOS Screencasts

New from iOS Rocket Surgery Swift Video Tutorials: The rapidly evolving Apple-iOS ecosystem has just been thrown into tumult with the recent introduction of the Swift Programming Language. Are you ready to finally try iOS development? Are you needing to switch from Objective-C to Swift? Sign up today for our free video courses!
(By the dear folks at Swift Tutorial Videos, a sister company)

Wednesday, December 18, 2013

iOS Get Badge Number

So, you want to get the number currently set on the iOS notification badge, do you?

One of the coolest and underused features of iOS (as it pertains to small, independent developers) is the notification badge. Setting the badge number tells the user that there is something important to do, and when they open the application, they should expect to see something interesting and valuable. But, since you're coding this, you may not care about conventions, you may just say "Just show me the code, dangit!". You sir, are a gentleman with no time for dickering about.

Here is how you get the current value of the notification badge on the iOS home screen:


  NSInteger *badgeNumber = [UIApplication sharedApplication].applicationIconBadgeNumber;

I tip my hat to you dear sir/maam, and wish you a pleasant day.

If you're just arriving from another planet and have never seen the internet before, you should know that you happened upon the BEST WEBSITE IN THE WORLD (just kidding)! Now, if you'll kindly give us a +1, you'll never lose us as you travel the information superhighway. Godspeed your return traveler!




About Me

Easy NSDateFormatter Tool

Save yourself some time in formatting your NSDates to NSStrings, and use the Blind NSDate app, which you can download from iTunes. There's also a website where you can format your NSDates: http://www.blindnsdate.com

Popular Posts

Designed By Seo Blogger Templates