I want in my iOS app user can select some field on clicking the `UIButton`.

I want when user selects the field on click of `UIButton`,image of button should change and open my `MMPickerView` and when user clicks again the `UIButton` should get unselected and display previous image in `UIButton` and do not open `MMPickerview` at this time.

This is my code:

```
 - (IBAction)showPickerViewButtonPressed:(id)sender {
      if( (_button.selected = !_button.selected))
      {
           UIImage *bimage=[UIImage imageNamed: @"play.jpg"];
           [_button setImage:bimage forState:UIControlStateNormal];
      } 
      else
      {
           [MMPickerView showPickerViewInView:self.view
                       withStrings:_stringsArray
                       withOptions:@{MMbackgroundColor: [UIColor blackColor],
                                     MMtextColor: [UIColor whiteColor],
                                     MMtoolbarColor: [UIColor blackColor],
                                     MMbuttonColor: [UIColor whiteColor],
                                     MMfont: [UIFont systemFontOfSize:18],
                                     MMvalueY: @3,
                                     MMselectedObject:_selectedString}
                        completion:^(NSString *selectedString) {

                            _label.text = selectedString;
                            _selectedString = selectedString;
             }];
         }
   }

```