ios - UIView and NSLayoutConstraint nil when called in another class -


i want .constant value changed constraint have setup in storyboard. every time try set variables pass inout function nil. appreciated. map out problem below.

spinningwheel.swift

override func touchesbegan(touches: set<uitouch>, withevent event: uievent?) {   //  // call function on wheelviewcontroller display alert wheel spinning  //  var view: uiview = wheelviewcontroller().geniebusyalertview  var constraint: nslayoutconstraint = wheelviewcontroller().geniebottomlayoutconstraint  wheelviewcontroller().wheeltappedwhileactive(&view, &constraint) 

wheelviewcontroller.swift

@iboutlet var geniebusyalertview: uiview! @iboutlet var geniebottomlayoutconstraint: nslayoutconstraint!  override func viewdidload() {     super.viewdidload()  // view or constraint referenced here, in storyboard. }  func wheeltappedwhileactive(inout view: uiview, inout _ constraint: nslayoutconstraint) {      uiview.animatewithduration(0.5, delay: 0.0, options: uiviewanimationoptions.curveeaseout, animations: {          constraint.constant = 251         view.layoutifneeded()         view.layer.shadowcolor = uicolor.blackcolor().cgcolor         view.layer.shadowopacity = 0.7         view.layer.shadowoffset = cgsizezero         view.layer.shadowradius = 5         }, completion: {(true) in              //nothing here yet.     })      uiview.animatewithduration(0.5, delay: 3.0, options: uiviewanimationoptions.curveeaseout, animations: {          constraint.constant = -100         self.view.bringsubviewtofront(view)         view.layoutifneeded()         }, completion: {(true) in              //nothing here yet     }) } 

i trying grab uiview, geniebusyalertview , nslayoutconstraint geniebottomlayoutconstraint in 1 class, pass them function on class update constraint constant animate. awesome. in advance time , brain power use on problem.


Comments