Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

grandM

macrumors 68000
Original poster
Oct 14, 2013
1,553
309
Hi everyone

I have a static table view. I want to set the background using the instance property of UITableView. I've added a subclass of UITableViewController and set the class. I've added the following code:
Code:
override func viewDidLoad() {

        super.viewDidLoad()

      

      

        // Uncomment the following line to preserve selection between presentations

        // self.clearsSelectionOnViewWillAppear = false



        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.

        // self.navigationItem.rightBarButtonItem = self.editButtonItem

        let imageView = UIImageView(image:  imageLiteral(resourceName: "key "))

        imageView.contentMode = .right

        imageView.alpha = 0.2

//                imageView.frame = tableView.frame

//        view.backgroundColor = UIColor(patternImage: #imageLiteral(resourceName: "key "))

        tableView.backgroundView = imageView

    }

For some reason I cannot see the table view any longer. What am I doing wrong?
Thanks for your answer
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.