TableView with CollectionView Cells and Top Cell Sticking to the Top - ios

I am intersted in a layout very similar to the App Store app, the "Featured" tab. I think I can achieve this by having a UITableView whose cells are horizontal CollectionViews. So that part is not really my question. The part that I have a question is that the top row of this UITableView scrolls out of the view if you pan (drag) up on the screen but it stick to the top when you pan down. I would like to know how I can achieve that stickiness in one direction.

Related

Swift collectionView hiding layout guidance

I am looking to create a certain layout with a collection view. Where there are 2 sections to the main viewController, the first being static on the page, and the second being a collectionView which moves over the other when the user scrolls. I want the collectionView to have a limit of how much it cover the static content (it should have a minimum and maximum inset that it can covert). The collectionView has a button which "hangs over" the static section. I have attached some images to describe this further.
I have thought of a few ways to achieve this, the most promising being a collectionView with a top contentInset of the 'max scrolled down' height. This would show the content underneath and allow the collectionView to be scrolled up and cover it. the button which "hangs over" would be a subview of the collectionView and would also show the rounded corners and drop shadow.
Problems:
couldn't continue scrolling the collection view whilst also pinning the header to the top
If anyone has any suggestions of how to go about this, please let me know! Thank you.

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.

Mixing UIScrollViews and UITableViews

If you look at the Featured tab of the Apple App Store app on an iPhone 6, there is a unique UI layout that I can't figure out how to replicate.
At the very top there is a navigationBar. Below this there is a UIScrollView that animates through a number of featured items. Below this is what appears to be a UITableView with a number of custom programmed cells.
My first guess was that the UIScrollView at the top was added to a custom cell at the top of a UITableView. If you swipe up the UIScrollView moves with the objects below like it is a cell. You can see that the vertical scroll indicator starts at the top of the UIScrollView.
The part that is unique is that if you swipe down, the objects below the UIScrollView move down like a UITableView and the UIScrollView stays in place. This means that the UIScrollView is not a custom cell at the top of a UITableView.
I tried making this work a number of different ways but I can replicate this. Does anyone know how this can be done?
You can use a tableview header,the header is a scrollview
If you scroll tableview up,just use tableview default behavior,the header will scroll up.
If you scroll down,use UIScrollViewDelegate to calculate the tableview header new frame,and adjust it.So it remain at top
Not sure if I got you correctly, you may use UICollectionView as vertical scroll. Then, you create a custom UICollectionViewCell, each with horizontal scroll.
I haven't tried it though but done something similar to this. Hope you find a way!

scrolling tableview upwards and keeping tableview in complete scroll view

In this I need scroll complete tableview to upward and tableview should stay upwards until user again scrolls down. It should come back to its original position.
Update
I need to scroll the tableview top and bottom on a image
From Apple documentation it's not advisable to add tableView inside scrollview(Reference).
Now according to design of your screen either you can have one tableView and in header of that tableView you can add all static content.Reference
or if your design must have tableView inside scrollView then this SO question maybe helpful to you.
I'd prefer first choice if possible.
By the way if you can fix the height of tableView then you can implement tableView inside scrollView easily.

UITableView Vertical Scrolling Issues Inside UICollectionViewCell that Scrolls Horizontally

I'm trying to create a UITableView that can scroll both vertically and horizontally. The way I went about implementing this is putting a UITableView (scrolls up and down) inside of a UICollectionViewCell that I set to scroll horizontally (left and right) only. Code-wise, the solution looks pretty darn clean (and elegant in my book because of it), however, I'm experiencing some issues with vertical scrolling on the table view.
Normally, when you vertically scroll on a UITableView, it will keep track and remain where you left off in the scrolling -- as in the table view will not reset or move its scrolling position to a good bit above of where it left off. As you might've guessed, this is what I'm experiencing with my implementation where if I scroll to the very bottom of my table view, its scroll position gets moved to a bit above where I left off and I cannot naturally see the last entry in my table view without having to force a scroll to the bottom in order to reveal it.
Any ideas what might be causing this? I configured all of the settings for the UITableView, UICollectionView and UICollectionViewCell within the Interface Builder -- most important thing being I set the UICollectionView and its UICollectionViewFlowLayout scroll directions to Horizontal. I'm not sure if that's somehow being overwritten somewhere…
This is what you are looking for I believe.

Resources