UITableView scroll like in Yummly app - ios

I'm looking for a way to implement scrolling in UITableView similar to what is done in Yummly app, or like google play or whatsapp header, in which the top image sort of hangs or sticks, while the bottom content scrolls over it, until the content catches up with it.
Meaning, make it so that the cells will not scroll up together, but stick a little, like the section headers do, accept that with section headers the content scrolls below the section, and not on top of it.
Does anyone has any idea how this can be implemented in objective-c?
Thanks!

I have checked yummly and found the good solution for you i have used this for some of my application/demo as well.
https://github.com/destin-m/parallax_tableview
Please let me know if you require any other modification as well.
Regards.

Related

Swipe to delete on entire section in UITableView

I have a UITableView which has a variable amount of sections and every section has a variable amount of rows. Every section contains a section header, a section footer and the rows for that section. They are shown and displayed inside a container. Everything up until now works as expected. To demonstrate what my UITableView currently looks like:
I am now trying to implement the possibility to swipe left on the entire section, so that the header of the section, the rows inside this section and the footer of this section move to the left and display another UIView. I am capable of swiping the cells separately, but enabling this feature on the entire sections have caused headaches for the past two days. This is what I would like to achieve:
I have thought about implementing UIGestureRecognizers but I am afraid they might conflict with my UITableView. Also, I started implementing it, but I would not know how to move solely the section on which was swiped to the left.
Then I thought I could maybe implement a UIScrollView as container for each section. How I would accomplish this is still a mystery to me, but it seems like a possible solution if this could be done.
Furthermore I am out of ideas and stuck on how this should be done. It's something I have not found on the Internet so far - at least no working examples of some kind so I have zero inspiration on how to achieve the effect.
I therefor would like to ask if somebody has an idea of how this could work and what I have to keep in mind when implementing this. Every clue pointing me towards a working solution is gratefully appreciated!
EDIT: I have already seen the possible duplicate this afternoon. However, the suggestion there shows touchesBegan() on the header, which does not work in my case as I need the entire section to be "draggable".
I think one way you can implement this is with a vertical stackview containing views that contains a tableview and the trash icon. When a user swipes left on the tableview header, it will show the hidden trash icon in the view. I would think that each tableview only has one section so it will be easier to keep track of which "section" the user has swiped.
I have currently managed to arrange a similar solution. I take the rectangle of the section with rect(forSection:int), add a UIPanGestureRecognizer in which I add a UIView on top of the UITableView if touches began, I calculate the location of the finger and let the cudtom UIView follow. When a certain point (100 from left edge of the UITableView) is reached, the section gets removed with deleteSections(indexSet:with:).
This works. It does the job, but it adds an overlay to the section rather than pushing it to the left.
Therefor I am asking of someone knows if there is any way of setting the offset for one specific section or for an area of a UIView, so I can offset the rectangle of the section. I have been able to setContentOffset on the entire UITableView but this is not the desired result.
If there is no way to do this, I would consider keeping the solution I have now or maybe implement a snapshot feature which takes a screenshot and crops the rect of the frame, adding this UIImage to the custom view to simulate the section. But that would be tricky. Any ideas for this idea are also welcome.

Swift-How to add a parallax header like the one in Spotify?

I was wondering if anyone knew what the best way of creating a similar tableview header effect to the one in Spotify was. I have looked at libraries such as CSSStickyHeaderFlowLayout, but they are written in Obj-C and are for CollectionViews. What's basically got to happen is that as the user scrolls to find more tableview cells at the bottom, the header stays in the same place and the top cells start covering it. This is seen in the example section of the git page of the library above.
Thanks in advance for any help!
Try using the solution found here
The original example uses Obj-C but the asker's response uses Swift. They also make use of TableViews rather than CollectionViews

IOS Scrollable View inside another ScrollView

I need to implement this screen and I wonder if anyone can help me with ideas to solve some scenarios, basically the screen will contain a parallax effect in the top image, the entire screen must be scrollable, the problem I am faced when designing this screen It is the way I see I need to have a scrollview and a tableview that generates me the trouble of having the scrolls in the same direction.
I've read several post here about the problem of having scroll inside scroll for example: Nested UITableView inside another nested table , and what I want are actually ideas that can help me implement the screen below.
I just need suggestions of good practice, no one needs to worry about post code unless some lib to help with the problem or something.
I appreciate any help.
I finally solved my problem, I implemented a solution based on ParallaxTableView and is-it-possible-to-add-uitableview-within-a-uitableviewcell
And here is my project : UITableViewHeader
The trick on that (DEPENDS IF YOU REALLY WANT THAT BEHAVIOR) is having the image on the table view header. there are plenty of tutorials on github with sample implementation also.
e.g that one

How to implement scroll-then-fix items in iOS?

I have a problem but I don't know what keyword should I use to indicate this issue.. so I named it scroll-then-fix.
What I want to do is make element behave as below
It scrolls up and down with other contents
When scrolling up, when it reaches the top of the screen, it does not go up anymore and stays at the top, while other contents continuously scrolls up.
For example, when you click any app in app store, the segmented control in the middle act like this.
I have no idea and I don't know what keyword I should search in google to find any information (I don't even know what this is called).
Please help me or give me a hint.
Thanks in advance.
How I would do that effect from the app store is that I would have a UITableView with 2 sections. The first would contain no section header and only one cell (containing the app icon, app name and "GET" button), and the second section would have a section header (containing the segmented control) which will stick to the upper side of the screen. The second section cells would contain the app screenshots, description etc.
Plain style UITableView's header behaves like that. Try it.

iOS: UITableView parallax header effect like Spotify

I recently received the latest Spotify iPhone/iPod update and thought their new UI was fantastic. I want to try to replicate their playlist parallax effect, Im struggling to grasp what it is that they have done though. I've uploaded a video to YouTube displaying the effect I want to achieve. My best guess is that they're using some kind of custom table header, since it sticks to the top and some scrollview delegate to show/hide different labels. Anybody out there who can figure this one out?
I've found things like this where they have a UIImageView behind the tableview but that doesn't really replicate the header-like behavior where a bit of the image sticks to the top. Also, having the controls for 'back' and 'options' would be a hazzle.
You can use CSStickyHeaderFlowLayout, but it's for CollectionView headers.

Resources