April 2020
Beginner
316 pages
8h 20m
English
Scaling is another type of element manipulation that previously would have required some calculations that may have eluded some of us.
However, using the same methods as we did with the opacity animation, along with the use of a simple modifier, we can quickly and efficiently scale elements however we want.
Let's have a go by creating another button, just like we did earlier:
Button("Scale") { withAnimation { // Add scale logic here... }}.padding(10).background(Color.green).foregroundColor(.white).clipShape(Circle())
Now, let's take a look at our scale modifier:
.scaleEffect(1)
Yep, it's really that easy! Actually, the only real difference here is the logic that's used to calculate the increase and decrease of the scale effect. Let's ...
Read now
Unlock full access