i want creating uibarbutton without interface builder = (whit code) and this button开发者_Go百科 is style camera please help me
Objective-C:
UIBarButtonItem* cameraBarButtonItem =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera
target:self action:@selector(myCameraAction)];
Swift:
let cameraBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Camera, target: self, action: "myCameraAction")
This will create a UIBarButtonItem with the system item icon of the camera.
精彩评论