nachonavarro / Pages

📖 A lightweight, paging view solution for SwiftUI
MIT License
556 stars 53 forks source link

transition problem with pageCurl transition & didFinishAnimation #15

Closed RajaSeshadri closed 4 years ago

RajaSeshadri commented 4 years ago

The adaptation to SwiftUI works great thanks. I needed this for pageCurl transition and not the scroll transition. However, the transition animation does not work properly. The top page curls up nicely and the next page is visible behind it. However, when the animation is complete the second page curls away too leaving a blank white page. There is an error message shown "Unbalanced calls to begin/end appearance transitions" .

Two things - (1) this problem does not occur when the transition type is scroll -only there for pageCurl type. (2). if I comment out the UIPageViewControllerDelegate method didFinishAnimating finished the problem goes away - the transition works nicely.

I am not sure that the problem is your code, because I get the same problem just using the code in the tutorial from Apple ( https://developer.apple.com/tutorials/swiftui/interfacing-with-uikit ) .

I can send you the complete example if needed. I am hoping that you can figure out a solution.

nachonavarro commented 4 years ago

If this doesn't happen only with Pages then it seems it's an underlying problem with the UIPageViewControllerDelegate. We'll need to wait for Apple to fix it.