0

This code in viewDidLoad works for adding a background image to a tableView in a generic tableViewController, however using the Parse SDK, it does not add a background image in a PFQueryTableViewController. What am I doing wrong in the PFQTVC?

peopleTableView.backgroundView = UIImageView(image: UIImage(named: "SFStreetcar"))  
GarySabo
  • 5,806
  • 5
  • 49
  • 124

1 Answers1

2

Turns out simply placing the code inside viewWillLayoutSubViews did the trick:

 override func viewWillLayoutSubviews() {
        tableView.backgroundView = UIImageView(image: UIImage(named: "SFStreetcar"))
    }

If that doesn't work though @user2792129 's solution is worth exploring as well.

GarySabo
  • 5,806
  • 5
  • 49
  • 124