Skip to content

Instantly share code, notes, and snippets.

@gwennguihal
Last active July 18, 2017 20:54
Show Gist options
  • Save gwennguihal/0000c7d76ce0e6c7c93cb5d03669df19 to your computer and use it in GitHub Desktop.
Save gwennguihal/0000c7d76ce0e6c7c93cb5d03669df19 to your computer and use it in GitHub Desktop.
import Collor
final class TitleDescriptor: CollectionCellDescribable {
let identifier: String = "TitleCollectionViewCell"
let className: String = "TitleCollectionViewCell"
var selectable:Bool = true
let adapter: TitleAdapter
init(adapter:TitleAdapter) {
self.adapter = adapter
}
func size(_ collectionView: UICollectionView, sectionDescriptor: CollectionSectionDescribable) -> CGSize {
let sectionInset = sectionDescriptor.sectionInset(collectionView)
let width:CGFloat = collectionView.bounds.width - sectionInset.left - sectionInset.right
return CGSize(width:width, height:50)
}
public func getAdapter() -> CollectionAdapter {
return adapter
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment