ios - How to use BBBadgeBarButtonItem in swift -


i want badge on barbutton , came across bbbadgebarbuttonitem not sure if work in swift or not.

  1. is possible ?
  2. if yes how ?

ps new ios , swift

when try use readme file says, getting error @ import line "expected identifier @ import declaration"

you need what's called objective-c bridging header since bbbadgebarbuttonitem written in objective-c , project swift.

see http://www.learnswiftonline.com/getting-started/adding-swift-bridging-header/ on how create bridging header.

once you've created bridging header you'll add following it:

#import bbbadgebarbuttonitem.h 

you should able (untested):

let custombutton = uibutton() let barbutton = bbbadgebarbuttonitem(customuibutton: custombutton) barbutton.badgevalue = 1 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -