This repository has been archived by the owner. It is now read-only.
Learn how to use SnapKit with samples and a framework for adding your own!
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
SnapKit Samples.xcodeproj
SnapKit Samples

An example of one of the samples...


override func viewDidLoad() {

        // Initialize your new subviews
        let myBlueRectangle = UIView()
        myBlueRectangle.layer.borderColor = view.tintColor.CGColor
        myBlueRectangle.layer.borderWidth = 2
        let myOrangeRectangle = UIView()
        myOrangeRectangle.backgroundColor =
        // Add your subviews to the view heirarchy.
        // * Notice here that myBlueRectangle is added as a subview of 'view', the view controller's view, 
        //   while myOrangeRectangle is added as a subview of myBlueRectangle! Voilà! You have nested views!
        //   Now that each view is a subview of another view, we can use constraints to position them how we'd like!