Saturday, June 29, 2024
HomeiOS Developmentios - Name async perform in .sheet or .fullScreenCover SwiftUI

ios – Name async perform 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 verify standing is async I’ve to name with await and wrap in a Activity{} which isn’t potential inside a fullScreenCover.

Easy methods to name a async perform in a fullScreenCover

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

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



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments