Skip to content

Instantly share code, notes, and snippets.

@nakiostudio
Last active March 14, 2017 08:33
Show Gist options
  • Save nakiostudio/51dfbeaff68291a6415bac9de7ad9c76 to your computer and use it in GitHub Desktop.
Save nakiostudio/51dfbeaff68291a6415bac9de7ad9c76 to your computer and use it in GitHub Desktop.
// Never tried to run this code so expect compilation
// issues
func viewDidLoad() {
super.viewDidLoad()
// ScrollView
self.view.addSubview(self.scrollView)
self.scrollView <- Edges(0.0)
// CollectionView
self.scrollView.addSubview(self.collectionView)
self.collectionView <- [
Size(0.0).like(self.scrollView),
Left(0.0).to(self.scrollView, .left),
Top(0.0).to(self.scrollView, .top),
Bottom(0.0).to(self.scrollView, .bottom)
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment