Created
November 25, 2015 13:13
-
-
Save tiagomartinho/8620c4d46d9078f36b58 to your computer and use it in GitHub Desktop.
Swift Add View Extension
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
import UIKit | |
extension UIView { | |
func addView(viewToAdd:UIView){ | |
viewToAdd.frame = self.bounds | |
viewToAdd.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight] | |
self.addSubview(viewToAdd) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment