VGSShow
public final class VGSShow
An object you use for revealing and displaying data in corresponding subscribed VGS Show SDK views.
-
Returns an Array of
VGSPDFView
objects subscribed to specificVGSShow
instance.Declaration
Swift
@available(iOS 11.0, *) public var subscribedPDFViews: [VGSPDFView] { get }
-
Set your custom HTTP headers.
Declaration
Swift
public var customHeaders: [String : String]? { get set }
-
Initialzation
Declaration
Swift
public init(id: String, environment: String, hostname: String? = nil, satellitePort: Int? = 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 isnil
.satellitePort
Int?
object, custom port for satellite configuration. Default isnil
. IMPORTANT! Use only with .sandbox environment! Hostname should be specified for valid http://localhost (for simulator) or in local IP format http://192.168.X.X (for real device connected to the same local network as Mac). -
Initialzation
Declaration
Swift
public convenience init(id: String, environment: VGSEnvironment = .sandbox, dataRegion: String? = nil, hostname: String? = nil, satellitePort: Int? = 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 isnil
.satellitePort
Int?
object, custom port for satellite configuration. Default isnil
. IMPORTANT! Use only with .sandbox environment! Hostname should be specified for valid http://localhost (for simulator) or in local IP format http://192.168.X.X (for real device connected to the same local network as Mac) .
-
Subscribes VGSShowSDK view to specific
VGSShow
instance.Declaration
Swift
public func subscribe(_ view: VGSViewProtocol)
Parameters
view
VGSViewProtocol
view to register. -
Unsubcribes
VGSViewProtocol
view from specificVGSShow
instance.Declaration
Swift
public func unsubscribe(_ view: VGSViewProtocol)
Parameters
view
VGSViewProtocol
view to unregister. -
Unsubcribes all
VGSViewProtocol
views from specificVGSShow
instance.Declaration
Swift
public func unsubscribeAllViews()
-
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 isnil
. Should be valid JSON. - requestOptions:
VGSShowRequestOptions?
object, additional request options, default isnil
. completion:
VGSResponse
completion block. The completion handler to call when the load request is complete.
Note
Errors can be returned in the
NSURLErrorDomain
andVGSShowSDKErrorDomain
.Declaration
Swift
public func request(path: String, method: VGSHTTPMethod = .post, payload: VGSJSONData? = nil, requestOptions: VGSShowRequestOptions? = nil, completion block: @escaping (VGSShowRequestResult) -> Void)