Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

sahandnayebaziz/SnapKit-Samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An example of one of the samples...

...

override func viewDidLoad() {
        super.viewDidLoad()

        // Initialize your new subviews
        let myBlueRectangle = UIView()
        myBlueRectangle.layer.borderColor = view.tintColor.CGColor
        myBlueRectangle.layer.borderWidth = 2
        
        let myOrangeRectangle = UIView()
        myOrangeRectangle.backgroundColor = SamplesColors.orange
        
        // 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!
        //
        view.addSubview(myBlueRectangle)
        myBlueRectangle.addSubview(myOrangeRectangle)
        
...

Enjoy!

About

Learn how to use SnapKit with samples and a framework for adding your own!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published