-
Notifications
You must be signed in to change notification settings - Fork 324
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
Added introspect for scroll view in TabBarView with PageTabViewStyle #117
Conversation
Any chance we can get this into master and released? We were using |
+1 can we get this merged? |
This is working great for me! Setting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this and it works in ios 15.4
@philprime thanks a lot for the PR and sorry for the late reply! |
@SplittyDev I think I can do that, but I need assistance on how to create Introspect tests cases -> how do you verify it works? |
@philprime In the IntrospectTests directory we have We create a view for the test (e.g. We then write the test itself, which renders the test view and passes an One more important thing is that the components / introspections are properly tagged with @available(iOS 14.0, tvOS 13.0, macOS 11.0, *)
@available(tvOS, unavailable)
private struct ColorWellTestView: View { ... } Platform availability information can usually be taken directly from the docs: |
@SplittyDev I added a test case as you described it. Let me know if more changes are required. (Sorry for the formatting commits/notifications, for some reason it kept being wrong 😂) |
@philprime good stuff, thanks a lot! The formatting commits aren't a problem, we'll squash-merge anyway :) |
@SplittyDev Hi. This awesome PR was merged but seemed lost since it is not in 0.1.4. |
@ichikmarev actually the PR hasn't been released yet. My commit is in the main branch with date April 17th, 2022, but the release 0.1.4 was published on January 26, 2022 |
I created an extension to introspect the horizontal scroll view in a
TabBarView
withtabViewStyle(PageTabViewStyle()
.This tab view style is Apple's solution for pagination like UIPageViewController. Interesting enough, it actually uses a
UICollectionView
with an embeddedUIScrollView
.I use this extension to disable horizontal scrolling (similar to
scrollView.isScrollEnabled = false
) so only programmatic navigation is possible. When horizontal scrolling is disabled, the collection view still bounces vertically, so both views are passed to the customize closure.Example: