All things iOS & Swift

iOS animation with Swift part1

Create a UIView named view1

let view1 = UIView(frame: CGRectMake(,, 60, 60))

change the background color of the view to any preferred color

view1.backgroundColor = UIColor.redColor() start animating the view by using animateWithDuration(duration: animations:)

UIView.animateWithDuration(5, animations: { () -> Void in = CGPoint(x: 0, y: 0)

finally, add your view as a subview


Leave A Comment

Your email address will not be published.