I'm new to Swift and iOS programming and I'm having a play with making some simple apps. I am trying to build a master-detail app.
In the master view I've given the tableview two sections and I've set the content of the table view to "static cells". Initially I gave each section 3 rows and was able to successfully run the app with the following code in the mainviewcontroller file:
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 2
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
I am now wanting to have 11 rows in the first section, and 5 rows in the second section but the changes I have tried to the code prevent the app from running. I've tried:
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 16
}
and I've tried:
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 11
}
but it falls over. What am I doing wrong here?