### Install the skill with skills.sh Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/README.md Command to add the VGSShow iOS guide skill to an AI agent. ```bash npx skills add https://github.com/verygoodsecurity/vgs-show-ios --skill vgs-show-ios-guide ``` -------------------------------- ### Show SDK Initialization Examples Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Examples demonstrating how to initialize the VGSShow object with different environment and hostname configurations. ```swift let show = VGSShow(id: sandboxVaultId, environment: .sandbox) let showRegional = VGSShow(id: sandboxVaultId, environment: .sandbox, dataRegion: "eu-123") let liveShow = VGSShow(id: liveVaultId, environment: .live, hostname: "reveal.example.com") ``` -------------------------------- ### Minimal System Prompt Example Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/README.md Example system prompt for an AI agent integrating the VGS Show iOS SDK. ```text You are an autonomous engineering agent integrating the VGS Show iOS SDK into an existing Swift app. Use skills/vgs-show-ios-guide/references/AGENTS.md as the authoritative policy. Constraints: - Only public, non-deprecated APIs. - No raw sensitive data in logs/tests. - All subscribed views must have non-empty contentPath values before requests. - Secure masking applied before user-visible refresh when required. Goals: 1. Add a screen revealing a user's details (card label, name label) using a single batched request. 2. Implement partial masking for the card. 3. Provide unit tests for missing path. Return: Modified Swift source files only, no secrets. ``` -------------------------------- ### Developer Prompt (Inline Example for a Single Task) Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/README.md Example developer prompt for a single task related to secure display of account number. ```text Task: Add secure display of account number with custom last-4 masking while preserving transformation regex formatting. Follow skills/vgs-show-ios-guide/references/AGENTS.md. Do not log raw account number; add tests for masking and a negative near-miss path key. ``` -------------------------------- ### VGSShow Instance and View Setup Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/index.html This snippet shows how to initialize a VGSShow instance and configure VGSLabel views for displaying card data. It includes setting content paths, subscribing views to the VGSShow instance, and basic UI configuration. ```swift /// VGSShow instance. let vgsShow = VGSShow(id: "", environment: .sandbox) /// VGSShow views. let cardNumberLabel = VGSLabel() let expDateLabel = VGSLabel() override func viewDidLoad() { super.viewDidLoad() /// ... // Setup content path in reveal response cardNumberLabel.contentPath = "cardData.cardNumber" expDateLabel.contentPath = "cardData.expDate" // Register VGSShow views in vgsShow instance. vgsShow.subscribe(cardNumberLabel) vgsShow.subscribe(expDateLabel) // Configure UI. configureUI() /// ... } // Configure VGS Show UI Elements. private func configureUI() { let paddings = UIEdgeInsets.init(top: 8, left: 8, bottom: 8, right: 8) let textColor = UIColor.white let borderColor = UIColor.clear let font = UIFont.systemFont(ofSize: 20) let backgroundColor = UIColor.systemBlue let cornerRadius: CGFloat = 0 cardNumberLabel.textColor = textColor cardNumberLabel.paddings = paddings cardNumberLabel.borderColor = borderColor cardNumberLabel.font = font cardNumberLabel.backgroundColor = backgroundColor cardNumberLabel.layer.cornerRadius = cornerRadius expDateLabel.textColor = textColor expDateLabel.paddings = paddings expDateLabel.borderColor = borderColor expDateLabel.font = font expDateLabel.backgroundColor = backgroundColor expDateLabel.layer.cornerRadius = cornerRadius expDateLabel.characterSpacing = 0.83 } ``` -------------------------------- ### start Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSTextRange.html Range start index. ```swift public let start: Int? ``` -------------------------------- ### Making a Reveal Request Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Example of how to make a reveal request using the VGSShow SDK, including handling success and failure callbacks. ```swift show.request( path: "/reveal", method: .post, payload: ["reveal": ["user.name", "user.avatar_base64"]], requestOptions: { var opt = VGSShowRequestOptions() opt.requestTimeoutInterval = 15 return opt }() ) { result in switch result { case .success(let status): // Views already updated print("Reveal success status=\(status)") case .failure(let status, let error): handleRevealFailure(status: status, error: error) } } ``` -------------------------------- ### Add to your Podfile Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/README.md Add the VGSShowSDK dependency to your Podfile and run 'pod install'. Pinning the exact version is recommended for reproducibility. ```ruby pod 'VGSShowSDK', '1.3.0' ``` -------------------------------- ### GET Method Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSHTTPMethod.html Represents the GET HTTP method. ```swift case get = "GET" ``` -------------------------------- ### SPM Version Pinning Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Example of pinning a specific SDK version using Swift Package Manager. ```swift .package(url: "https://github.com/verygoodsecurity/vgs-show-ios", exact: "1.3.0") ``` -------------------------------- ### setSecureText with start and end parameters Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Sets a specific text range to be replaced with the secure text symbol. The range is defined by start and end integer indices. ```swift @MainActor public func setSecureText(start: Int? = nil, end: Int? = nil) ``` -------------------------------- ### Set Secure Text Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Sets secure text with start and end indices. ```Swift @MainActor public func setSecureText(start: Int?, end: Int?) ``` -------------------------------- ### Create VGSShow instance and UI Elements Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/README.md Initialize VGSShow instance and VGSLabel UI elements, set content paths, subscribe views, and configure appearance. ```swift /// VGSShow instance configured for sandbox. let vgsShow = VGSShow(id: "", environment: .sandbox) /// Labels for card data. private let cardNumberLabel = VGSLabel() private let expDateLabel = VGSLabel() override func viewDidLoad() { super.viewDidLoad() // Set content paths (JSON keys expected in reveal response). cardNumberLabel.contentPath = "cardData.cardNumber" expDateLabel.contentPath = "cardData.expDate" // Subscribe views. vgsShow.subscribe(cardNumberLabel) vgsShow.subscribe(expDateLabel) // Configure appearance. configureUI() } private func configureUI() { let paddings = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8) let font = UIFont.systemFont(ofSize: 20) let bg = UIColor.systemBlue [cardNumberLabel, expDateLabel].forEach { label in label.paddings = paddings label.font = font label.textColor = .white label.backgroundColor = bg label.layer.cornerRadius = 0 } expDateLabel.characterSpacing = 0.83 } ``` -------------------------------- ### Initialize Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Initialize VGSShow with vault ID and environment. ```swift let show = VGSShow(id: vaultId, environment: .sandbox) ``` -------------------------------- ### VGSShow Initializer (ID, Environment, Hostname) Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSShow.html Initializes VGSShow with vault ID, environment, and an optional hostname. ```swift @MainActor public init(id: String, environment: String, hostname: String? = nil) ``` -------------------------------- ### Create VGSShow Instance Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/docsets/VGSShowSDK.docset/Contents/Resources/Documents/index.html Initialize VGSShow instance using your vault ID. ```swift Use your to initialize VGSShow instance. You can get it in your [organisation dashboard](https://dashboard.verygoodsecurity.com/). ``` -------------------------------- ### Custom HTTP Headers Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSShow.html Set your custom HTTP headers. ```swift @MainActor public var customHeaders: [String : String]? { get set } ``` -------------------------------- ### Initialization Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSPlaceholderLabelStyle.html Initializes a new VGSPlaceholderLabelStyle object. ```swift public init() ``` -------------------------------- ### VGSShow Initializer (ID, Environment, Data Region, Hostname) Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSShow.html Initializes VGSShow with vault ID, environment, data region, and an optional hostname. ```swift @MainActor public convenience init(id: String, environment: VGSEnvironment = .sandbox, dataRegion: String? = nil, hostname: String? = nil) ``` -------------------------------- ### Live Environment Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSEnvironment.html The live environment should be used for production. ```swift case live ``` -------------------------------- ### Initialize VGSShow Instance Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/index.html Initialize VGSShow instance using your vault ID obtained from the VGS Dashboard. ```swift let vgsShow = VGSShow(vaultID: "") ``` -------------------------------- ### Import SDK Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/README.md Import the VGSShowSDK into your Swift project. ```swift import VGSShowSDK ``` -------------------------------- ### Sandbox Environment Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSEnvironment.html The sandbox environment should be used for development and testing purposes. ```swift case sandbox ``` -------------------------------- ### POST Method Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSHTTPMethod.html Represents the POST HTTP method. ```swift case post = "POST" ``` -------------------------------- ### info Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSLogLevel.html Log _all_ events including errors and warnings. ```Swift case info ``` -------------------------------- ### Is Empty Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Indicates whether VGSLabel string is empty. ```Swift @MainActor public var isEmpty: Bool { get } ``` -------------------------------- ### numberOfLines Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSPlaceholderLabelStyle.html Number of lines, default is 1. ```swift public var numberOfLines: Int ``` -------------------------------- ### end Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSTextRange.html Range end index. ```swift public let end: Int? ``` -------------------------------- ### Initialization Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSTextRange.html Initializes a VGSTextRange object. ```swift public init(start: Int? = nil, end: Int? = nil) ``` -------------------------------- ### Logging configuration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLogger.html Logging configuration. Check VGSLoggingConfiguration for logging options. ```Swift public var configuration: VGSLoggingConfiguration ``` -------------------------------- ### font Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSPlaceholderLabelStyle.html Font. ```swift public var font: UIFont? ``` -------------------------------- ### Subscribe & Reveal Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Subscribe a label to a content path and request a reveal. ```swift let label = VGSLabel(); label.contentPath = "user.email"; show.subscribe(label) show.request(path: "/reveal") { _ in } ``` -------------------------------- ### PDF Reveal Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Subscribe a PDF view to a content path for PDF reveal. ```swift let pdfView = VGSPDFView(); pdfView.contentPath = "docs.statement"; show.subscribe(pdfView) ``` -------------------------------- ### Copy Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Copy revealed text to clipboard. ```swift label.copyTextToClipboard(format: .transformed) ``` -------------------------------- ### Image Reveal Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Subscribe an image view to a content path for image reveal. ```swift let avatar = VGSImageView(); avatar.contentPath = "user.avatar"; show.subscribe(avatar) ``` -------------------------------- ### contentPath Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols/VGSViewProtocol.html Decoding content path. ```swift @MainActor var contentPath: String! { get set } ``` -------------------------------- ### Placeholder Style Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Styles for the placeholder text. ```Swift @MainActor public var placeholderStyle: VGSPlaceholderLabelStyle { get set } ``` -------------------------------- ### Shared instance Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLogger.html Shared instance. ```Swift public static var shared: VGSLogger ``` -------------------------------- ### Add Transformation Regex Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Adds a transformation regex to format raw revealed text. ```Swift @MainActor public func addTransformationRegex(_ regex: NSRegularExpression, template: String) ``` -------------------------------- ### Line Break Mode Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSPlaceholderLabelStyle.html The line break mode for the placeholder label. ```swift public var lineBreakMode: NSLineBreakMode? ``` -------------------------------- ### Placeholder Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Placeholder text for the label. ```Swift @MainActor public var placeholder: String? { get set } ``` -------------------------------- ### PATCH Method Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSHTTPMethod.html Represents the PATCH HTTP method. ```swift case patch = "PATCH" ``` -------------------------------- ### textAlignment Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSPlaceholderLabelStyle.html Text alignment. ```swift public var textAlignment: NSTextAlignment? ``` -------------------------------- ### textMinLineHeight Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSPlaceholderLabelStyle.html Minimum text line height. Default is 0. ```swift public var textMinLineHeight: CGFloat ``` -------------------------------- ### Logger Configuration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Configures the VGSLogger level and network/extensive debug settings. ```swift VGSLogger.shared.configuration.level = .warning // .none in production VGSLogger.shared.configuration.isNetworkDebugEnabled = false VGSLogger.shared.configuration.isExtensiveDebugEnabled = false ``` -------------------------------- ### none Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSLogLevel.html Log _no_ events. ```Swift case none ``` -------------------------------- ### Swift Package Manager - Package.swift Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/README.md Specify the VGSShowSDK dependency in your Package.swift file with an exact version pin. ```swift // ...existing code... dependencies: [ .package(url: "https://github.com/verygoodsecurity/vgs-show-ios", exact: "1.3.0") ] // ...existing code... ``` -------------------------------- ### PUT Method Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSHTTPMethod.html Represents the PUT HTTP method. ```swift case put = "PUT" ``` -------------------------------- ### Subscribe View Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSShow.html Subscribes a VGSViewProtocol view to a VGSShow instance. ```swift @MainActor public func subscribe(_ view: VGSViewProtocol) ``` -------------------------------- ### DELETE Method Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSHTTPMethod.html Represents the DELETE HTTP method. ```swift case delete = "DELETE" ``` -------------------------------- ### Make Reveal Data Request Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/index.html This function demonstrates how to make a reveal request to VGS proxy to change aliases to real data. It shows how to set custom headers, include additional payload data, and handle the success or failure of the request. ```swift func revealData() { /// set custom headers vgsShow.customHeaders = [ "custom-header": "custom data" ] /// send any additional data to your backend let customPayload = ["CustomKey" : "CustomValue"]() /// make a reveal request vgsShow.request(path: "post", method: .post, payload: customPayload) { (requestResult) in switch requestResult { case .success(let code): self.copyCardNumberButton.isEnabled = true print("vgsshow success, code: \(code)") case .failure(let code, let error): print("vgsshow failed, code: \(code), error: \(error)") } } } ``` -------------------------------- ### Display As Book Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSPDFView.html A Boolean value determines whether the view will display the first page as a book cover (meaningful only when the document is in two-up or two-up continuous display mode). ```Swift @MainActor public var displayAsBook: Bool { get set } ``` -------------------------------- ### VGSImageViewDelegate Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols.html Delegate methods produced by VGSImageView. ```swift @objc @MainActor public protocol VGSImageViewDelegate ``` -------------------------------- ### Subscribed Labels Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSShow.html Returns an Array of VGSLabel objects subscribed to specific VGSShow instance. ```swift @MainActor public var subscribedLabels: [VGSLabel] { get } ``` -------------------------------- ### VGSPlaceholderLabelStyle Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs.html Holds placeholder styles. ```swift public struct VGSPlaceholderLabelStyle ``` -------------------------------- ### Unsubscribe Cleanup Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Unsubscribe all views from VGSShow. ```swift show.unsubscribeAllViews() ``` -------------------------------- ### imageView(_:didFailWithError:) Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols/VGSImageViewDelegate.html Tells the delegate when image view encounters an error. ```swift @objc @MainActor optional func imageView(_ imageView: VGSImageView, didFailWithError error: VGSShowError) ``` -------------------------------- ### CocoaPods Integration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/index.html Integrate VGSShowSDK into your Xcode project using CocoaPods by specifying it in your Podfile. ```ruby pod 'VGSShowSDK' ``` -------------------------------- ### color Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSPlaceholderLabelStyle.html Color. Default is gray with 70% opacity. ```swift public var color: UIColor ``` -------------------------------- ### Subscribed PDF Views Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSShow.html Returns an Array of VGSPDFView objects subscribed to specific VGSShow instance. ```swift @available(iOS 11.0, *) @MainActor public var subscribedPDFViews: [VGSPDFView] { get } ``` -------------------------------- ### Reveal Request Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/README.md Perform a reveal request to fetch and display sensitive data, handling success and failure cases. ```swift func revealData() { // Custom non-sensitive headers. vgsShow.customHeaders = [ "X-USER-ID": UUID().uuidString ] // Additional payload keys as required by your backend contract. let customPayload = [ "reveal": ["cardData.cardNumber", "cardData.expDate"] ] vgsShow.request(path: "/reveal", method: .post, payload: customPayload) { result in switch result { case .success(let statusCode): // Views already updated. print("Reveal success status=\(statusCode)") case .failure(let statusCode, let error): // Map error to safe user message (do not expose internals). let message = userMessage(for: error) print("Reveal failed status=\(statusCode), userMessage=\(message)") } } } private func userMessage(for error: Error?) -> String { guard let e = error as? VGSShowError, let type = e.type else { return "Reveal failed" } switch type { case .fieldNotFound: return "Requested data unavailable" case .invalidImageData, .invalidPDFData: return "Cannot display document" case .invalidBase64Data: return "Corrupted data" default: return "Reveal failed" } } ``` -------------------------------- ### Swift Package Manager - Xcode Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/README.md Add the VGSShowSDK package to your Xcode project via File > Add Packages… by providing the repository URL and specifying the exact version. ```swift https://github.com/verygoodsecurity/vgs-show-ios ``` -------------------------------- ### VGS Accessibility Hint Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html A localized string that contains a brief description of the result of performing an action on the accessibility element. ```Swift @MainActor public var vgsAccessibilityHint: String? { get set } ``` -------------------------------- ### VGSShow Request Method Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSShow.html Declaration of the `request` method for sending API requests with VGSShow. ```Swift @MainActor public func request(path: String, method: VGSHTTPMethod = .post, payload: VGSJSONData? = nil, requestOptions: VGSShowRequestOptions? = nil, completion block: @escaping (VGSShowRequestResult) -> Void) ``` -------------------------------- ### Copy Text to Clipboard Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Copies text to the pasteboard with a specified format. ```Swift @MainActor public func copyTextToClipboard(format: CopyTextFormat = .raw) ``` -------------------------------- ### Log Level Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSLoggingConfiguration.html Declaration for the log level property. ```swift public var level: VGSLogLevel ``` -------------------------------- ### Extensive Debug Enabled Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSLoggingConfiguration.html Declaration for the isExtensiveDebugEnabled property. ```swift public var isExtensiveDebugEnabled: Bool ``` -------------------------------- ### VGSShow Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes.html Declaration for the VGSShow class. ```Swift @MainActor public final class VGSShow ``` -------------------------------- ### VGSPDFViewDelegate Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols.html Delegate methods produced by VGSPDFView. ```swift @available(iOS 11.0, *) @objc @MainActor public protocol VGSPDFViewDelegate ``` -------------------------------- ### VGSViewProtocol Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols.html Protocol describing VGS View. ```swift @MainActor public protocol VGSViewProtocol : UIView ``` -------------------------------- ### VGSImageView Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes.html Declaration for the VGSImageView class. ```Swift @MainActor public final class VGSImageView : UIView, VGSImageViewProtocol ``` -------------------------------- ### User Message Mapping for Errors Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Maps VGSShowError types to user-friendly messages. ```swift func userMessage(for error: Error?) -> String { guard let e = error as? VGSShowError else { return "Reveal failed" } switch e.type! { case .fieldNotFound: return "Requested data unavailable" case .invalidPDFData, .invalidImageData: return "Cannot display document" case .invalidBase64Data: return "Corrupted data" default: return "Reveal failed" } } ``` -------------------------------- ### pdfView(_:didFailWithError:) Method Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols/VGSPDFViewDelegate.html Tells the delegate when pdf view encounters an error. ```swift @objc @MainActor optional func pdfView(_ pdfView: VGSPDFView, didFailWithError error: VGSShowError) ``` -------------------------------- ### warning Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSLogLevel.html Log _only_ events indicating warnings and errors. ```Swift case warning ``` -------------------------------- ### Timeout Option Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Set a custom request timeout interval. ```swift var opt = VGSShowRequestOptions(); opt.requestTimeoutInterval = 10 show.request(path: "/reveal", requestOptions: opt) { _ in } ``` -------------------------------- ### Is Secure Text Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Flag to apply secure mask. If true, masks all text if secure range is not defined. Default is false. ```Swift @MainActor public var isSecureText: Bool { get set } ``` -------------------------------- ### adjustsFontForContentSizeCategory Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSPlaceholderLabelStyle.html Indicates whether placeholder should automatically update its font when the device’s UIContentSizeCategory is changed. It only works automatically with dynamic fonts ```swift public var adjustsFontForContentSizeCategory: Bool ``` -------------------------------- ### Unsubscribe All Views Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSShow.html Unsubscribes all VGSViewProtocol views from a VGSShow instance. ```swift @MainActor public func unsubscribeAllViews() ``` -------------------------------- ### VGSLabel Paddings Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html UIEdgeInsets for text. Paddings should be non-negative. ```Swift @MainActor public var paddings: UIEdgeInsets { get set } ``` -------------------------------- ### Swift Package Manager Integration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/index.html Add VGSShowSDK as a dependency using Swift Package Manager for Xcode 12+. ```swift dependencies: [ .package(url: "https://github.com/verygoodsecurity/vgs-show-ios", .upToNextMajor(from: "1.0.0")) ] ``` -------------------------------- ### VGSLabel Placeholder Paddings Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html UIEdgeInsets for placeholder. Default is nil. If placeholder paddings not set, 'paddings' property will be used to control placeholder insets. Paddings should be non-negative. ```Swift @MainActor public var placeholderPaddings: UIEdgeInsets? { get set } ``` -------------------------------- ### documentDidChange Method Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols/VGSPDFViewDelegate.html Tells the delegate the document was displayed in view. ```swift @objc @MainActor optional func documentDidChange(in pdfView: VGSPDFView) ``` -------------------------------- ### VGSPDFView Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes.html Declaration for the VGSPDFView class. ```Swift @available(iOS 11.0, *) @MainActor public final class VGSPDFView : UIView, VGSShowPdfViewProtocol ``` -------------------------------- ### Image Content Mode Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSImageView.html Image content mode property declaration. ```swift @MainActor public var imageContentMode: UIView.ContentMode { get set } ``` -------------------------------- ### PDF Display Mode Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSPDFView.html PDF display mode, default is `.singlePageContinuous`. ```Swift @MainActor public var pdfDisplayMode: PDFDisplayMode { get set } ``` -------------------------------- ### VGSLoggingConfiguration Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSLoggingConfiguration.html Declaration of the VGSLoggingConfiguration struct. ```swift public struct VGSLoggingConfiguration ``` -------------------------------- ### VGSShowRequestOptions Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSShowRequestOptions.html Declaration of the VGSShowRequestOptions struct. ```swift public struct VGSShowRequestOptions ``` -------------------------------- ### Network Debug Enabled Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSLoggingConfiguration.html Declaration for the isNetworkDebugEnabled property. ```swift public var isNetworkDebugEnabled: Bool ``` -------------------------------- ### Has Image Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSImageView.html Boolean value indicating if the view has an image. ```swift @MainActor public var hasImage: Bool { get } ``` -------------------------------- ### characterSpacing Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSPlaceholderLabelStyle.html Character spacing. Default is 0. ```swift public var characterSpacing: CGFloat ``` -------------------------------- ### Clear Method Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSImageView.html Method to remove previously revealed image. ```swift @MainActor public func clear() ``` -------------------------------- ### imageDidChange(in:) Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols/VGSImageViewDelegate.html Tells the delegate the image was displayed in view. ```swift @objc @MainActor optional func imageDidChange(in imageView: VGSImageView) ``` -------------------------------- ### PDF Background Color Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSPDFView.html Background color of PDF viewer. ```Swift @MainActor public var pdfBackgroundColor: UIColor? { get set } ``` -------------------------------- ### Raw Revealed Text Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel/CopyTextFormat.html Represents the raw revealed text format. ```swift case raw ``` -------------------------------- ### Analytics Collection Toggle Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Toggles the collection of analytics data. ```swift VGSAnalyticsClient.shared.shouldCollectAnalytics = false // if policy mandates ``` -------------------------------- ### Request Timeout Interval Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Structs/VGSShowRequestOptions.html Declaration for the requestTimeoutInterval property. ```swift public var requestTimeoutInterval: TimeInterval? ``` -------------------------------- ### VGSLogger Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes.html Declaration for the VGSLogger class. ```Swift public final class VGSLogger ``` -------------------------------- ### Unsubscribe View Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSShow.html Unsubscribes a VGSViewProtocol view from a VGSShow instance. ```swift @MainActor public func unsubscribe(_ view: VGSViewProtocol) ``` -------------------------------- ### VGSHTTPMethod Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums.html HTTP request methods enumeration declaration. ```Swift @MainActor public enum VGSHTTPMethod : String ``` -------------------------------- ### Invalid Base64 Data Error Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSErrorType.html Indicates that the provided Base64 data is invalid. ```swift case invalidBase64Data = 1405 ``` -------------------------------- ### Delegate Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSImageView.html The object that acts as the delegate of the VGSImageView. ```swift @MainActor public weak var delegate: VGSImageViewDelegate? ``` -------------------------------- ### Field Not Found Error Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSErrorType.html Indicates that a specified field could not be found in the given path. ```swift case fieldNotFound = 1403 ``` -------------------------------- ### VGSLogLevel Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums.html Defines levels of logging enumeration declaration. ```Swift public enum VGSLogLevel : String ``` -------------------------------- ### labelCopyTextDidFinish Delegate Method Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols/VGSLabelDelegate.html Delegate method called when raw text is copied from a VGSLabel. ```swift @objc @MainActor optional func labelCopyTextDidFinish(_ label: VGSLabel, format: VGSLabel.CopyTextFormat) ``` -------------------------------- ### Content Path Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSImageView.html Name associated with VGSImageView for decoding content path from vault. ```swift @MainActor public var contentPath: String! { get set } ``` -------------------------------- ### Page Shadows Enabled Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSPDFView.html Determines if shadows should be drawn around page borders in a pdfView, default is `true`. ```Swift @MainActor public var pageShadowsEnabled: Bool { get set } ``` -------------------------------- ### Delegate Property Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSPDFView.html The object that acts as the delegate of the VGSPDFView. ```Swift @MainActor public weak var delegate: VGSPDFViewDelegate? ``` -------------------------------- ### VGSLabel Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes.html Declaration for the VGSLabel class. ```Swift @MainActor public final class VGSLabel : UIView, VGSLabelProtocol ``` -------------------------------- ### VGSShowRequestResult Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums.html Response enum cases for SDK requests enumeration declaration. ```Swift @frozen public enum VGSShowRequestResult ``` -------------------------------- ### Formatted Text Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel/CopyTextFormat.html Represents the formatted text format. ```swift case transformed ``` -------------------------------- ### setSecureText with an array of ranges Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Sets multiple text ranges to be replaced with the secure text symbol using an array of VGSTextRange objects. ```swift @MainActor public func setSecureText(ranges: [VGSTextRange]) ``` -------------------------------- ### Unexpected Response Data Format Error Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Enums/VGSErrorType.html Indicates that the format of the response data is not supported. ```swift case unexpectedResponseDataFormat = 1401 ``` -------------------------------- ### VGSErrorInfoKey Type Alias Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Typealiases.html Error info key. ```Swift public typealias VGSErrorInfoKey = String ``` -------------------------------- ### labelRevealDataDidFail Delegate Method Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Protocols/VGSLabelDelegate.html Delegate method called when the reveal data operation fails for a VGSLabel. ```swift @objc @MainActor optional func labelRevealDataDidFail(_ label: VGSLabel, error: VGSShowError) ``` -------------------------------- ### Disable Logging Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/AGENTS.md Disable all loggers for VGS. ```swift VGSLogger.shared.disableAllLoggers() ``` -------------------------------- ### PDF Auto Scales Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSPDFView.html A boolean value indicating whether pdf is autoscaling, default is `true`. ```Swift @MainActor public var pdfAutoScales: Bool { get set } ``` -------------------------------- ### Revealed Raw Text Length Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html The length of the revealed text. ```Swift @MainActor public var revealedRawTextLength: Int { get } ``` -------------------------------- ### VGSShowError Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes.html Declaration for the VGSShowError class. ```Swift public class VGSShowError : NSError ``` -------------------------------- ### Delegate Property Declaration Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSLabel.html Declaration of the delegate property for VGSLabel. ```swift @MainActor public weak var delegate: VGSLabelDelegate? ``` -------------------------------- ### Has Document Source: https://github.com/verygoodsecurity/vgs-show-ios/blob/main/docs/Classes/VGSPDFView.html A Boolean value determines whether the view has document. ```Swift @MainActor public var hasDocument: Bool { get } ```