iOS Spin UIImageView with deceleration motion at random position
问题 I trying to create a spin wheel which rotate on tap and it rotates for certain period of time and stops at some random circular angle. import UIKit class MasterViewController: UIViewController { lazy var imageView: UIImageView = { let bounds = self.view.bounds let v = UIImageView() v.backgroundColor = .red v.frame = CGRect(x: 0, y: 0, width: bounds.width - 100, height: bounds.width - 100) v.center = self.view.center return v }() lazy var subView: UIView = { let v = UIView() v.backgroundColor