SCCameraKitPreviewView
@interface SCCameraKitPreviewView : UIView
A UIView which is capable of rendering SCCameraKitTextures. You should add this as an output for your CameraKit instance.
-
Configures the neccessary gesture recognizers for handling touch input in lenses. If set to YES, will automatically add gesture reconizers and configure them to pass events to lenses.
Note
by default, this is NO. You may change this to YES while cameraKit is running, and it will be configured on the next frame.Declaration
Objective-C
@property (nonatomic) BOOL automaticallyConfiguresTouchHandler;
-
Configures the viewport upon changes to the view’s frame. If set to YES, this will automatically adjust
viewportSize
,outputResolution
, andsafeArea
according to the view’s frame.Note
By default, this is YES. If the viewport is explicitly defined via explicitViewportProvider, this will be set to NO.Note
If you change this property without setting explicitViewportProvider, the view will keep the last derivedviewportSize
,outputResolution
, andsafeArea
.Warning
If there is a mismatch betweenviewportSize
and the view’s frame size, part of the lens may be cut off on the screen.Declaration
Objective-C
@property (nonatomic) BOOL automaticallyConfiguresViewport;
-
Configures the safe area to an explicitly specified rect.
Declaration
Objective-C
@property (nonatomic) CGRect safeArea;
-
Setting this property configures the preview view to use its
viewportSize
,outputResolution
, andsafeArea
.Note
Calling this method will setautomaticallyConfiguresViewport
to NO.Warning
If there is a mismatch betweenviewportSize
and the view’s frame size, part of the lens may be cut off the screen.Declaration
Objective-C
@property (nonatomic, strong, nullable) SCCameraKitExplicitViewportProvider *explicitViewportProvider;
-
Automatically configures the safeArea property to avoid the specified views.
Note
the preview view maintain a weak reference to the provided views and update the safe area automatically as needed.Warning
this method will reevaluate periodically (during bounds changes, etc), but will NOT actively track changes to occluding views between those intervals. If you move an occluding view without affecting the preview view, call this method again to reevaluate.Declaration
Objective-C
- (void)configureSafeAreaWithOccludingViews: (nonnull NSArray<UIView *> *)occludingViews;
Parameters
occludingViews
any views that may be displayed in front of lenses content, such as the carousel, camera flip button, etc. If the preview view itself is part of this array, it will be ignored.