Adding Background Image into View Controller

You need to set the background for your ViewController's view

In your ViewController init or viewDidLoad:

[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]]];

Swift 4 version of the @hadaytullah answer with some improvements in image adjustments:

override func viewDidLoad() {
    super.viewDidLoad()

    let backgroundImage = UIImage.init(named: "yourImageNameHere")
    let backgroundImageView = UIImageView.init(frame: self.view.frame)

    backgroundImageView.image = backgroundImage
    backgroundImageView.contentMode = .scaleAspectFill
    backgroundImageView.alpha = 0.1

    self.view.insertSubview(backgroundImageView, at: 0)
}

The accepted answer and Michael's answer will work, however, proper way is to use a UIImageView instead. It gives more control over resizing, scaling etc according to different screen sizes on devices. Here is the example;

First create a UIImage.

UIImage *backgroundImage = [UIImage imageNamed:@"iphone_skyline3.jpg"];

Second create a UIImageView. Set the frame size to the parent's (self) frame size. This is important as the frame size will vary on different devices. Stretching will occur depending on the image size. Next assign the image to the view.

UIImageView *backgroundImageView=[[UIImageView alloc]initWithFrame:self.view.frame];
backgroundImageView.image=backgroundImage;

Finally, to keep the image behind all controls do the following. It is important if you are setting the image as a background for your app.

[self.view insertSubview:backgroundImageView atIndex:0];

Here is how it is in swift:

override func viewDidLoad() {
    super.viewDidLoad()
    self.view.backgroundColor = UIColor(patternImage: UIImage(named: "background.png"))
}