Swift 动画不';不行?
我正在尝试旋转一个imageview,但当我从另一个屏幕加载该屏幕时,动画不起作用Swift 动画不';不行?,swift,jquery-animate,uistoryboard,Swift,Jquery Animate,Uistoryboard,我正在尝试旋转一个imageview,但当我从另一个屏幕加载该屏幕时,动画不起作用 class LoadingRequestViewController: UIViewController ,UICollectionViewDelegate,GMSMapViewDelegate, CLLocationManagerDelegate { //UI OutletControls @IBOutlet weak var loadingImg: UIImageView! @IBOutlet var map
class LoadingRequestViewController: UIViewController ,UICollectionViewDelegate,GMSMapViewDelegate, CLLocationManagerDelegate {
//UI OutletControls
@IBOutlet weak var loadingImg: UIImageView!
@IBOutlet var mapView: GMSMapView!
@IBOutlet weak var containerView: UIView!
//UI OutletControls
override func viewDidLoad() {
super.viewDidLoad()
loadingImg.startRotating()
}
func TimerStoppedTrue() {
TimerStopped = true
NSLog("TimerStopped\(TimerStopped)")
}
@IBAction func CancelHireAction(sender: AnyObject) {
self.timer.invalidate()
self.CancelHire(self.HireID)
}
}
}
当我调用LoadingRequestViewController时,就像下面的动画一样,它不起作用。但单独地说,它起作用了
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("LoadingSTBID") as! LoadingRequestViewController
self.presentViewController(vc, animated: true, completion: nil)
尝试将其添加到ViewWillDisplay中。它应该很好用
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("LoadingSTBID") as! LoadingRequestViewController
self.presentViewController(vc, animated: true, completion: nil)