Swift & UIKit

Step 1

Open your iOS project in XCode , select your target and drag SparkYouLib.xcframework folder to Frameworks, Libraries, and Embeded Content section

Step 2

In your ViewController.swift

  1. Add import SparkYouLib to the top

  2. Since we use delegate for communication between ViewController and the SparkYouWebView , your ViewController need to implement the SparkYouWebViewDelegate protocol. Modify your ViewController as below:

  3. Implement two functions required by the SparkYouWebViewDelegate protocol

  4. Now you can load SparkYou web app by creating new instance of SparkYouWebView class. For example, below is a simple ViewController.swift file which contain a button to open the web view using SparkYouWebView class

Last updated