André Kuhlmann
André Kuhlmann

Reputation: 4668

Swift static table view disappears when connected to table view controller

I have created a simple static table view in my main storyboard but every time I hook up a blank UITableViewController the static view is not loading.

It should look like this (no controller file connected) When connected it looks like this

Upvotes: 4

Views: 1141

Answers (1)

Matthias Bauch
Matthias Bauch

Reputation: 90117

Remove the default implementations of numberOfSectionsInTableView() and tableView(numberOfRowsInSection:) from your UITableViewController subclass.

i.e. remove those methods because they return 0:

func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    return 0
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return 0
}

Upvotes: 9

Related Questions