SCCameraKitLensRepositoryGroupObserver

Objective-C

@protocol SCCameraKitLensRepositoryGroupObserver <NSObject>

Swift

protocol LensRepositoryGroupObserver : NSObjectProtocol

Allows conformers to be notified of changes to lens groups the repository has available.

  • Notifies that an observed group’s lenses have changed.

    Note

    observers may receive notifications for lens groups they do not care about. Check groupID.

    Declaration

    Objective-C

    - (void)repository:(nonnull id<SCCameraKitLensRepository>)repository
        didUpdateLenses:(nonnull NSArray<id<SCCameraKitLens>> *)lenses
             forGroupID:(nonnull NSString *)groupID;

    Parameters

    repository

    the CameraKit lens repository responsible for the update.

    lenses

    the updated lenses in the group.

    groupID

    the updated group ID.

  • Notifies that an observed group’s lenses failed to be fetched.

    Declaration

    Objective-C

    - (void)repository:(nonnull id<SCCameraKitLensRepository>)repository
        didFailToUpdateLensesForGroupID:(nonnull NSString *)groupID
                                  error:(nullable NSError *)error;

    Parameters

    repository

    the CameraKit lens repository responsible for the update.

    groupID

    the updated group ID.

    error

    a detailed error message of what went wrong, if available.