<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Rotate an Image with Animation &#8211; Part 1</title>
	<atom:link href="http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html/feed" rel="self" type="application/rss+xml" />
	<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html</link>
	<description>iOS and Objective-C Tips, Tricks and Tutorials.</description>
	<lastBuildDate>Tue, 22 May 2012 11:53:47 -0500</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Daniel Burke</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-69743</link>
		<dc:creator>Daniel Burke</dc:creator>
		<pubDate>Wed, 18 Apr 2012 05:19:25 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-69743</guid>
		<description>Thanks!  used this to spin a little gear and toggle the keyboard :)</description>
		<content:encoded><![CDATA[<p>Thanks!  used this to spin a little gear and toggle the keyboard :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mashhadi</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-67737</link>
		<dc:creator>Mashhadi</dc:creator>
		<pubDate>Tue, 28 Feb 2012 06:26:03 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-67737</guid>
		<description>Wow superb thats realy what i want</description>
		<content:encoded><![CDATA[<p>Wow superb thats realy what i want</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Kernel</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-67701</link>
		<dc:creator>Alan Kernel</dc:creator>
		<pubDate>Mon, 27 Feb 2012 14:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-67701</guid>
		<description>How do I have a UIImageView move in a straight line while rotating several times before reaching the destination?
Thanks
-Al</description>
		<content:encoded><![CDATA[<p>How do I have a UIImageView move in a straight line while rotating several times before reaching the destination?<br />
Thanks<br />
-Al</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Hurst</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-67670</link>
		<dc:creator>Simon Hurst</dc:creator>
		<pubDate>Sun, 26 Feb 2012 18:03:45 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-67670</guid>
		<description>change the method to take a UIButton then. If it works. you&#039;re getting a warning because it&#039;s expected a UIImageView.</description>
		<content:encoded><![CDATA[<p>change the method to take a UIButton then. If it works. you&#8217;re getting a warning because it&#8217;s expected a UIImageView.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helmut</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-65914</link>
		<dc:creator>Helmut</dc:creator>
		<pubDate>Wed, 18 Jan 2012 01:58:47 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-65914</guid>
		<description>I&#039;ve tested your code you shared with us. I call it in a function to place the iOS info button.

Im getting a warning for using it on the Botton Image

	incomapttible Objective-C type &#039;struct UIButton*, expected &quot;struct UImageView&quot;
But it is working fine and changes and rotates the infoButton to any requested rotation.

Any one help out with an explanation why it actually works for this particular implementation:

UIButton *userInfo = [UIButton buttonWithType:UIButtonTypeInfoLight];
	userInfo.frame = CGRectMake(278, 10, 16, 36);
	userInfo.backgroundColor = [UIColor clearColor];
	[userInfo addTarget:self action:@selector(flipToUsersGuide:) 
		 forControlEvents:UIControlEventTouchUpInside];
    ........

	[self rotateImage:iuserInfo duration:0.0 curve:UIViewAnimationCurveEaseIn degrees:-90];
               I am getting Build Warning SDK 4.3 and later
               incomapttible Objective-C type &#039;struct UIButton*, expected &quot;struct UImageView&quot;

// Note setting animation time to zero no need to actually obserserve the rotation in this implementation
// the current view is set to  LanscapeLeft 

Calling your method you have shared in this post

           ---------- all is working fine
- (void)rotateImage:(UIImageView *)image duration:(NSTimeInterval)duration 
			  curve:(int)curve degrees:(CGFloat)degrees
{
	// Setup the animation
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:duration];
	[UIView setAnimationCurve:curve];
	[UIView setAnimationBeginsFromCurrentState:YES];
	
	// The transform matrix
	CGAffineTransform transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(degrees)) ;
	image.transform = transform;
	
	// Commit the changes
	[UIView commitAnimations];
}</description>
		<content:encoded><![CDATA[<p>I&#8217;ve tested your code you shared with us. I call it in a function to place the iOS info button.</p>
<p>Im getting a warning for using it on the Botton Image</p>
<p>	incomapttible Objective-C type &#8216;struct UIButton*, expected &#8220;struct UImageView&#8221;<br />
But it is working fine and changes and rotates the infoButton to any requested rotation.</p>
<p>Any one help out with an explanation why it actually works for this particular implementation:</p>
<p>UIButton *userInfo = [UIButton buttonWithType:UIButtonTypeInfoLight];<br />
	userInfo.frame = CGRectMake(278, 10, 16, 36);<br />
	userInfo.backgroundColor = [UIColor clearColor];<br />
	[userInfo addTarget:self action:@selector(flipToUsersGuide:)<br />
		 forControlEvents:UIControlEventTouchUpInside];<br />
    &#8230;&#8230;..</p>
<p>	[self rotateImage:iuserInfo duration:0.0 curve:UIViewAnimationCurveEaseIn degrees:-90];<br />
               I am getting Build Warning SDK 4.3 and later<br />
               incomapttible Objective-C type &#8216;struct UIButton*, expected &#8220;struct UImageView&#8221;</p>
<p>// Note setting animation time to zero no need to actually obserserve the rotation in this implementation<br />
// the current view is set to  LanscapeLeft </p>
<p>Calling your method you have shared in this post</p>
<p>           &#8212;&#8212;&#8212;- all is working fine<br />
- (void)rotateImage:(UIImageView *)image duration:(NSTimeInterval)duration<br />
			  curve:(int)curve degrees:(CGFloat)degrees<br />
{<br />
	// Setup the animation<br />
	[UIView beginAnimations:nil context:NULL];<br />
	[UIView setAnimationDuration:duration];<br />
	[UIView setAnimationCurve:curve];<br />
	[UIView setAnimationBeginsFromCurrentState:YES];</p>
<p>	// The transform matrix<br />
	CGAffineTransform transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(degrees)) ;<br />
	image.transform = transform;</p>
<p>	// Commit the changes<br />
	[UIView commitAnimations];<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JFA</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-65168</link>
		<dc:creator>JFA</dc:creator>
		<pubDate>Sun, 01 Jan 2012 20:52:14 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-65168</guid>
		<description>Hi !
I&#039;ve tested the code you gave.
I&#039;ve changed the angle of rotation (in radians), and added a function that converts from degrees to radians

If the angle in degrees is 360 everything is ok
but if is for example 90 or any number different than 360 
the layer makes the rotation animation and then goes slightly to the start point.

Why it doesn&#039;t remain at that value of rotation ? 

Thanks</description>
		<content:encoded><![CDATA[<p>Hi !<br />
I&#8217;ve tested the code you gave.<br />
I&#8217;ve changed the angle of rotation (in radians), and added a function that converts from degrees to radians</p>
<p>If the angle in degrees is 360 everything is ok<br />
but if is for example 90 or any number different than 360<br />
the layer makes the rotation animation and then goes slightly to the start point.</p>
<p>Why it doesn&#8217;t remain at that value of rotation ? </p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JFA</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-65167</link>
		<dc:creator>JFA</dc:creator>
		<pubDate>Sun, 01 Jan 2012 20:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-65167</guid>
		<description>you have to change the .anchorPoint PROPERTY 
 and make it different than the (0.5,0.5) which is the center</description>
		<content:encoded><![CDATA[<p>you have to change the .anchorPoint PROPERTY<br />
 and make it different than the (0.5,0.5) which is the center</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Muchow</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-60620</link>
		<dc:creator>John Muchow</dc:creator>
		<pubDate>Tue, 27 Sep 2011 13:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-60620</guid>
		<description>No, this will not implement 3D image rotation.</description>
		<content:encoded><![CDATA[<p>No, this will not implement 3D image rotation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-60613</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Tue, 27 Sep 2011 09:07:06 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-60613</guid>
		<description>Hello,

will the result of this animation 360 rotate image like this - http://studio.fotorobot.cz/?

Thanks, Matt.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>will the result of this animation 360 rotate image like this &#8211; <a href="http://studio.fotorobot.cz/" rel="nofollow">http://studio.fotorobot.cz/</a>?</p>
<p>Thanks, Matt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: the future</title>
		<link>http://MobileDeveloperTips.com/user-interface/rotate-an-image-with-animation.html#comment-59854</link>
		<dc:creator>the future</dc:creator>
		<pubDate>Wed, 07 Sep 2011 20:36:03 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3996#comment-59854</guid>
		<description>Thanks a lot for this post. It was really helpful.

I am actually building a script to rotate an image back and forth about 45 degrees in an NSTimer.

Thanks for the code snippets. :)</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this post. It was really helpful.</p>
<p>I am actually building a script to rotate an image back and forth about 45 degrees in an NSTimer.</p>
<p>Thanks for the code snippets. :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

