SnapscreenSnapper

@interface SnapscreenSnapper : NSObject

SnapscreenSnapper offers a direct API for getting snap and quadrangle results. This offers the ability to build more immersive experiences with custom UIs while still providing snap functionality.

  • The snap configuration to use when performing snaps or quadrangle detection. Needs to be set before subsequent calls.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        SnapscreenSnapConfiguration *snapConfiguration;

    Swift

    var snapConfiguration: SnapscreenSnapConfiguration? { get set }
  • The delegate of the snapper. Should be nil when you are no longer interested in snap results (e.g. after a successful snap)

    Declaration

    Objective-C

    @property (atomic, weak, readwrite, nullable) id<SnapscreenSnapperDelegate>
        delegate;

    Swift

    weak var delegate: SnapscreenSnapperDelegate? { get set }
  • Performs a snap on the provided CVPixelBuffer. If passing a CVPixelBuffer from ARKit, make sure to also pass the timestamp of the ARFrame.

    Declaration

    Objective-C

    - (void)performSnapForPixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer
                            timestamp:(NSTimeInterval)timestamp;

    Swift

    func performSnap(for pixelBuffer: CVPixelBuffer, timestamp: TimeInterval)

    Parameters

    pixelBuffer

    a CVPixelBuffer, most likely to be used for snapping the content of ARFrame.captureImage

    timestamp

    the timestamp of the provided pixel buffer, most likely to be used by passing ARFrame.timestamp

  • Declaration

    Objective-C

    - (void)detectQuadrangleForPixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer
                                 timestamp:(NSTimeInterval)timestamp;

    Swift

    func detectQuadrangle(for pixelBuffer: CVPixelBuffer, timestamp: TimeInterval)