Created
June 10, 2015 18:57
-
-
Save asiviero/c9e63b3607bf58373cab to your computer and use it in GitHub Desktop.
Background image to view in Swift
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
UIGraphicsBeginImageContext(self.view.frame.size); | |
var image = UIImage(named: "image") | |
image?.drawInRect(self.view.bounds) | |
UIGraphicsEndImageContext() | |
// This could also be another view, connected with an outlet | |
self.view.backgroundColor = UIColor(patternImage: image!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment