HKServices

public class HKServices : NSObject, HKHumanDelegate

The BioDigital Human backend services

  • Models fetched from the BioDigital servers are stored here Providing a secret to the init function will trigger a fetch of models associated with your account, the modelsLoaded callback will alert you when the data is ready

    Declaration

    Swift

    @objc
    public var models: [HKModel]
  • Get the shared Singleton insance of HKServices

    Declaration

    Swift

    @objc
    public static let shared: HKServices
  • Initialize the backend services and authenticate the SDK with an explicit Key and optional Secret

    Declaration

    Swift

    @objc
    public func setup(key: String, secret: String, delegate: HKServicesDelegate? = nil)
  • Initialize the backend services and authenticate the SDK with Key and optional Secret in the Info.plist file

    Declaration

    Swift

    @objc
    public func setup(delegate: HKServicesDelegate? = nil)
  • Request models associated with your account from our server

    Declaration

    Swift

    @objc
    public func getModels()
  • Get a list of Model objects by ICD Number

    Declaration

    Swift

    @objc
    public func findModel(ICD: String)

    Parameters

    ICD

    String version of ICD number

    Return Value

    [HKModel] an array of found Model objects, empty if none are found

  • Download a set of models to the device in the background Calls onModelDownload(modelId:counter:total) as each model is downloaded

    Declaration

    Swift

    @objc
    public func download(modelIds: [String])
  • Declaration

    Swift

    public func human(_ view: HKHuman, modelLoaded: String)
  • Declaration

    Swift

    public func human(_ view: HKHuman, modelLoadError: String)
  • Return a list of modelIDs for data stored on the device

    Declaration

    Swift

    @objc
    public func offlineModels() -> [String]
  • Returns true if a model is on disk and available for offline use

    Declaration

    Swift

    @objc
    public func modelDownloaded(id: String) -> Bool
  • Removes all stored BioDigital Human content from the device

    Declaration

    Swift

    @objc
    public func deleteStoredData() -> Int
  • Set the language, default is HumanLanguage.english valid options are spanish and arabic

    Declaration

    Swift

    @objc
    public func setLanguage(to: HumanLanguage)
  • return true if the language is Unicode (Chinese or Japanese)

    Declaration

    Swift

    @objc
    public func isUnicodeLanguage() -> Bool
  • Returns the json string for a model if it is on disk

    Declaration

    Swift

    @objc
    public func getJsonString(modelId: String) -> String
  • Returns the json string for a model if it is on disk

    Declaration

    Swift

    @objc
    public func getJsonData(modelId: String) -> Data
  • Stops the backend service, this should ONLY be done when your app is going to stop running

    Declaration

    Swift

    @objc
    public func stop()
  • Restarts the backend service, this should ONLY be done when your app is returning to the foreground

    Declaration

    Swift

    @objc
    public func restart()
  • Request models associated with your account from our server

    Declaration

    Swift

    @available(*, renamed: "getModels")
    @objc
    public func getModules()
  • Get a list of HKModel objects by ICD Number

    Declaration

    Swift

    @available(*, renamed: "findModel(ICD:﹚")
    @objc
    public func findModule(ICD: String)

    Parameters

    ICD

    String version of ICD number

    Return Value

    [HKModel] an array of found HKModel objects, empty if none are found

  • Deprecated. Use moduleDownloaded instead Returns true if a model is on disk and available for offline use

    Declaration

    Swift

    @available(*, renamed: "modelDownloaded(Id:﹚")
    @objc
    public func moduleDownloaded(id: String) -> Bool