Creating UIBarButtonItem iOS

You create UIBarButtonItem by writing few lines of codes like this:

//Swiftlet barButtonItem = UIBarButtonItem(title: "Greetings!", style: .Plain, target: self, action: #selector(barButtonTapped))
self.navigationItem.rightBarButtonItem = barButtonItem//Objective-CUIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Greetings!"
style:UIBarButtonItemStylePlain target:self action:@selector(barButtonTaped)];
self.navigationItem.rightBarButtonItem = barButtonItem;