Spinning an image around like a coin

I have one image. I want to spin it like a coin spin on surface. I tried rotation transform but it does not spin like that. How to achieve such an animation?

enter image description here

  • Correct handling / cleanup / etc of CADisplayLink in Swift custom animation?
  • How to save contact info from vCard into iPhone's Contacts App
  • Limiting both the fractional and total number of digits when formatting a float for display
  • Why not throw an exception if returns nil?
  • UILabel text margin
  • Organizing Different Versions of App in Xcode
  • code:

    - (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setUserInteractionEnabled:YES];
    lbl_facebook.font=[UIFont fontWithName:GZFont size:12.0f];
    txtPassword.font=[UIFont fontWithName:GZFont size:15.0f];
    txtUsername.font=[UIFont fontWithName:GZFont size:15.0f];
    
    CATransition* transition = [CATransition animation];
    transition.startProgress = 0;
    transition.endProgress = 1.0;
    transition.type = @"flip";
    transition.subtype = @"fromRight";
    transition.duration = 0.3;
    transition.repeatCount = 2;
    [_Image.layer addAnimation:transition forKey:@"transition"];
    

    }

    nd:

    #import "LoginViewController.h"
    
    #import "RegistrationViewController.h"
    #import "ForgetPasswordViewController.h"
    #import "ForgetPasswordController.h"
    #import "SearchServiceProviderViewController.h"
    #import <QuartzCore/QuartzCore.h>
    

    2 Solutions Collect From Internet About “Spinning an image around like a coin”

    This will make a nice, coin-like flip:

    CATransition* transition = [CATransition animation];
    transition.startProgress = 0;
    transition.endProgress = 1.0;
    transition.type = @"flip";
    transition.subtype = @"fromRight";
    transition.duration = 0.3;
    transition.repeatCount = 2;
    

    And add the transition animation to the layer of your view:

    [_yourView.layer addAnimation:transition forKey:@"transition"];
    

    See it in action:

    enter image description here

    One good trick to spin like this is that take different images of coin with different angle like spinning image. And then add all those images to array and start animation of images with that array..it will give you much better effect…Simple process like video framing.