Swift: Recreating AppStore - Horizontal Scroll Direction UICollectionView (Ep 1)

Lets Build That App · 82K views · 2016 · 35:52

Open on YouTube

Software (other)Testing, debugging & developer toolstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering how to build horizontal scrolling UICollectionViews or nest a collection view inside a collection view cell.

Recommended by 3 people across 3 different months, 2016 to 2017.

What it is

A 36-minute Swift tutorial from Lets Build That App, the first episode in a series recreating Apple's App Store layout programmatically. It builds a vertical collection view whose cells each contain a horizontally scrolling collection view, then adds icon, title, category and price labels to the inner cells.

What people said

Recommends Ian Moses · 2016-10 · Stack Overflow · on “How do I create a horizontal scrolling UICollectionView in Swift?”

Where you have a reference to your UICollectionViewFlowLayout() , just do: layout.scrollDirection = .horizontal Here is a nice tutorial for more info: [this video] Though for historical purposes, consider searching StackOverFlow quickly to make sure this isn't a duplicate. Hope this helps. Update: Your items will fill horizontally first and if there is not enough room within the collectionview going to the right, they will go to next row. So, start by increasing your collectionview.contentsize (should be larger the screen to enable scrolling) and then set your collectionview item (cell) size. flowLayout.itemSize = CGSize(width: collectionView.contentSize.width/5, height: collectionView.contentSiz

Recommends Saoud Rizwan · 2016-11 · Stack Overflow · on “How to add a button to the end of UIScrollView to load more?”

So let's first think about how we initialize our table view. We use func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int to return the number of cells we want in the table, so let's say we use something like return searchResultsArray.count but if we want a "Load More Results" button, then let's add 1 more cell return searchResultsArray.count + 1 Okay great, now how do we add the button in this new cell? We want to use func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell and we'll say if indexPath.row == searchResultsArray.count (remember that an array's count value is 1 greater than the index of the last element in the

Recommends RLoniello · 2017-11 · Stack Overflow · on “UITableView Separators and Disclosure Indicator missing after altering UITableViewCellActionButton”

Oh, I didn’t realize you where that new to iOS development. I recommend you get familiar with uicollectionview instead it can implement all of the features of uitableview and more. In your situation you can have a vertical scrolling collection view cell that holds another horizontally scrolling cell with a button that is ‘hidden’ off screen. these cell-views are uiviews that are completely customizable and dequeue-able. check out this tutorial it’ll get you pretty close. [this video]

Cites Fernando Cardenas · 2017-01 · Stack Overflow · on “UICollectionView in a UICollectionViewCell”

Everything is done programatically. No storyboards. I added a UICollectionView inside my UICollectionViewCell. I also show how to add again a UICollectionViewCell inside the created UICollectionView to have this result [LINK] import UIKit class CategoryCell: UICollectionViewCell, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { private let cellId = "cell" override init(frame: CGRect) { super.init(frame: frame) setupViews() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } let appsCollectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() let collectionView = UICollectionView(frame: .