AvatarManager
public class AvatarManager
AvatarManagerCloud is used to handle all operations with avatars in cloud version of SDK.
-
Is used to create avatar on the server.
Declaration
Swift
public class func createAvatar(fromImage image: ImageFrame, name: String = "Default", description: String = "", parameters: PipelineParameters) -> TaskHandler<AvatarModel>Parameters
imageImage frame which will be used for the avatar generation.
nameName for this avatar.
descriptionDescription for this avatar.
parametersParameters for this avatar.
exportParametersExportParameters for this avatar.
Return Value
Task handler object which can be used for subscription on progress and completion callbacks.
-
Is used to retrieve paginated list of available avatar models for current user sorted by date.
Declaration
Swift
public class func getAvatars(useCache: CacheType = .fromServerIfCacheIsEmpty, beforeDate date: Date? = nil, completion: @escaping CompletionHandler<[AvatarModel]>)Parameters
useCacheDefines where a list of avatar models will be downloaded from.
beforeDateAvatars in the next retrieved part will start from the specified date. If not specified, the first part of avatars will be retrived.
completionClosure to be executed once the request has finished.
-
Is used to retrieve the
AvatarModelfrom the server.Declaration
Swift
public class func getAvatar(code: String, completion: @escaping CompletionHandler<AvatarModel>)Parameters
codeThe avatar model ID for which the server information should be downloaded.
completionClosure to be executed once the request has finished.
-
Is used to download the avatar files from the server.
Declaration
Swift
public class func downloadAvatar(avatarModel: AvatarModel) -> TaskHandler<AvatarModel>Parameters
avatarModelThe avatar model which files should be downloaded.
Return Value
Task handler object which can be used for subscription on progress and completion callbacks.
-
Is used to delete avatar from the server. If this avatar was downloaded on this device than it will be also deleted from the device.
Declaration
Swift
public class func deleteAvatar(avatarModel: AvatarModel, completion: @escaping CompletionHandler<Bool>)Parameters
avatarModelThe avatar model that should be deleted.
completionClosure to be executed once the request has finished.
-
Is used to build
AvatarModelfrom the server response.Declaration
Swift
public class func buildAvatar(fromResponse response: ResponseAvatarModel) -> AvatarModelParameters
responseInformation about avatar received from server.
Return Value
The avatar model.
AvatarManager Class Reference