Scrolling through Table View with embedded Table View Inside a Container View - ios

This is a tableView. The white sections are the tableview cells. In the footer of tableView, I've added a scrollview with 2 containers views embeded with 2 UIViewControllers. These embeded view controllers contains tableView.
Now I'm having a problem with the scrolling. I'm scrolling the main tableview and as I scroll, I'm changing the height of the table footerview on which the scrollview is added. Now the problem is when I scroll through child view controller, I'm not able to scroll to the top of my main tableView. How should I do it? Is there is demo github project which I can refer to any code?
EDIT:
This is how my storyboard looks like:
I want to implement something like Facebook has implemented. I think they are using tableview with page view controller. How can I achieve this?

Related

Collection view as a sticky header in swift

I'd like to know how would you create a collection view embedded in a table view like the one you can see in Tinder app while you browse through someone's pictures.
It's obviously only a paging enabled collection but I don't know how to make it sticky at the top while still scrollable.
Thank you for your help
J.
it is embedded in a navigation controller, so the bar at the top is alway fixed. plus it is not a collection view embedded inside a tableview, that would be ridiculously redundant. It is just a CollectionView with animations.
You can use table view section header for this.
Create a UIView with UICollectionView in it.
Make this UIView as the section header of table view section. This UIView will then stick to the top for that particular section when the table is scrolled.

How to create Layout with UIImageView and UICollectionView and collection view changes height on scroll?

I would like to create such a layout where on scroll the imageview hides and collection view takes whole screen. I tried this but it doesnt seem to work. I am getting the image view correctly but the collection view has gone dark completely on run. I have a content view(UIView) and scroll View underneath. Thank you
EDIT 1 :- The Cells are not getting displayed. But the collection view is displayed in the layout. How to solve this?
EDIT 2 :- Instead of using the collection view directly I used a container view and embedded my collection view in it and it Worked! However I am still trying to figure out how do i scroll the container view to top when i scroll, i.e. push the image view on the back of container view while it takes the full height of the screen.
Okay So I figured it out.
Wreck all of the above. (Though the container view solution is pretty good)
Build a collection View controller from scratch having 2 headers, one is the standard and the other one for the image view.
Make your view controller a delegate of the collection view flow layout delegate and implement function for referenceSizeForHeaderInSection
Do not forget to register for the xib yo have created for the image view header by using registerNib forSupplementaryViewOfKind function of collection view object.

GADBannerView scroll with UITableView IOS

I want to fix the GADBannerView at the bottom of UITableView, the banner shows at the end of the table after scrolling.
Please see this link. It is not possible you have to use a tableview inside a view controller which is better, than you can add a view to view of uiviewcontroller and constrain it at the bottom of view because than tableview is separate view inside main view.
Original answer is below.
Add subview to tableview which doesn't scroll

Container View or UIViewController for tableView with SubView

I have a UIViewController in storyboard that will be a sliding up menu. I want to place it in a UITableView. If I place it as subview of UITableView and prevent it from scrolling, it gets the look I want, with one problem, the section headers of tableview scroll above subview.
Now, in order to prevent this behavior, I could reduce tableview frame, but it doesn't work because my subview is inside that same frame, right?
So , if that is true, what is the best way to achieve this? Place both screens inside a third UIViewController?
Don't try to put other views inside a table view. Bad news.
If your table view is managed by a UITableViewController then that's really all you can have in the table view (unless your views are inside cells, or in headers or footers.)
If you ARE using table view controllers to manage your table view(s), I suggest you create a container view on the view controller that needs to contain the table view, then control-drag an embed segue to the table view controller. That way the table view controller becomes a child view controller of the main VC, and you can put other view elements on the screen to your heart's content.

UITableView grouped with transparency above to reveal content behind it?

Is it possible to make a grouped UITableView transparent above and below it's content. I am not looking for a parallax-type solution, but I have a UITableView that I add to my view controller. When pulling down on the table view, I would like to display the view controller view (that the table view us a subview of).
Right now, when I add a UITableView with the same frame as my view controller's view and add it as a subview, when I drag down on the UITableView the header above the first cell is the same colour as my UITableView's background. Instead I would like for it to reveal the content behind it more and more as the user drags down.
Is this possible and how? Thanks.

Resources