Sunday, December 15, 2024
HomeiOS Developmentios - Name async operate in .sheet or .fullScreenCover SwiftUI

ios – Name async operate in .sheet or .fullScreenCover SwiftUI


Utilizing RevenueCat and checking the customers subscription standing.
If Subscribed or not will decide the view proven in a fullScreenCover

Solely as the decision to test standing is async I’ve to name with await and wrap in a Process{} which isn’t attainable inside a fullScreenCover.

The best way to name a async operate in a fullScreenCover

.fullScreenCover(isPresented: $subscriptionIsExpanded){
                Process {
                if await StoreManager.isPremiumSubscriber() {
                          ActiveSubscription()
                        }
                   else{
                    PaywallView(displayCloseButton: true)
                }
            }
     }

Process{} provides error: Static technique 'buildExpression' requires that 'Process<(), By no means>' conform to 'View'

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments