I have a UIImagePickerController of type camera when the user lands on a page. I have put a custom camera overlay on top of the UIImagePickerController, but none of the button events are firing. I know most of this code is from a base Apple code, so I am perplexed as to what is happening.
@interface TakePhotoViewController : UIImagePickerController <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
...
- (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType
{
if (self.capturedImages.count > 0)
{
[self.capturedImages removeAllObjects];
}
self.sourceType = sourceType;
self.delegate = self;
if (sourceType == UIImagePickerControllerSourceTypeCamera)
{
/*
The user wants to use the camera interface. Set up our custom overlay view for the camera.
*/
self.showsCameraControls = NO;
/*
Load the overlay view from the OverlayView nib file. Self is the File's Owner for the nib file, so the overlayView outlet is set to the main view in the nib. Pass that view to the image picker controller to use as its overlay view, and set self's reference to the view to nil.
*/
[[NSBundle mainBundle] loadNibNamed:@"CameraOverlay" owner:self options:nil];
float scale = [self getScaleForFullScreen];
self.cameraViewTransform = CGAffineTransformMakeScale(scale, scale);
self.overlayView.frame = self.cameraOverlayView.frame;
self.cameraOverlayView = self.overlayView;
self.overlayView = nil;
}
}
The CameraOverlay's owner is TakePhotoViewController. One of the buttons inside of the CameraOverlay sends a Touch Up Inside event to the outlet function listed below. The code in the TakePhotoViewController attached to a button is below, of which no logs are firing:
- (IBAction)outlet:(id)sender {
NSLog(@"outlet");
}