SCCameraKitLensPrefetcher
Objective-C
@protocol SCCameraKitLensPrefetcher <NSObject>
Swift
protocol LensPrefetcher : NSObjectProtocol
Describes the interface used to prefetch lens content
-
Queues up a new fetch task for each of the
lensesin order to prefetch their content. A successful callback indiciates that all the content for the list oflensesis ready to be used/applied in lens processorDeclaration
Objective-C
- (nonnull id<SCCameraKitLensPrefetcherTask>) prefetchLenses:(nonnull NSArray<id<SCCameraKitLens>> *)lenses completion:(nullable void (^)(BOOL))completion;Swift
func prefetch(lenses: [any SCCameraKitLens], completion: ((Bool) -> Void)? = nil) -> any LensPrefetcherTaskParameters
lenseslenses to prefetch content for
completioncallback on completion with success or failure
-
Add observer to observe changes in lens fetch status
Declaration
Objective-C
- (void)addStatusObserver: (nonnull id<SCCameraKitLensPrefetcherObserver>)observer forLens:(nonnull id<SCCameraKitLens>)lens;Swift
func addStatusObserver(_ observer: any LensPrefetcherObserver, lens: any SCCameraKitLens)Parameters
observerobserver instance which will receive updates
lenslens to observe
-
Remove observer to stop observing changes in lens fetch status
Declaration
Objective-C
- (void)removeStatusObserver: (nonnull id<SCCameraKitLensPrefetcherObserver>)observer forLens:(nonnull id<SCCameraKitLens>)lens;Swift
func removeStatusObserver(_ observer: any LensPrefetcherObserver, lens: any SCCameraKitLens)Parameters
observerobserver instance which will stop receiving updates
lenslens to stop observing