Defining and laying out the view controllers
ManyMasks divides its application logic between two view controllers. The first view controller enables the user to capture and preview real faces. The second enables the user to review, save, and share merged faces. A type of callback method called a segue enables the first view controller to instantiate the second and pass a merged face to it.
Capturing and previewing real faces
Import copies of the VideoCamera.h
and VideoCamera.m
files that we created in Chapter 2, Capturing, Storing, and Sharing Photos. These files contain our VideoCamera
class, which extends OpenCV's CvVideoCamera
to fix bugs and add new functionality.
Rename ViewController.h
and ViewController.m
to CaptureViewController.h
and CaptureViewController.m
. Edit CaptureViewController.h
so that it declares a CaptureViewController
class, as seen in the following code:
#import <UIKit/UIKit.h> @interface CaptureViewController : UIViewController @end
CaptureViewController
will have...