Q:

Inserting UIView into background and having textfield/button appear on top (SWIFT)

I want to create a login page in which the image I have fills up the entire page.  I was able to accomplish this by doing 
let imageView = UIImageView(frame: self.view.bounds)
imageView.image = UIImage(named: "background")
self.view.addSubview(imageView)

However, I also have textfields and buttons on my storyboard which I created outlets for on my swift file.  When I insert that code into the viewDidLoad() function, the textfields and login button go underneath the image rather than appear over the image.  I'm not exactly sure how to get the login page text fields/buttons to appear over the UIImageView rather than be hidden underneath.  The code I have for that is written outside the viewDidLoad 
(example)
@IBOutlet var usernameTextField: UITextField! 
@IBOutlet var passwordTextField: UITextField! 

@IBAction func loginPressed() {
    let username = usernameTextField.text
    let password = passwordTextField.text

A:

Try this:
self.view.addSubview(imageView)
self.view.sendSubviewToBack(imageView)

This method moves the specified view to the beginning of the array of views in the subviews property.