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

[BUG] crash when trying to reload views too quickly #83

Closed
yyl0 opened this issue Jul 29, 2020 · 1 comment
Closed

[BUG] crash when trying to reload views too quickly #83

yyl0 opened this issue Jul 29, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@yyl0
Copy link

yyl0 commented Jul 29, 2020

Describe the bug
A clear and concise description of what the bug is.

My app crashes during the SizeViewModifier .onReload perform self.size = proxy.size
Logs: "Recorded stack frame" and "enqueued from com.apple.main-thread (Thread 1)"

To Reproduce

  • Steps to reproduce the behavior
  • Sample code

Works fine when I navigate away from a view that has pager and then back SLOWLY, but doing so quickly causes this crash.

Pager(page: self.$currentPage, data: Array(0..<self.postArray.count), id: \.self, content: { index in
                        PostView(
                            loading: self.$loading,
                            chosenIndex: self.carouselStartIndex,
                            post: self.postArray[index],
                            nested: self.nested,
                            parent: self,
                            postIndex: index,
                            receivedIndex: self.$currentPage)
                        
                    }) // pager
                        //                        .multiplePagination() // too buggy right now
                        .vertical()
                        .swipeInteractionArea(.page) // or else the post carousel can't be scrolled
                        .onPageChanged { newIndex in
                            if newIndex == 0 { self.counterCheck += 1 } else {
                                self.counterCheck = 0
                            }
                            self.currentPage = newIndex
                            
                            if !self.loadedOnce { self.loadedOnce = true }
                    } // page change`

Expected behavior
A clear and concise description of what you expected to happen.

To not crash

Screenshots / Videos
If applicable, add screenshots to help explain your problem.

Screen Shot 2020-07-28 at 5 08 00 PM

Environment:

  • OSX: [e.g. iOS] 13.5.1
  • Device [e.g. iPhone6] iPhone 11 Pro
  • SwiftUIPager version 1.9.0-beta.3

Additional context
Add any other context about the problem here.

@yyl0 yyl0 added the bug Something isn't working label Jul 29, 2020
@fermoya
Copy link
Owner

fermoya commented Jul 29, 2020

Hi @yyl0 , this issue is duplicated with #60, I gave there an answer. This shouldn’t happen to you in Xcode 12.

In any case, please update to version 1.9.0 (not the beta, the production-ready release) as SizeViewModifier disappears in this version.

If you still have issues please open a new issue.

@fermoya fermoya closed this as completed Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants