HKServices

@objc
public class HKServices : NSObject

The BioDigital Human backend services

  • Set the delegate for access to the callback functions

    Declaration

    Swift

    @objc
    public weak var delegate: HKServicesDelegate?
  • Modules fetched from the BioDigital servers are stored here Providing a secret to the init function will trigger a fetch of modules associated with your account, the modulesLoaded callback will alert you when the module array is ready

    Declaration

    Swift

    @objc
    public var models: [HKModel]
  • Initialize the backend in your AppDelegate

    Declaration

    Swift

    @objc
    public init(validateKey: String, secret: String = "")

    Parameters

    validateKey

    your API key, generated at http://developer.biodigital.com

    secret

    your secret, also generated. provide this optional variable to allow access to content associated with your account

  • Request models associated with your account from our server

    Declaration

    Swift

    @objc
    public func getModels()
  • Get a list of Module 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 Module objects, empty if none are found

  • Returns true if a module is on disk and available for offline use

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    @objc
    public static func getJsonData(forModule: 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 Module 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 Module objects, empty if none are found

  • Returns true if a module is on disk and available for offline use

    Declaration

    Swift

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