Skip to content

Instantly share code, notes, and snippets.

@IsaAliev
Created October 18, 2020 09:36
Show Gist options
  • Save IsaAliev/f11d54bb5b281b617393b936bdbde859 to your computer and use it in GitHub Desktop.
Save IsaAliev/f11d54bb5b281b617393b936bdbde859 to your computer and use it in GitHub Desktop.
extension ProfileViewController: UICollectionViewDelegateFlowLayout {
func collectionView(
_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
referenceSizeForHeaderInSection section: Int
) -> CGSize {
.init(width: 1.0, height: 30.0)
}
func collectionView(
_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAt indexPath: IndexPath
) -> CGSize {
let width = collectionView.frame.width - collectionView.contentInset.left * 2.0
return .init(width: width, height: 50.0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment