Utilities

public enum Utilities

Utility helper methods

  • Configuration key for in Settings or the info.plist for storing the predixSyncURL

    Default: server_url

    Declaration

    Swift

    static public var predixSyncURLConfigKey = "server_url"
  • Retrieves configuration values from info.plist or settings

    Declaration

    Swift

    static public func configValueForKey(_ key: String, location: ConfigurationLocation = .infoplist) -> Any?
  • Returns the location the SDK uses for local file storage.

    Declaration

    Swift

    static public var localStorageURL: URL
  • Returns a dictionary containing version information of the app, the SDK, and dependent components, as well as some basic environmental information for the current device.

    Declaration

    Swift

    static public var systemInfo: [String: String]
  • Provides a short string of version information the PredixSDK, and some of its dependent components. For more in-depth system information see the systemInfo method

    Declaration

    Swift

    static public var versionInfo: String
  • Initialized using value stored in Settings under the predixSyncURLConfigKey key.

    See also retreivePredixSyncURLFromConfig

    Declaration

    Swift

    static public var predixSyncURL: URL? = retreivePredixSyncURLFromConfig()
  • Helper method to retrieve the value for the provided ConfigurationLocation for the predixSyncURLConfigKey, and build a URL.

    If no URL scheme is included in the configuration setting, https:// will be used.

    Declaration

    Swift

    static public func retreivePredixSyncURLFromConfig(location: ConfigurationLocation = ConfigurationLocation.settings) -> URL?

    Parameters

    location

    optional ConfigurationLocation from which to retreive the URL. Defaults to ConfigurationLocation.settings