swift - How to reference a property from exact instance from another class? -
i've found similar questions none of solutions seem work. problem:
- i have class,
generalpostareacontroller: uiviewcontroller
- it has property, "
queryobject
" defined "parsequeryer()
" (custom class created data objects) - essentially "
queryobject
" stores data create post - i have another class (which separate file) ,
posttableviewcell: uitableviewcell
- i want reference "
queryobject
" insideposttableviewcell
can actions data inside "queryobject
"
code below:
class generalpostareacontroller: uiviewcontroller { var queryobject = parsequeryer() ...other code here
in file:
class posttableviewcell: uitableviewcell { //reference queryobject here
thank you! btw new programming , swift.
quick , dirty solution let queryobject
static variable.
class generalpostareacontroller: uiviewcontroller { static var queryobject = parsequeryer() }
then, can access queryobject
anywhere in application this:
generalpostareacontroller.queryobject
Comments
Post a Comment