Created
January 23, 2022 19:21
-
-
Save kernjackson/ff6c2dcfee0361cb621f66d40362699d to your computer and use it in GitHub Desktop.
SwiftUI SKOverlay to Display App Store Link in apps or clips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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