Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

rotate image animated swift

extension UIView{
    func rotate() {
        let rotation : CABasicAnimation = CABasicAnimation(keyPath: "transform.rotation.z")
        rotation.toValue = NSNumber(value: Double.pi * 2)
        rotation.duration = 1
        rotation.isCumulative = true
        rotation.repeatCount = Float.greatestFiniteMagnitude
        self.layer.add(rotation, forKey: "rotationAnimation")
    }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: remove padding hstack swiftui 
Swift :: dark mode change immediately swift 
Swift :: Make a VStack fill the width of the screen in SwiftUI 
Swift :: swift core data sort by date 
Swift :: swift replace all characters except numbers 
Swift :: swift ui enum 
Swift :: change the title of a button using Swift 
Swift :: how to style textfield swiftui 
Swift :: swift string to dictionary 
Swift :: We use the for loop to iterate over the elements of a dictionary. 
Swift :: string value of enum swift 
Swift :: swift arrays 
Swift :: for loop swift 
Swift :: swift close view 
Swift :: swift convert string to int 
Swift :: Swift Remove an Element from an Array 
Swift :: swift array map to another array 
Swift :: deselect all cell in collectionview 
Swift :: did select row at 
Swift :: How to remove the last item from an array in swift 
Swift :: two integer variable in swift 
Swift :: tap to delete xcode 
Swift :: xcode how to get aspect ratio of device 
Swift :: Swift Operators 
Swift :: Swift Function With inout Parameters 
Swift :: swift converting time string to number 
Swift :: Generic Function Swift 
Swift :: Notification Service Extension vs Content Extension 
Swift :: how to read music library from iphone programmatically in swift 
Swift :: Strong Reference in Swift 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =