Att Ios Ui Toolbar
## Using the Toolbar
We can use the toolbar to modify view elements.
For example, in the inbox of an email application, there are options such as delete, share, reply, and more, as shown below:

Key Properties
* barStyle
* items
## Adding a Custom Method `addToolbar`
```objective-c
-(void)addToolbar {
UIBarButtonItem *spaceItem = [ initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIBarButtonItem *customItem1 = [ initWithTitle:@"Tool1" style:UIBarButtonItemStyleBordered target:self action:@selector(toolBarItem1:)];
UIBarButtonItem *customItem2 = [ initWithTitle:@"Tool2" style:UIBarButtonItemStyleDone target:self action:@selector(toolBarItem2:)];
NSArray *toolbarItems = [NSArray arrayWithObjects: customItem1, spaceItem, customItem2, nil];
UIToolbar *toolbar = [ initWithFrame:CGRectMake(0, 366+54, 320, 50)];
[toolbar setBarStyle:UIBarStyleBlackOpaque];
[self.view addSubview:toolbar];
[toolbar setItems:toolbarItems];
}
To understand what is being done, we add a UILabel outlet in our ViewController.xib and create an IBoutlet named `label` for the UILabel.
We also need to add two methods to handle the actions of the toolbar items, as follows:
```objective-c
-(IBAction)toolBarItem1:(id)sender {
[label setText:@"Tool 1 Selected"];
}
-(IBAction)toolBarItem2:(id)sender {
[label setText:@"Tool 2 Selected"];
}
Update `viewDidLoad` in ViewController.m as follows:
```objective-c
- (void)viewDidLoad {
;
// The method hideStatusbar called after 2 seconds
;
// Do any additional setup after loading the view, typically from
YouTip