-1

I'm trying to make a custom tableViewCell

This is how it looks like

I've created new file type "Cocoa Touch Class" as UITableViewCell

Now I'm making variables for label and image like this:

@IBOutlet weak var goodImage: UIImageView!
    @IBOutlet weak var goodTitle: UILabel!

And now as I think I have to connect them with objects from prototype cell, I'm trying to do it by such way

But it's don't want me to connect IBOutlet with object using this method. How should I do it correctly?

SwiftStudier
  • 2,272
  • 5
  • 21
  • 43

2 Answers2

2

My mistake was that I did not select my TableViewCellClass in right place

SwiftStudier
  • 2,272
  • 5
  • 21
  • 43
0

Click on the Image View and go to connection inspector and drag the referencing outlet to the UIView Controller top section which is marked in the red in below screenshot and select your outlet.

enter image description here

Hope this might help you.

Karlos
  • 1,653
  • 18
  • 36
  • I did what you suggested but not understood how to do what I need - to connect outlets from separate tableViewCell.swift-file to elements from SecondViewContoller. Screenshot: http://ipic.su/img/img7/fs/Snimokekrana2015-08-18v0.1439845704.png – SwiftStudier Aug 17 '15 at 21:09
  • Are you talking about the tableview cell values passing from the second view controller? – Karlos Aug 18 '15 at 04:08
  • I want to connect outlets from file which I created with class TableViewCell with elements from SecondVC to use it like "..., as TavleViewCell!" – SwiftStudier Aug 18 '15 at 06:29
  • 1
    i have added this class but when i open the assistant editor it only shows tableviewcontroller class not my viewcell class.need help please – Nouman Ch Oct 06 '17 at 01:22