I’d love to know the consensus design pattern for implementing the following:
I have a main view with 2 buttons allowing a user to perform different tasks, both requiring an image to be chosen using a UIImagePickerController (let’s say task 1 = “choose/take photo of type foo” and task 2 = “choose/take photo of type bar“). At present I’m implementing the <UIImagePickerControllerDelegate> protocol in the view controller which presents the UIIPC, however given I need 2 different responses to the delegate method:
- (void) imagePickerController: (UIImagePickerController *) pickerdidFinishPickingMediaWithInfo: (NSDictionary *) info
depending on whether the user chose a foo or bar photo I’m interested in the best way to implement the 2 different <UIImagePickerController> delegate methods. Would a standalone delegate object, included in the presenting view controller and instantiated twice work best? (I’m only a couple of weeks old on iOS so still embracing design patterns).
If you create the pickers as properties in the header, you could make a comparisson between
pickerandyourPickerin the delegate method