Skip to content

Instantly share code, notes, and snippets.

@tifoaudii
Created April 5, 2020 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tifoaudii/ca5632eee49a4589926965b022679c94 to your computer and use it in GitHub Desktop.
Save tifoaudii/ca5632eee49a4589926965b022679c94 to your computer and use it in GitHub Desktop.
let layout = UICollectionViewCompositionalLayout { (sectionIndex: Int, _ ) -> NSCollectionLayoutSection? in
let movieSections = MovieSection.allCases[sectionIndex]
switch movieSections {
case .topRated: return self.createTopRatedMovieSection()
case .onGoing: return self.createOnGoingMovieSection()
case .upcoming: return self.createUpcomingMovieSection()
case .popular: return self.createPopularMovieSection()
}
}
return layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment