I wonder if I can add my form within a UIView instead of a ViewController, I need some graphics on the top, just before of the Form
Just make a UITableView where you want your form to be and then hook it up to the tableView IBOutlet in FormViewController.
Exactly, your tableView does not have to occupy the whole screen.
@pwicks86 @christianhr any code sample. how to hook it up?
I tried something and it builds but crashes. thanks
import UIKit
import Eureka
class ViewController: UIViewController {
@IBOutlet weak var tableFormView: FormViewController!
override func viewDidLoad() {
super.viewDidLoad()
tableFormView.form = Section()
<<< TextRow(){ row in
row.title = "Text Row"
row.placeholder = "Enter text here"
}
+++ Section()
}
}
I get an error on this when i try with Swift 3

@mats-claassen How exactly is this done? I've tried following the above recommendation but I've hit a wall. In IB there is no outlet called tableView in the Connections inspector.

The second attempt I made was to override the tableView property but again I hit a wall. Two compilation errors:
Overriding non-open var outside of its defining module and Cannot override with a stored property 'tableView'.

The third attempt I made was to programmatically set constraints on tableView which does work but is a bit of an inconvenience.
override func viewDidLoad() {
super.viewDidLoad()
tableView?.translatesAutoresizingMaskIntoConstraints = false
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[tableView][footerButton]|", options: [], metrics: nil, views: ["tableView" : self.tableView!, "footerButton" : footerButton]))
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[tableView]|", options: [], metrics: nil, views: ["tableView" : self.tableView!]))
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[footerButton]|", options: [], metrics: nil, views: ["footerButton" : footerButton]))
...
@pouriaalmassi Did you install Eureka by Carthage? I had that issue as well. It seems to be an bug between Carthage and XCode and I applied the hackaround described in this issue:
@developerdalelaw I am using Carthage to install Eureka. Will file a bug if there isn't one already. Thanks for the tip!
Hi Reopening this one, I'm using cocoa pods and trying to use a uiview instead of the uiviewcontroller, any suggestion on how I can achieve this? I'm using latest pod version, swift 3 Hoping for your kind response. Thanks.
@rjjohnpatrickcruz Here's what worked for me:
I believe you have to use a UITableView, not a UIView.
grouped rather than plaintableView circle in the Outlets panel in the Connections Inspector. This outlet is provided by Eureka's FormViewController so there is no need to override it or create a new @IBOutlet for the table view
form variable now references your UITableView: override func viewDidLoad() {
super.viewDidLoad()
form +++ Section() { section in
section <<< TextRow() {// etc...
}
}
Thanks, @nikarc !
Old thread but I think this could be a part of documentation... :) Or maybe I should've known it as common iOS knowledge but I hadn't encountered this situation before where the outlet is defined in the inherited parent class.
@stami I agree, this should be part of the documentation.
this is the process to add borders:





I hope this helps someone - I appreciate this isn't exactly what the question was about but I had to put this somewhere it has taken me two days to figure this out.. there is very little online other than people asking asn other people not telling them exactly what to do
Most helpful comment
@rjjohnpatrickcruz Here's what worked for me:
I believe you have to use a
UITableView, not aUIView.groupedrather thanplaintableViewcircle in the Outlets panel in the Connections Inspector. This outlet is provided by Eureka'sFormViewControllerso there is no need to override it or create a new@IBOutletfor the table viewformvariable now references yourUITableView: