I want to have something like this
class MyView: FormViewController {
@IBOutlet weak var table: UITableView!
// etc..
}
However i am not able to implement the cellForRowAtIndexPath or numberOfRowsInSection because they are already implemented within the Eurka library. I tried to overwrite those functions as well without success:
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView.restorationIdentifier != "myTable" {
return tableView.numberOfRowsInSection(section)
}
return myDataType.count
}
It appears that you don't need to. I tried the same thing, dragging a UITableViewController to the storyboard and setting its class to be my cub class of FormViewController. This seems to have caused a bunch of issues, as FormViewController does a bunch of stuff already that may not be 100% workable with a standard UITableViewController. So I removed it and used a UIViewController instead.
The UIViewController has a view property and the table view is a sub view of that. This seems to work.
In my subclass, I just created the rows and sections using the eureka syntax, and did not set up my own table view or the delegate or the data source. This allows the rows to appear properly with the tags and values that I set.
Look at the example app, a lot of the stuff is in there.
Not sure this technically answers your question, but I hope it helps.
This is an old question but I came across a similar issue recently.
I would suggest using a container view and embed the FormViewController inside it.
This way you can have your table view in the parent UIViewController and access the form via the container. How to do that is explained in this answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With