func createRadarView(){
UIView.animateWithDuration(0, delay: 3, options: UIViewAnimationOptions.Repeat, animations: { () -> Void in
self.rotationView.transform = CGAffineTransformMakeRotation(M_PI_4)
}) { (Bool) -> Void in
}
}
这么写总报上图的错误,不知道什么原因
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
CGAffineTransformMakeRotation 的参数类型得是 CGFloat,你把 M_PI_4 转成 Double 就行,
CGFloat(M_PI_4)
。最后一个闭包的签名应该是 ()->Void吧
因为 duration 为 0。你在想什么?
看不懂你这个报错是咋出来的,虽然代码上CGAffineTransformMakeRotation参数类型不对,但是报错说的却不是这个事,报错应该出现在CGAffineTransformMakeRotation那一句上