VGSShow

@MainActor
public final class VGSShow

An object you use for revealing and displaying data in corresponding subscribed VGS Show SDK views.

Get Subscribed Views

Custom HTTP Headers

  • Set your custom HTTP headers.

    Declaration

    Swift

    @MainActor
    public var customHeaders: [String : String]? { get set }

Initialzation

  • Initialzation

    Declaration

    Swift

    @MainActor
    public init(id: String, environment: String, hostname: String? = nil)

    Parameters

    id

    String object, your organization vault id.

    environment

    String object, your organization vault environment with data region.(e.g. “live”, “live-eu1”, “sanbox”).

    hostname

    String object. Custom Hostname, if not set, data will be sent to Vault Url. Default is nil.

  • Initialzation

    Declaration

    Swift

    @MainActor
    public convenience init(id: String, environment: VGSEnvironment = .sandbox, dataRegion: String? = nil, hostname: String? = nil)

    Parameters

    id

    String object, your organization vault id.

    environment

    VGSEnvironment object, your organization vault environment. By default .sandbox.

    dataRegion

    String object, id of data storage region (e.g. “eu-123”).

    hostname

    String object. Custom Hostname, if not set, data will be sent to Vault Url. Default is nil.

Manage Views

API Request

  • Send request to reveal data on specific path. VGSShow instance will use all subsribed elements contentPaths to reveal data.

    • path: Inbound rout path for your organization vault.
    • method: HTTPMethod, default is .post.
    • payload: VGSJSONData? object, default is nil. Should be valid JSON.
    • requestOptions: VGSShowRequestOptions? object, additional request options, default is nil.
    • completion: VGSResponse completion block. The completion handler to call when the load request is complete.

    Note

    Errors can be returned in the NSURLErrorDomain and VGSShowSDKErrorDomain.

    Declaration

    Swift

    @MainActor
    public func request(path: String, method: VGSHTTPMethod = .post, payload: VGSJSONData? = nil, requestOptions: VGSShowRequestOptions? = nil, completion block: @escaping (VGSShowRequestResult) -> Void)