Skip to content

Instantly share code, notes, and snippets.

@tiagomartinho
Created November 25, 2015 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagomartinho/8620c4d46d9078f36b58 to your computer and use it in GitHub Desktop.
Save tiagomartinho/8620c4d46d9078f36b58 to your computer and use it in GitHub Desktop.
Swift Add View Extension
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