Implementation of Twitter's iOS app profile screen

Asked 2 years ago, Updated 2 years ago, 93 views

The whole is a UITableView, where tweets, tweets and replies are section,
Below that, I expect UIContainerView to manage TableView.
How do you ensure that TableView scrolls in UITableView do not interfere?

Twitter

swift ios xcode twitter

2022-09-30 20:22

1 Answers

I made it quickly

Twitter Like UI
As a precondition, I don't know what's going on inside Twitter.
Global apps are surprisingly implemented.

As for how to create a similar UI, I will write down the flow that I thought about.

·Nested in the same Scroll direction is not very realistic (experience),
It's really dangerous (very difficult) to convert the amount of scrolling, especially with two.
So there's probably one vertical scroll. ·I think the four views are TableView, because you can scroll endlessly
·I think the four TableViews are managed by a horizontal ScrollView
PageViewController may also be a PageViewController, but in the case of PageViewController, the load runs when you transition to View, and Twitter is loaded first.
(Compare with the smartphone, I think that's the PageView Controller.)
·Headers are moving due to the influence of four TableViews.
So it doesn't belong to any of the Views, it exists under self.View (this is the trap)
·Headers move according to TableView contentOffset
Moving the TopConstraint on the header from scrollViewDidScroll is relatively easy.
·The top of TableView will be hidden in the header, so I will open the top with contentInset

Now that I know it, I don't think I'm doing anything tricky.

Leave the source code
https://github.com/osanaikoutarou/TwitterLikeUI

By the way, it's made roughly, so if you scroll through TableView and then switch to the side, the header will be misaligned.
When I touched the main house, it seems that the detailed specifications are hidden (handling 4 scroll positions)


2022-09-30 20:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.