I am trying to create a simple camera app with an overlay view that shows two buttons and a gesture recognizer.
Currently I have an 'OverlayViewController' with a .xib file which contains a UIView with two buttons and a gesture recognizer.
In my CameraViewController in which I show the camera on viewDidLoad through the UIImagePicker, I try to assign this picker my overlay but so far im not getting any of the buttons in the overlay....
OverlayViewController.h
@interface OverlayViewController : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIGestureRecognizerDelegate>
- (IBAction)take_picture:(UIButton *)sender;
- (IBAction)choose_picture:(UIButton *)sender;
@end
OverlayViewController.m -pretty much empty (do I need to initialize the UIButtons here ??)
CameraViewController.h
@interface ProfileViewController : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIGestureRecognizerDelegate>
@property (strong, nonatomic) UIImagePickerController *picker;
@property (strong, nonatomic) OverlayViewController *overlay;
CameraViewController.m
-(void)setupCamera
{
self.picker = [[UIImagePickerController alloc] init];
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.overlay = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:nil];
// _overlay.delegate = self;
// NSArray* nibViews= [[NSBundle mainBundle] loadNibNamed:@"OverlayViewController" owner:self.overlay options:nil];
// UIView* uiView= [nibViews objectAtIndex:0];
// uiView.opaque= NO;
// uiView.backgroundColor= [UIColor clearColor];
self.picker.cameraOverlayView = self.overlay.view;
self.picker.delegate = self.overlay;
self.picker.showsCameraControls = NO;
self.picker.navigationBarHidden = YES;
self.picker.toolbarHidden = YES;
self.picker.wantsFullScreenLayout = YES;
[self presentViewController:self.picker animated:NO completion:nil];
}
Im also wondering which controller should be the delegate for these invisible buttons...
thanks for the help in advance!