Skip to content

Instantly share code, notes, and snippets.

@kernjackson
Created January 23, 2022 19:21
Show Gist options
  • Select an option

  • Save kernjackson/ff6c2dcfee0361cb621f66d40362699d to your computer and use it in GitHub Desktop.

Select an option

Save kernjackson/ff6c2dcfee0361cb621f66d40362699d to your computer and use it in GitHub Desktop.
SwiftUI SKOverlay to Display App Store Link in apps or clips
import SwiftUI
import StoreKit
struct Content: View {
var body: some View {
AppStoreOverlay(id: "1234567890")
}
}
struct AppStoreOverlay: View {
var id: String = ""
@State private var isPresented: Bool = false
var body: some View {
Button("App Store Overlay", action: {
isPresented.toggle()
})
.appStoreOverlay(isPresented: $isPresented) {
SKOverlay.AppConfiguration(appIdentifier: id, position: .bottom)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment