HaircutManager

public class HaircutManager

HaircutManager is used to make all operations with avatar haircuts.

  • Is used to download the haircut files from the server. At the first time for each haircut type the full set of files will be downloaded. Further only neсessary set of files will be downloaded.

    Declaration

    Swift

    public class func downloadHaircut(haircutModel:HaircutModel) -> TaskHandler<HaircutModel>

    Parameters

    haircutModel

    The haircut model for which files should be downloaded.

    Return Value

    Task handler object which can be used for subscription on progress and completion callbacks.

  • Is used to retrieve the list of haircut models from the server.

    Declaration

    Swift

    public class func getHaircuts(forAvatar avatarModel: AvatarModel, completion: @escaping CompletionHandler<[HaircutModel]>)

    Parameters

    avatarModel

    The avatar model for which the list of haircuts should be downloaded.

    completion

    Closure to be executed once the request has finished.

  • Is used to build HaircutModel from the server response.

    Declaration

    Swift

    public class func buildHaircut(fromResponse response:ResponseAvatarHaircutModel) -> HaircutModel

    Parameters

    response

    The haircut server information.

    Return Value

    The haircut model.