SCCameraKitLensRepository
Objective-C
@protocol SCCameraKitLensRepository <NSObject>
Swift
protocol LensRepository : NSObjectProtocol
Lens Repository for listing lenses, getting lenses, etc.
-
Add an observer to receive updates to a lens group
Note
you should expect to receive at least one call to the observer after you add it (either success with list of lenses or failure with error)Note
after you add an observer for a lens group you will receive updates for all lenses in that group (ie. you do not have to add an observer for specific lenses in the group)Declaration
Objective-C
- (void)addObserver:(nonnull id<SCCameraKitLensRepositoryGroupObserver>)observer forGroupID:(nonnull NSString *)groupID;Swift
func addObserver(_ observer: any SCCameraKitLensRepositoryGroupObserver, groupID: String)Parameters
observerobserver to receive updates
groupIDid of lens group to observe
-
Remove an observer from receiving updates for a lens group
Declaration
Objective-C
- (void)removeObserver: (nonnull id<SCCameraKitLensRepositoryGroupObserver>)observer forGroupID:(nonnull NSString *)groupID;Swift
func removeObserver(_ observer: any SCCameraKitLensRepositoryGroupObserver, groupID: String)Parameters
observerobserver to remove from receiving updates
groupIDid of lens group to stop observing
-
Add an observer to receive updates for a specific lens in a group
Note
you should expect to receive at least one call to the observer after you add it (either success with lens obj or failure with error)Declaration
Objective-C
- (void)addObserver: (nonnull id<SCCameraKitLensRepositorySpecificObserver>)observer forSpecificLensID:(nonnull NSString *)lensID inGroupID:(nonnull NSString *)groupID;Swift
func addObserver(_ observer: any SCCameraKitLensRepositorySpecificObserver, specificLensID lensID: String, inGroupID groupID: String)Parameters
observerobserver to receive updates
lensIDid of lens to receive updates for
groupIDid of group which lens is in that you want to receive updates for
-
Remove an observer from receiving updates for a specific lens in a group
Declaration
Objective-C
- (void)removeObserver: (nonnull id<SCCameraKitLensRepositorySpecificObserver>)observer forSpecificLensID:(nonnull NSString *)lensID inGroupID:(nonnull NSString *)groupID;Swift
func removeObserver(_ observer: any SCCameraKitLensRepositorySpecificObserver, specificLensID lensID: String, inGroupID groupID: String)Parameters
observerobserver to remove from receiving updates
lensIDid of lens to stop observing
groupIDif of group which lens is in that you want to stop observing
-
Any available lenses for the group ID specified.
Note
this method will not return any lenses until the user has expressed interest in a group by calling beginObservingGroupID:Note
for updates on when the return value of this method changes, add a observer in addObserver:Declaration
Objective-C
- (nonnull NSArray<id<SCCameraKitLens>> *)lensesForGroupID: (nonnull NSString *)groupID;Swift
func lenses(groupID: String) -> [any SCCameraKitLens]Parameters
groupIDthe group ID containing the desired lenses.
-
Specific lens in group ID specified
Note
this method will not return any lenses until the user has expressed interest in a group by calling beginObservingGroupID: or beginObservingLens:inGroup:Note
for updates on when the return value of this method changes, add a observer in addObserver:Declaration
Objective-C
- (nullable id<SCCameraKitLens>)lensWithID:(nonnull NSString *)lensID inGroupID:(nonnull NSString *)groupID;Swift
func lens(id lensID: String, groupID: String) -> (any SCCameraKitLens)?Parameters
lensIDid of lens
groupIDid of group lens is in