0

I have created the xib file(CustomView) with a image view and label. the class named CustomView.swift and it has the outlets. what i need is to use the xib in cell instead of designing in the cell itself. if it is possible then how to use the outlets from the CustomView.swift to SecondTableViewController.swift

my CustomView.swift

class CustomView: UITableViewCell {
@IBOutlet weak var CImageView: UIImageView!
@IBOutlet weak var CLabel1: UILabel!
/*
}

SecondTableViewController.swift

 override func viewDidLoad() {
    super.viewDidLoad()
    tableView.registerNib(UINib(nibName: "CustomView", bundle: nil), forCellReuseIdentifier: "Cell")
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("Cell")as! CustomView
    return cell
}

shows errorerror screen

after cell edit image

Aravindh Kumar
  • 1,213
  • 11
  • 22

0 Answers0