The Extension The following code adds a method to any UIView instance called rotate360Degrees. The code can be placed in a Swift file called “UIViewExtensions.swift”: 1import UIKit 2 3extension UIView { 4 func rotate360Degrees(duration: CFTimeInterval = 1.0, completionDelegate: AnyObject? = nil) { 5 let rotateAnimation = CABasicAnimation(keyPath: "transform.rotation") 6 rotateAnimation.fromValue =

