Last active
May 18, 2020 17:27
-
-
Save wdchris/ba89c28cc459e41051c559409de10e2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidLoad() { | |
super.viewDidLoad() | |
contentView.addSubview(collectionView) | |
collectionView.topAnchor.constraint(equalTo: self.contentView.topAnchor, constant: 0).isActive = true | |
collectionView.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor, constant: 0).isActive = true | |
collectionView.leadingAnchor.constraint(equalTo: self.contentView.leadingAnchor, constant: 0).isActive = true | |
collectionView.trailingAnchor.constraint(equalTo: self.contentView.trailingAnchor, constant: 0).isActive = true | |
} | |
lazy var collectionView: UICollectionView = { | |
let layout = collectionViewFlowLayout | |
let collectionView = UICollectionView(frame: self.contentView.frame, collectionViewLayout: layout) | |
collectionView.backgroundColor = UIColor.white | |
collectionView.translatesAutoresizingMaskIntoConstraints = false | |
return collectionView | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment