
So make sure you’ve used the right case or you’ll be wondering why it doesn’t show up sometimes. The filename for the image is case sensitive on iOS devices but not in the simulator. Let backgroundImage = UIImage(named: "GrokSwiftLogo500.png") You’ll need to drag an image into your project (just drop it in to the list of files on the left) then use it to create a UIImage.: To add a background image to a table view we can use the backgroundView property. We’ll start by adding the background image then we’ll see how we can improve our demo app to make it look nicer. That demo project is convenient because you can easily add and remove table view cells to see how your background looks with more or fewer cells over it.

That’ll give you a MasterViewController that’s a UITableViewController so you can work with its table view. If you want a project to play with, open Xcode and create a new Swift Master-Detail project. I’ll be using a UITableViewController as a demo but this tutorial will work with any UITableView. This tutorial was written using Swift 2.0 and Xcode 7.1. I found that the color wont change when I use the Storyboard to set the background color of UIView. Here’s what the demo will look like when we’re done:

We’ll tweak the transparency so the table view cells look ok, stop extra empty cells from hiding the background image, and center & scale the image so it doesn’t get stretched.
#Storyboard quick change background color how to#
There are a few pitfalls to make it look just right so let’s walk through how to add a background image to a UITableView.

A background image behind a table view can make your app look nicely customized without a ton of effort.
