Enhance your Swift iOS app by seamlessly integrating our advertising widget. The setup is quick and consists of a few core steps. By following this guide, you can embed the widget and showcase targeted advertising to your audience.
First, you’ll need to install the Uptick SDK, which provides the necessary tools for integrating our advertising widget into your iOS application.
pod 'UptickSDK'
pod install
Next, you need to set up a placeholder where the advertising widget will appear. Add a UIView
to your storyboard
or create it programmatically.
UIView
to the desired location in your view controller.
UIView
to UptickAdView
in the Identity Inspector.
import UIKit import UptickSDK class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let uptickAdView = UptickAdView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 250)) uptickAdView.backgroundColor = .clear self.view.addSubview(uptickAdView) } }
After setting up your placeholder, you need to embed the activation script to power the widget and fetch the required content.
Ensure you have a reference to the UptickAdView
in your view controller.
import UIKit import UptickSDK class ViewController: UIViewController { @IBOutlet weak var uptickAdView: UptickAdView! override func viewDidLoad() { super.viewDidLoad() UptickManager.shared.activateAd(in: uptickAdView, withID: "YOUR_INTEGRATION_ID") } }
import UIKit import UptickSDK class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let uptickAdView = UptickAdView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 250)) uptickAdView.backgroundColor = .clear self.view.addSubview(uptickAdView) UptickManager.shared.activateAd(in: uptickAdView, withID: "YOUR_INTEGRATION_ID") } }
To display the Uptick Widget, ensure that the widget is activated within your view controller. This can be done in the viewDidLoad
method or when the view appears.
import UIKit import UptickSDK class ThankYouViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let uptickAdView = UptickAdView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 250)) uptickAdView.backgroundColor = .clear self.view.addSubview(uptickAdView) UptickManager.shared.activateAd(in: uptickAdView, withID: "YOUR_INTEGRATION_ID") } }
Here is a complete example of a ThankYouViewController
that integrates the Uptick advertising widget.
import UIKit import UptickSDK class ThankYouViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let uptickAdView = UptickAdView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 250)) uptickAdView.backgroundColor = .clear self.view.addSubview(uptickAdView) UptickManager.shared.activateAd(in: uptickAdView, withID: "YOUR_INTEGRATION_ID") } }
UptickAdView
and used the appropriate integration ID.