I'm very new to Swift
and really need some help out here.
I have a UIImageView
with the image of arrow on it. I want the arrow to randomly change its direction on a button click in only THREE directions: top, right and bottom.
I figured out to rotate the UIImageView
using CGAffineTransform
, but how can I ?
- Exclude the left direction from the rotation?
- Make the arrow change its direction (top, right and bottom) randomly ?