April 2020
Beginner
316 pages
8h 20m
English
Working almost identically to .rotationEffect, the 3D rotation effect is another modifier that will attempt to add a 3D mask to the view you are trying to rotate, thus giving it an almost embossed effect when it spins:
.rotation3DEffect(.degrees(360), axis: (x: 0, y: 1, z: 0))
One noticeable difference with rotation3DEffect is that it requires an axis to base the rotation off.
From the preceding code snippet, setting the y axis allows our view to spin from left to right or vice versa on a vertical point (like a signpost would do in a cartoon!).
The x axis will rotate from top to bottom and the z axis will spin the view around, much like rotationEffect did.
Read now
Unlock full access