I created a toolbar programmatically:
UIToolbar *boolbar = [UIToolbar new];
boolbar.barStyle = UIBarStyleDefault;
boolbar.tintColor = [UIColor orangeColor];
[boolbar sizeToFit];
And then added a button to it:
UIBarButtonItem *cancelleftBarButton =[[UIBarButtonItem alloc]initWithTitle:@"OK" style:UIBarButtonItemStyleBordered target:self action:@selector(tapBackGround:)];
cancelleftBarButton.tintColor = [UIColor orangeColor];
NSArray *array = [NSArray arrayWithObjects:cancelleftBarButton, nil];
[boolbar setItems:array animated:YES];
However, this button appears only at the left side of the toolbar. Is it possible to put it on the right side of the toolbar ?