An example with tableview in detail screen
Hey @aunnnn,
Great job, this is the only implementation is near perfect so far done for appstore like animation.
I am trying to use your idea, implemented the same but when i am using the tableview i need to match the card cell from listing to inner tableview top header uiview which cannot have contraint. but both are same card content view.
Somehow it works, but weired presentation animation goes to top, then bounces and lands to the screen from left to right.
Please have a look at this and suggest any workaround @aunnnn 🙏🏻 waiting for your response. https://youtu.be/NeYoFmCMz6k?t=3s
Hi @prajwalsprakash, thanks for checking this out.
It's hard to tell what happens from the video you sent, as I'm not sure how things are laid out in each step.
But yeah the animation is the hardest part since it has a lot going on (etc. constraints, temporary views) that you need to keep track of. (Aside: I recently found a way to achieve similar presentation without a container view, if you'd like to simplify things a bit.)
Also, the table header view further complicates this. The table view does some unknown magic to layout it. You might try the animation on a normal view first to see if the culprit is the table header view's magic or not, or whether the animation code is wrong, etc..
But if I were you I'd probably handle the table view and the view at the top separately. Like have a card content view at the top as a normal subview with constraints, and have a table view behind it under the same parent, with the top inset adjusted to the height of the card content view. Then manually manage scroll delegate to sync the two of them. (Or any other ways you can think of to avoid card content inside the table header view.)
@aunnnn You're right, the culprit is the tableheader view since we don't set any constraint to it & managed by table view it acts weird.
As you said "have a table view behind it under the same parent, with the top inset adjusted to the height of the card content view" I had this option in mind after carefully looking the autolayout u manage in the storyboard, I was trying to figout to fix with keeping that tableheader which could be easier to manage, now it turnedout as a nightmare, i gotta fix as you said.
Thanks a lot for responding back, will get back to you once i am able to fix that.
You're welcome.
Actually, I've tried to use AutoLayout with table header view with some success. But I still faced some weird bugs whenever I do something more than putting a view there (animation/AutoLayout with the parent of parent's view, etc.), so I gave up using it and use the first cell as a header instead.
Cool, I will make it as first cell and try. if that succeeds I may not change anything. But the worries are how to set the CardContentViews constraints from the cell to parent view? or is that not necessary?
After making this change i got animation very slow while presenting, but it's better than that top bounce issue. Hey @aunnnn Wanted to ask you, kindly help me out. if u could look at my code once? it will be much helpful. (i shall share an access in bitbucket to ur gmail id.)