turboc
turboc

Reputation: 153

Getting image from UIBarButtonSystemItem icons

I have found several posts that hit all around this but none that really address it. I have a UIToolBar setup and want to use systemicons with it. I setup the toolbar and setup my IBOutlets using the storyboard. Right now, I have two items on the toolbar and want to use the system icons for the buttons. The only way I have found to do this seems to be to programmatically create the buttons. It would seem that there should be a way from the storyboard editor to set the buttons image to one of the standard system images enumerated in the UIBarButtonItem class reference. Do I have to programmatically alloc and init the toolbar items to get a systemicon on it? Even a convertsystemitem to UIimage type of method would be ok. Something where I could do self.loadImageBarButton.image= UIBarButtonSystemItemCamera; or something like that.

Upvotes: 1

Views: 2210

Answers (1)

codester
codester

Reputation: 37189

You can give from storyBoard also.Select the barButtonItem which added in storyBoard.Go Attribute Inspector -> Idenifier as shown in image and select appropriate Identifier

enter image description here

Upvotes: 3

Related Questions