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

Multiple sheets on the page? #2

Open
goors opened this issue Jun 4, 2023 · 2 comments
Open

Multiple sheets on the page? #2

goors opened this issue Jun 4, 2023 · 2 comments

Comments

@goors
Copy link

goors commented Jun 4, 2023

Hi, firstly, awesome work. This works great. But there is a problem

If you want to have multiple sheets on the page

Text("One").axisSheet(isPresented: .constant(true))
Text("Two").axisSheet(isPresented: .constant(false))
Text("Three").axisSheet(isPresented: .constant(false))

You will have in fact sheets stack up on each other and isPresented is used only to control offset and not actual visibility of element.

Is there any way to reslove this?

@goors
Copy link
Author

goors commented Jun 4, 2023

As far as i can tell this can be only done by doing something like:

@State var showOne: Bool = true
@State var showTwo: Bool = false
@State var showThree: Bool = false


Text("One").axisSheet(isPresented: .constant(true))
.opacity($showOne ? 1 : 0)

Text("Two").axisSheet(isPresented: .constant(true))
.opacity($showTwo ? 1 : 0)

Text("Three").axisSheet(isPresented: .constant(true))
.opacity($showThree ? 1 : 0)

But this kind of sucks ....

@goors
Copy link
Author

goors commented Jun 4, 2023

Actually I just tried it ... that will not work either since if any of that goes to true it will be gone from view and not beautifully stacked. Hell ... any idea?

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