ios - Accessing an outlet in another class (Swift) -
i trying access outlet, imageview, in class. when type outlet name, generates error, outlet in class. how access imageview outlet in class?
code:
//class trying call outlet in override func viewdidload() { super.viewdidload() if photosasset == nil { //error: use of unresolved identifier: myimageview, since myimageview in class photothumbnail myimageview.image = "" } //class oulet class photothumbnail: uicollectionviewcell { @iboutlet var myimageview : uiimageview! }
create photothumbnail object
var photothumbnail = photothumbnail() // without initializers
then
photothumbnail.image
since collectionviewcell, in cellforitematindexpath method
Comments
Post a Comment