HCLManager

Declaration

Swift

 

 

public class HCLManager : NSObject, HCLSDKConfigure

extension HCLManager: HCLManagerProtocol

 

Overview

This class represents a search screen manager object, providing methods to customize search screens and manage access to the SDK.

Example

Swift

 

 

let manager = HCLManager.share

manager.initialize(apiKey: <YOUR_API_KEY>,

                   configure: <SEARCH_CONFIGURATION_BASE_ON_YOUR_BUSINESS>,

                   theme: <FONT_AND_COLOR_CUSTOMIZATION>,

                   icons: <ICONS_CUSTOMIZATION>,

                   handler: <CALLBACK_TO_HANDLE_INITILAZATION_RESULT>)

let searchHCPVC = manager.getWebServices()

 

Discussion

The user interface could be configured through settings of theme and icons while initializing the HCLManager instance.

APIs must be accessed through HCLManager instance after initialization with API key.

Availability

HealthCare Locator 1.0 and higher

Methods

         configure

         initialize

         getDefaultSearchConfigure

         getDefaultUIConfigure

         getHCPSearchViewController

         getWebServices

         searchNearMe

         set user ID

         set app name and download

         setLocale

configure

Customize configuration for inputting criteria on search screens.

Declaration

Swift

 

 

public func configure(search: HCLSearchConfigure?)

 

Parameter

search

Customize searching by providing your own values.

Availability

HealthCare Locator 1.0 and higher

initialize

Initialize search screens with the SDK.

Declaration

Swift

 

 

public func initialize(apiKey: String,

                       configure: HCLSearchConfigure? = nil,

                       theme: HCLThemeConfigure? = nil,

                       icons: HCLIconsConfigure? = nil,

                       handler: ((Bool, Error?) -> Void)? = nil)

 

Parameters

apiKey

The API key provided with your subscription during signup.

configure

Search to configure.

theme

Theme to configure.

icons

Icons to configure.

handler

Handler to configure.

Discussion

The API key must be set before using the search features or it will raise an exception at run time.

Availability

HealthCare Locator 1.0 and higher

getDefaultSearchConfigure

Get default configuration for inputting criteria on search screens if configuration is not set.

Declaration

Swift

 

 

public func getDefaultSearchConfigure() -> HCLSearchConfigure

 

Return

An object of the HCLSearchConfigure type.

Availability

HealthCare Locator 1.0 and higher

getDefaultUIConfigure

Get default UI configuration for displaying search screens.

Declaration

Swift

 

 

public func getDefaultUIConfigure() -> HCLThemeConfigure

 

Return

An object of the HCLThemeConfigure type.

Availability

HealthCare Locator 1.0 and higher

getHCPSearchViewController

Get the root instance of search screens.

Declaration

Swift

 

 

public func getHCPSearchViewController() -> HCLHCPSearchNavigationViewController

 

Return

An object of the HCLHCPSearchNavigationViewController type.

Availability

HealthCare Locator 1.0 and higher

getWebServices

If you want to build your own search screen UI, then get the instance for calling APIs directly without attaching the default search screen UI. Initialization must be completed before using the web services. For example:

HCLManager.share.initialize(apiKey: <YOUR_API_KEY>, handler: {[unowned manager = HCLManager.share] success in if success { let webService = manager.getWebServices() } })

Declaration

Swift

 

 

public func getWebServices() -> HCLHCPSearchWebServices

 

Return

An object of the HCLHCPSearchWebServices type.

Availability

HealthCare Locator 1.0 and higher

searchNearMe

Start a new search quickly after attaching search navigation into your app’s search screen UI.

Declaration

Swift

 

 

@discardableResult

public func searchNearMe(specialities: [String]) -> Bool

 

Parameter

specialities

The list of HCP specialities for a search.

Return

A boolean value to indicate if the action is successful or not.

Discussion

There might be times (depending on your business needs) you want to display a search quickly using your own UI components, such as menus or buttons.

The result might fail if the root search navigation is not attached to your screen.

Availability

HealthCare Locator 1.0 and higher

set

Specifies the user ID that is required to store a user’s search history.

Declaration

Swift

 

 

public func set(userId: String)

 

Parameter

userID

A unique ID that identifies a user.

Availability

HealthCare Locator 1.0 and higher

set

Specifies the name and download link of your app.

Declaration

Swift

 

 

public func set(appName: String, appDownloadLink: String?)

 

Parameters

appName

Name of your app to search/interact with the Activity API.

appDownloadLink

URL to download SDK for iOS.

Availability

HealthCare Locator 1.0 and higher

setLocale

Changes displayed language for SDK.

Declaration

Swift

 

 

public func setLocale(language: HCLLanguage)

 

Parameter

lang

Language code.

Discussion

By default, the SDK will use device language. If device language is not in supported range, then language will fall back to English.

The language code must be a supported language, such as English:

en

Availability

HealthCare Locator 1.0 and higher