Move views under ScrollView on pull to refresh - ios

I have a layout like on the picture bellow. On it I have:
general header
tabs
table
Depending on the selected tab I display UITableView with different data.
I need to implement pull to refresh functionality for the screen. I just didn't want to invent a bicycle and tried to use UIScrollView, but I can't use it as container for the whole screen, because the UITableView already has is own UIScrollView. Thus I wrapped the header into a UIScrollView, but when I do pull to refresh the header moves behind the tabs and the table.
Can anybody advise how to move views under UIScrollView when I do pull to refresh in the UIScrollView, but do not hide content of the header behind Views below? Or how put UITableView inside UIScrollView in a safe way.

For this you can drag and drop UIView in UITable View Just uper the cell. Then You can use that UIView acording to you.

Related

How to make header only stick on negative content offset - Swift

I have a tableView and I have a UIView as the tableView header. I want the header to move up the screen when I scroll down and act just like any normal cell. But when I have reached the top of the view, where if I scroll up it will just bounce back, I want the tableView header to stick to the top.
One example is like the Facebook app headers. They scroll when you scroll, but if you're at the top of the page and you scroll up, they wont scroll down, they stay stuck to the top.
How do I achieve this?
If you're using a normal tableView (not grouped style) and you only have one section, you can accomplish this by using the section header instead. The default behaviour of this type of tableView is as you described. You'll just have to provide a custom view for the section header that looks like your cell.
If this isn't a possibility, you'll need to take advantage of tableView being a subclass of scrollView, and implement the scrollViewDidScroll delegate method to check content offsets etc.

One section of the view controller is still and one section horizontally scrollable

I would like to construct a view controller where one section of the view controller would be still and one section scrollable.
Both sections have headers where as well, one is still and one is moving along with the content in the section.
I do not want the cells in the section to be scrolled separately. All cells should move at the same time along with the header.
I have added an image to make my point little more clearer.
Use UICollection View for both view and disable scrolling for one view and enable scrolling for another view
you can probably add to your UIViewController view a UITableView on the left with fixed size (for example 150px) and vertical scroll disabled and a UICollectionView with horizontal flow and ,if needed a, with custom UICollectionViewLayout (but i think that you just need the classic UICollectionViewFlowLayout) for the right part that fits the remaining space.
Here you can find the component's documentation:
https://developer.apple.com/reference/uikit/uicollectionview
https://developer.apple.com/reference/uikit/uitableview

make transparent stickyHeader like weather iOS

i want to create transparent sticky header like weather app in iOS as my header is transparent view goes under header but i don't want other content visible bellow my header. ( you can see "Friday" goes under header and will hidden but the header is transparent).
you can check the animation and this behavior in weather app.
i have tried :
CSStickyHeader
This is done with a combination of various scroll views and table views.
It looks like the whole screen is contained in a UIScrollView. The "header" is just a UILabel that moves depending on the content offset of the scroll view.
The time bar with "Now", "02", "03", ... Is probably a UICollectionView inside the main UIScrollView.
The section underneath that is a UITableView with all the day information. This is also embedded inside the UIScrollView.
The scrolling is then managed by the main UIScrollView and passed down to the UITableView.
However, when the tableview scrolls it is not going underneath anything. The content is being cut off because that is the top of the UITableView.
Then the entire thing is also embedded inside a UIPageViewController to manage the pages.
Something like this...

Scrolling up UICollectionView don't move a UIView above it

I am working in a profile ViewController. This profile has a main image in a UIView subclass and a CollectionView gallery with some images. I would like to be able to scroll up the UICollectionView and move the UIView too, and if I scroll down, I want to watch again the UIView when the collectionView first item is showed again.
I have tried to do this adding the collectionView and the UIView to a ScrollView, but the UIView only scroll up if I touch it.
In this picture you can see my problem
Thank you in advance
You need to make the view at the top a Header View of the collection view.
Essentially it needs to be an actual part of the collection view if you want this action. (That's the easiest way anyway).
So the collection view will take up the whole screen but it will have a header view. Then when you scroll the collection view the header will move out of view and then come back in when you scroll down again.

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