Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is Twitter profile screen in iOS version built?

I'm wondering how did Twitter implement it's profile screen. At first I thought it is a table view with a header (profile info) and section header (segmented control to choose tweets/media/favorites). It would make sense for me as the profile info goes away while user scrolls down, but segmented control stays, and that's exactly behavior of plain UITableView header view and section header. There is also an image view at the top, under navigation bar, but that's not what's important for me. Here's a visualization of what I think it is:

Twitter profile screen architecture (my visualization)

I tried to recreate it in Interface Builder and that's what I got. The slider drew my attention: it's different than in Twitter app, it starts at the top of table view header, not at the top of cells.

My implementation in Interface Builder Twitter's slider is different

So… how did they achieve it? Did they put a UITableView in a UIScrollView and handled touch/scroll events themselves? I don't think so, since it's discouraged, but I can't think of another explanation.

like image 825
raven_raven Avatar asked Aug 09 '15 18:08

raven_raven


1 Answers

I'm not sure about the slider, but here they did pretty good job with mimic twitter profile view. So take a closer look, maybe you'll find this helpful.

like image 117
Juri Noga Avatar answered Oct 01 '22 18:10

Juri Noga