Created
January 14, 2016 22:11
-
-
Save xyclos/92ea1ac63dd192ab4ba1 to your computer and use it in GitHub Desktop.
Set image as background
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 | |
class ViewController: UIViewController { | |
var imageView: UIImageView? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let screenSize: CGRect = UIScreen.mainScreen().bounds | |
if let image = UIImage(named: "autumn.jpg") { | |
imageView = UIImageView(image: image) | |
imageView!.frame = screenSize | |
view.addSubview(imageView!) | |
} | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment