SKOverlay
A class that displays an overlay you can use to recommend another app or an App Clip’s corresponding full app.
Declaration
class SKOverlayMentioned in
Overview
By displaying an overlay, you can recommend another app to users and enable them to download it immediately. To recommend media that’s not an app, or to display a product page within your app, use SKStoreProductViewController.
If you’re using SwiftUI, make use of the appStoreOverlay(isPresented:configuration:) modifier. For example usage, see Fruta: Building a feature-rich app with SwiftUI.
To display an App Store overlay in an app that uses UIKit:
Create an SKOverlay.AppConfiguration with the iTunes identifier of the app you want to recommend.
Initialize
SKOverlaywith the configuration object.Present the overlay.
The following code displays an overlay at the bottom of the visible scene:
func displayOverlay() {
guard let scene = view.window?.windowScene else { return }
let config = SKOverlay.AppConfiguration(appIdentifier: "The iTunes identifier of another app.", position: .bottom)
let overlay = SKOverlay(configuration: config)
overlay.present(in: scene)
}To respond to the overlay’s appearance, dismissal, or failure to load, set the delegate and implement the methods defined in SKOverlayDelegate.
Topics
Creating an overlay
init(configuration:)configurationSKOverlay.AppConfigurationSKOverlay.AppClipConfigurationSKOverlay.Configuration