AVCamManual/AAPLPreviewView.m

/*
 Copyright (C) 2014 Apple Inc. All Rights Reserved.
 See LICENSE.txt for this sample’s licensing information
 
 Abstract:
 
  Camera preview.
  
 */
 
#import "AAPLPreviewView.h"
#import <AVFoundation/AVFoundation.h>
 
@implementation AAPLPreviewView
 
+ (Class)layerClass
{
    return [AVCaptureVideoPreviewLayer class];
}
 
- (AVCaptureSession *)session
{
    return [(AVCaptureVideoPreviewLayer *)[self layer] session];
}
 
- (void)setSession:(AVCaptureSession *)session
{
    [(AVCaptureVideoPreviewLayer *)[self layer] setSession:session];
}
 
@end