ios - Activity Indicator doesn't work in Swift -
i trying show simple activity indicator when view controller loads until segue performed. want start activity indicator on viewdidload have had no luck far.
this code trying use:
import uikit class loadingscreen: uiviewcontroller { //activity indicator view @iboutlet weak var activityindicatorview: uiactivityindicatorview! override func viewdidload() { super.viewdidload() //start animating self.activityindicatorview.startanimating() } } i error: exc_bad_instruction assume means there's problem code i'm using.
i stop after function called delay:
delay(2.5) { self.activityindicatorview.stopanimating() }
assuming iboutlet working correctly (as mentioned in comment above). want stopanimating activityindicatorview within prepareforsegue:sender: method.
override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { // might not need if statement if (segue.identifier == "nameofyoursegue") { self.activityindicatorview.stopanimating() } }
Comments
Post a Comment