Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to create skip and next button inside the Bubble #2

Open
ajinumoto opened this issue Jul 20, 2022 · 2 comments
Open

Question: How to create skip and next button inside the Bubble #2

ajinumoto opened this issue Jul 20, 2022 · 2 comments

Comments

@ajinumoto
Copy link

I'm new in swift, can you help me how i can do that?
and also is it safe to include this packge if i want to publish in the app store? (such as the uses of UIApplication.sharedApplication() in instruction by ephread). Thank you

@ajinumoto
Copy link
Author

Im using CustomQuitButton inside switch case
func makeCallout() -> Callout

but I Always got this error massage :
"SwiftUI/EnvironmentObject.swift:70: Fatal error: No ObservableObject of type Dux found. A View.environmentObject(_:) for Dux may be missing as an ancestor of this view."

@ajinumoto
Copy link
Author

ajinumoto commented Jul 21, 2022

It works, I changed the callout funct, but im not sure its the good way

public static func custom<V: View>(edge: Edge = .top, @ViewBuilder content: @escaping (_ onTap: @escaping () -> Void) -> V) -> Self {return .init(body: { next, skip  in AnyView(content(next)) }, edge: edge)}    
    
    public let body: (_ next: @escaping () -> Void, _ skip: @escaping () -> Void) -> AnyView
    public let edge: Edge

 func createView(next: @escaping () -> Void, skip: @escaping () -> Void) -> some View {
        body(next, skip)
            .overlay(GeometryReader { proxy in
                Color.clear
                    .preference(key: CalloutPreferenceKey.self, value: proxy.size)
            })
    }

and call the function in the containerView

tagInfo.callout.createView( next: { dux.delegate.onCalloutTap(dux: dux) }, skip: { dux.delegate.onSkipTap(dux: dux) } )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant