I've just started teaching myself to write in Swift. I'm currently trying to rotate an image when I press a button (just practicing with really simple stuff) and Xcode has thrown two errors at me:
Referencing operator function '*' on 'SIMD' requires that '_.Scalar' conform to 'FloatingPoint'
String interpolation can only appear inside a string literal
I've searched around the web a bit for info on SIMD but I couldn't understand any of it! Can someone break it down for a clueless newbie? This is my code so far. Some of it is from online tutorials, some from Xcode's suggestions, some I just guessed:
@IBAction func spinButton(_ sender: Any) {
if self.rotationDegree != 360 {
self.rotationDegree += 1
//to increase the rotation by 1 degree
} else {
self.rotationDegree -= 360
//to put the rotation back to 0 degrees
}
UIView.animate(withDuration: 1.0, animations: {
self.vortex2.transform = CGAffineTransform(rotationAngle: \(rotationDegree) * .pi / \(rotationDegree))
//this is where both error messages appear
})
}