How to animate view with constraint?
Answer / Chhavi Sharma
To animate a view with constraints in iOS, you can use UIView's `animateWithDuration:` method along with setting the constraints and calling `layoutIfNeeded`. Here's an example:nn```swiftn// Set initial constraintsnNSLayoutConstraint.activate([view.leadingAnchor.constraint(equalTo: superview.leadingAnchor), view.trailingAnchor.constraint(equalTo: superview.trailingAnchor)])nn// Create animation blocknUIView.animate(withDuration: 1.0, animations: {n view.leadingAnchor.constraint(equalTo: superview.leadingAnchor, constant: 100).isActive = truen})
| Is This Answer Correct ? | 0 Yes | 0 No |
What manual memory management ? How it work?
What are lifecycle events of uiviewcontroller?
What are the location services?
What devices will support ios 7?
How to change the content of your app in order to change the views displayed in the corresponding window?
What are ibeacons in ios? : IOS Architect
What is difference between unit tests and ui test in xcode?
Explain the difference between nil and nil?
What is atomic and non atomic in ios?
Difference between sax parser and dom parser ?
Explain Inapp purchase in iOS
What is suspended state in ios?