Swift: YouTube - How to Swipe between sections horizontally (Ep 12)

Lets Build That App · 80K views · 2016 · 26:17

Open on YouTube

Software (other)Web developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a worked example when asking or answering how to build swipeable pages with a paging collection view and a synced top menu bar in iOS.

Recommended by 0 people across 0 different months, 2016 to 2021.

What it is

Episode 12 of the 'Building YouTube' iOS series by Lets Build That App. It shows how to make a UICollectionView scroll horizontally with paging so users can swipe between sections, and how to sync that with a custom menu bar's highlight and slider.

What people said

Cites user6248853 · 2016-07 · Stack Overflow · on “Collectionview cell with both direction”

Yes you can. I think, iPhone Youtube app is created in the same fashion!! :) You can create a CollectionView controller with its collection view set to horizontal scrolling, set the collectionView cell size to the screen size. And set the paging enabled property of collection view to true. THis will allow you to scroll horizontally as if each cell was a page itself. Next up, you can add another collection view to each of these cells, with vertical scrolling property of this collection view. THis can be achieved very easily by subClassing UICollectionViewCell of the CollectionViewController. In the subclass, each cell must have a UICollectionView property. Remember that the UICollectionView i

Cites Okan Kocyigit · 2017-02 · Stack Overflow · on “Swipe views in one ViewController”

If you're trying to learn how it works, You can search for UIPageControl [LINK] , this [LINK] method works for multiple UIViewController And what I suggest you is creating a UICollectionView [LINK] with paging scroll in just one UIViewController. Here [this video] is an example to follow, Or if you just want to do, you can use PageMenu [LINK] . [LINK]

Cites BVB09 · 2021-04 · Stack Overflow · on “How to scroll to a given indexPath.item?”

I have 2 collection views in parallel. One of them is a menu and the other is a big one containing vertical table views that are populated with API queried data. [LINK] When the user scrolls right, then Order History is highlighted and the next cell in the big collection view at the bottom takes over the rest of the screen and it shows its own tableview data. It's just like the implementation here [this video] . Everything works EXCEPT when I tap on Order History in the state indicated in the attached image, the collection view at the bottom does not scroll to the 2nd cell in the big collection view. If I tap on the Current Orders cell then it does scroll to the 1st cell in the big collection vie