How to embed scrollview to tableview cell? - ios

I have a scrollview embedded in a cell of tableview. The scrollview is a Foxit PDF rendering engine.
I want to scroll vertically the tableview, horizontally the scroll view. I couldn't. As on the first GIF you see scrollview is bouncing even the content height and scroll height is equal. But at least paging is possible.
Then I added a custom scrollview over the Foxit view into the cell. The bouncing disappeared and scrolling up and down the scrollview scrolls the table view. That is good. But now I can not horizontally scroll and change pages of the PDF.
What to do how to "merge" the two approach?

Try to play with panGestureRecognizer of scrollView and tableView. Install a relationship to prevent scrollView getting gestures before tableView scrollView.panGestureRecognizer.require(toFail: tableView.panGestureRecognizer).

Related

Collection View Dragging Cells when scrolling

I have one UICollectionView with many sections and cells. I have used custom UICollectionView layout to achieve this design. It has scroll on both horizontal and vertical, with some static cells. Check the video for more details. All the data is setting proper.
Video Link.
Issue is with dragging. I want to drag the cells in the vertical direction and if its within the visible cells there is no problem. But when the cell is drag to scroll the UICollectionView and to bottom there is layout issues with top sticky sections.
Blue remains static when scrolling from left to right and red remains static when scrolling to bottom.
I have implemented drag using longpress gesture. And used CADisplayLink to scroll the UICollectionView while dragging. It would be better if any suggestions on how to scroll the UICollectionView while dragging the cell and how to keep the sticky cells without and layout issues.

Putting a UIScrollView inside a UIPageView, scrolling doesn't work

I'm making a pageview that has a bunch of scrollable pages inside it. I have the pageview working, and the viewcontrollers that it rotates each have a scroll view inside them. The problem is, I think, that the scrolling doesn't happen because the touches don't get through to the pageview. The scroll view should only scroll vertically, while the pageview works with the horizontal scrolling. Is it possible to send through only the vertical touches, or is there another way?
Thanks
If you're using a storyboard, open the Attributes inspector of the embedded UIScrollView and deselect the "Shows Horizontal Indicator" option. Do the same on the UIPageViewController, but for the "Shows Vertical Indicator". However, you also have to ensure that the scroll view's contents aren't wider than the scroll view itself; to do this, just constrain the contents' width to be equal to the scroll view's parent.

Pass scroll between UIScrollView and embed UICollectionView

Here's my architecture.
I have a UIScrollView with some UIView's added in.
At the end on my scrollview i have a UICollectionView (embedded in my scrollview) in which i loads many data. I had to use a UICollectionView in order to reuse the multiple views displayed.
What i want is keep a smooth scroll when the user scrolls to the bottom of the parent scrollview and continue scrolling in the UICollectionView.
What i've made now is set the size of my UICollectionView equal to my UIScrollView Size and i've disabled bounces on both.
But i can't have a smooth scroll. When i reach the end of my UIScrollView, the scrollview's stop and then i have to re scroll on my UICollectionView
Not sure if it's really clear.
You should not normally "pass scroll" between elements. What you need to make sure is that the UICollectionView's frameSize is equal to its contentSize, meaning its frameSize expands as much as its contents so that all of its content is visible without having to scroll. Then your UIScrollView will handle the scroll and show the contents of your UIViewController by scrolling just itself.

UITableView not scrolling inside of UIScrollView

in my view controller I have a ScrollView for content adaptation on various devices .. I need to insert a tableView inside the ScrollView but I noticed that my tableView not scrolling when it is inside a ScrollView. Can someone help me figure out how to fix this?
If you want your table view to scroll set the content size of scroll view less than that of your table view.

UIScrollView in UITableView Header not scrolling

Following problem: I have a UITableView with several cells. The table has also a header, in which i added a UIScrollView, which should scroll horizontal.
So now when i scroll around the screen the table will always be scrolled, but not the UIScrollView in the header, even if i scroll horizontal in the area of the header.
So it seems the table is managing all the scrolling. How can i setup the UITableView scrolling so that the UIScrollView in the header handles the horizontal scrolling for the header area.
I tried to set delegate of the UIScrollView and tried the function from the UIScrollViewDelegate, - (void)scrollViewDidScroll:(UIScrollView *)scrollView, but only the table calls this function.
I hope you can help me.
Set content Size properly. Content size should be the width and height till where you want to scroll.
scrollView.contentSize=CGSizeMake(100,960);

Resources