<?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: Fade Transition &#8211; Fade Images In and Out</title>
	<atom:link href="http://iPhoneDeveloperTips.com/user-interface/fade-transition-fade-images-in-and-out.html/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneDeveloperTips.com/user-interface/fade-transition-fade-images-in-and-out.html</link>
	<description>Tips and Tricks for iPhone developers</description>
	<lastBuildDate>Thu, 29 Jul 2010 23:00:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: John Muchow</title>
		<link>http://iPhoneDeveloperTips.com/user-interface/fade-transition-fade-images-in-and-out.html/comment-page-1#comment-7882</link>
		<dc:creator>John Muchow</dc:creator>
		<pubDate>Wed, 16 Dec 2009 14:06:47 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=4747#comment-7882</guid>
		<description>Dustin,

Are you referring to fading into a movie after the splash (Default.png)? I imagine you could place a MoviePlayer on a view controller and overlay that with an image (for example Default.png so it is the same as the splash image). Start the movie and then start the fade effect to dissolve the top image leaving the video showing.</description>
		<content:encoded><![CDATA[<p>Dustin,</p>
<p>Are you referring to fading into a movie after the splash (Default.png)? I imagine you could place a MoviePlayer on a view controller and overlay that with an image (for example Default.png so it is the same as the splash image). Start the movie and then start the fade effect to dissolve the top image leaving the video showing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dustin Dembrosky</title>
		<link>http://iPhoneDeveloperTips.com/user-interface/fade-transition-fade-images-in-and-out.html/comment-page-1#comment-7879</link>
		<dc:creator>Dustin Dembrosky</dc:creator>
		<pubDate>Wed, 16 Dec 2009 09:02:49 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=4747#comment-7879</guid>
		<description>Any way you can have a video splash screen using the MoviePlayer framework to fade?</description>
		<content:encoded><![CDATA[<p>Any way you can have a video splash screen using the MoviePlayer framework to fade?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Carnie</title>
		<link>http://iPhoneDeveloperTips.com/user-interface/fade-transition-fade-images-in-and-out.html/comment-page-1#comment-7530</link>
		<dc:creator>Stuart Carnie</dc:creator>
		<pubDate>Fri, 04 Dec 2009 08:28:28 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=4747#comment-7530</guid>
		<description>Agree with the others, you should use Core Animation rather than timers - core animation is designed for this and the code is much simpler (and probably more performant).</description>
		<content:encoded><![CDATA[<p>Agree with the others, you should use Core Animation rather than timers &#8211; core animation is designed for this and the code is much simpler (and probably more performant).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent Priddy</title>
		<link>http://iPhoneDeveloperTips.com/user-interface/fade-transition-fade-images-in-and-out.html/comment-page-1#comment-7477</link>
		<dc:creator>Brent Priddy</dc:creator>
		<pubDate>Thu, 03 Dec 2009 01:45:43 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=4747#comment-7477</guid>
		<description>The transition used in all of the AppStore applications I have written for a customer only fade one image, while the other image is static with alpha = 1.0 right behind the fading image.

Basically like Andrea&#039;s but one less animation

-  (void)fade
{
	[UIView beginAnimations:nil context:nil];
		[UIView setAnimationDuration:5];
		[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
		[UIView setAnimationsEnabled:YES];
		[UIView setAnimationDidStopSelector:@selector(animationEnded)];
		[UIView setAnimationDelegate:self];
		layer2.alpha = 0;
	[UIView commitAnimations];
}

where layer2 has been added after layer1 so layer2 is on top and in this case [self animationEnded] gets called when done.  

Using a timer to do animations is very error prone, you can setup an CAAnimationGroup animation group with CAKeyframeAnimation key frame animations if you want to do anything special (like setting a delay time and length).  The animations take care of setting up what you want to do in accelerated hardware.  Timers just waste your time, pun intended, especially when trying to do complex things on slower iphones like the 2G and 3G phones.  

Try doing image rotation 30fps with timers, I have never seen the iphone simulator run so slow. Then use [CAKeyframeAnimation animationWithKeyPath:@&quot;transform.rotation&quot;] and it is all in hardware.
Let CoreAnimation work for you, it is pretty powerful.</description>
		<content:encoded><![CDATA[<p>The transition used in all of the AppStore applications I have written for a customer only fade one image, while the other image is static with alpha = 1.0 right behind the fading image.</p>
<p>Basically like Andrea&#8217;s but one less animation</p>
<p>-  (void)fade<br />
{<br />
	[UIView beginAnimations:nil context:nil];<br />
		[UIView setAnimationDuration:5];<br />
		[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];<br />
		[UIView setAnimationsEnabled:YES];<br />
		[UIView setAnimationDidStopSelector:@selector(animationEnded)];<br />
		[UIView setAnimationDelegate:self];<br />
		layer2.alpha = 0;<br />
	[UIView commitAnimations];<br />
}</p>
<p>where layer2 has been added after layer1 so layer2 is on top and in this case [self animationEnded] gets called when done.  </p>
<p>Using a timer to do animations is very error prone, you can setup an CAAnimationGroup animation group with CAKeyframeAnimation key frame animations if you want to do anything special (like setting a delay time and length).  The animations take care of setting up what you want to do in accelerated hardware.  Timers just waste your time, pun intended, especially when trying to do complex things on slower iphones like the 2G and 3G phones.  </p>
<p>Try doing image rotation 30fps with timers, I have never seen the iphone simulator run so slow. Then use [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation"] and it is all in hardware.<br />
Let CoreAnimation work for you, it is pretty powerful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Leganza</title>
		<link>http://iPhoneDeveloperTips.com/user-interface/fade-transition-fade-images-in-and-out.html/comment-page-1#comment-7458</link>
		<dc:creator>Andrea Leganza</dc:creator>
		<pubDate>Wed, 02 Dec 2009 16:04:31 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=4747#comment-7458</guid>
		<description>The Andy approach doesn&#039;t guarantee that the second animation will end before the first one, because in this way are fired two thread and you have no guarantee how the thread manager will handle them, they are asynchronous.</description>
		<content:encoded><![CDATA[<p>The Andy approach doesn&#8217;t guarantee that the second animation will end before the first one, because in this way are fired two thread and you have no guarantee how the thread manager will handle them, they are asynchronous.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Molloy</title>
		<link>http://iPhoneDeveloperTips.com/user-interface/fade-transition-fade-images-in-and-out.html/comment-page-1#comment-7455</link>
		<dc:creator>Andy Molloy</dc:creator>
		<pubDate>Wed, 02 Dec 2009 15:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=4747#comment-7455</guid>
		<description>Core Animation simplifies this a lot. Try this (untested):

-(void)fade
{
   layer1.alpha = 0;
   [UIView beginAnimations:@&quot;FadeIn&quot; context:nil];
   [UIView setAnimationDuration:1];
   layer1.alpha = 1;
   [UIView commitAnimations];

   [UIView beginAnimations:@&quot;FadeOut&quot; context:nil];
   [UIView setAnimationDuration:0.5f];
   layer2.alpha = 0;
   [UIView commitAnimations];
}

This should accomplish the same thing.</description>
		<content:encoded><![CDATA[<p>Core Animation simplifies this a lot. Try this (untested):</p>
<p>-(void)fade<br />
{<br />
   layer1.alpha = 0;<br />
   [UIView beginAnimations:@"FadeIn" context:nil];<br />
   [UIView setAnimationDuration:1];<br />
   layer1.alpha = 1;<br />
   [UIView commitAnimations];</p>
<p>   [UIView beginAnimations:@"FadeOut" context:nil];<br />
   [UIView setAnimationDuration:0.5f];<br />
   layer2.alpha = 0;<br />
   [UIView commitAnimations];<br />
}</p>
<p>This should accomplish the same thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Leganza</title>
		<link>http://iPhoneDeveloperTips.com/user-interface/fade-transition-fade-images-in-and-out.html/comment-page-1#comment-7453</link>
		<dc:creator>Andrea Leganza</dc:creator>
		<pubDate>Wed, 02 Dec 2009 15:13:51 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=4747#comment-7453</guid>
		<description>viewHolder  is a UIView containing both subview-s. 

Not tried but should do the trick.

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:5];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:viewHolder cache:YES];
layer1.alpha = 1;
layer2.alpha = 0;
[UIView commitAnimations];</description>
		<content:encoded><![CDATA[<p>viewHolder  is a UIView containing both subview-s. </p>
<p>Not tried but should do the trick.</p>
<p>[UIView beginAnimations:nil context:nil];<br />
[UIView setAnimationDuration:5];<br />
[UIView setAnimationDelegate:self];<br />
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:viewHolder cache:YES];<br />
layer1.alpha = 1;<br />
layer2.alpha = 0;<br />
[UIView commitAnimations];</p>
]]></content:encoded>
	</item>
</channel>
</rss>
