Superwall

Superwall

The shared instance of Superwall that provides access to all SDK features.

You must call configure() before accessing Superwall.shared, otherwise your app will crash.

Purpose

Provides access to the configured Superwall instance after calling configure().

Signature

public static var shared: Superwall { get }

Parameters

This is a computed property with no parameters.

Returns / State

Returns the shared Superwall instance that was configured via configure().

Usage

Configure first (typically in AppDelegate or SceneDelegate):

Superwall.configure(apiKey: "pk_your_api_key")

Then access throughout your app:

Superwall.shared.register(placement: "feature_access") {
  // Feature code here
}

Set user identity and attributes:

Superwall.shared.identify(userId: "user123")

Superwall.shared.setUserAttributes([
  "plan": "premium",
  "signUpDate": Date()
])

Set delegate:

Superwall.shared.delegate = self

How is this guide?

On this page