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

Fix bug occurs when tapping tabItem and swiping viewController at the same time #67

Closed
wants to merge 4 commits into from

Conversation

hiragram
Copy link
Contributor

@hiragram hiragram commented Jun 2, 2017

  • Tap tabItem
  • Swipe or tap viewController immediately (before tabItem's animation has finished)
  • tabItem shows that Blue viewController is selected, but Red viewController is actually selected. (And after that, Yellow viewController disappears and be skipped)

Sometimes app crashes but not every time.

2017-06-02 14:05:39.322094 TabPageViewControllerDemo[5856:1863363] *** Assertion failure in -[TabPageViewController.TabPageViewController queuingScrollView:didEndManualScroll:toRevealView:direction:animated:didFinish:didComplete:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3600.6.22/UIPageViewController.m:2083
2017-06-02 14:05:39.324377 TabPageViewControllerDemo[5856:1863363] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'No view controller managing visible view <UIView: 0x115f10400; frame = (0 0; 375 667); autoresize = W+H; layer = <CALayer: 0x17403f060>>'
*** First throw call stack:
(0x191e151b8 0x19084c55c 0x191e1508c 0x1928cd02c 0x1984d8ae0 0x1985aacbc 0x1985aaa14 0x1985a6b38 0x1985a97b8 0x1985acac4 0x1985accec 0x1985a7aa8 0x197fde050 0x197e73370 0x197e72eac 0x19506af24 0x19506add0 0x192082094 0x191daae50 0x191dc3218 0x191dc29cc 0x191dc04b0 0x191cee2b8 0x1937a2198 0x197d357fc 0x197d30534 0x10004b624 0x190cd15b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

To prevent this bug, I set tabPagerController.view.isUserInteractionEnabled to false in displayControllerWithIndex, then set to true when animation has been completed.
This change works fine with my project currently.

@hiragram
Copy link
Contributor Author

hiragram commented Jun 8, 2017

I made a mistake so I will recreate PR from different branch.

@hiragram
Copy link
Contributor Author

hiragram commented Jun 8, 2017

see #69

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

Successfully merging this pull request may close these issues.

None yet

1 participant