//Works for iOS 10+ UIViewPropertyAnimator(duration: 3.0, curve: .easeIn) { square.layer.cornerRadius = 20 }.startAnimation()