动画

r view in myViews {
            UIView.transition(with: self.view, duration: 3.0, options: .allowAnimatedContent,
                animations: {
                                
                let new_xpoint = Int(arc4random() % UInt32(self.view.frame.size.width))
                let new_ypoint = Int(arc4random() % UInt32(self.view.frame.size.height))
                                
                view.center = CGPoint(x: new_xpoint, y: new_ypoint)
                
            },
                completion: nil)
        }

你可能感兴趣的:(动画)