You might want to attach the UIGestureRecognizer to the main view. Once someone closes the main view, you can receive the event and delete your UIPickerView. Write something like this in ViewController:
UITapGestureRecognizer *tgr = [[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(viewWasTapped)];
[self.view addGestureRecognizer:tgr];
In your viewWasTapped method, you get all the taps in the ViewControllers view.
, .