<?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: Fun With UIButtons and Core Animation Layers</title>
	<atom:link href="http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/</link>
	<description>Taglines are for Windows programmers</description>
	<lastBuildDate>Mon, 05 Dec 2011 10:55:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: psychoh13</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1614</link>
		<dc:creator>psychoh13</dc:creator>
		<pubDate>Sun, 29 May 2011 16:24:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1614</guid>
		<description>&lt;p&gt;You should not use -drawRect: to setup up properties of a CALayer !
The job of that method is only to DRAW content, never to setup properties, especially of a layer, when you know that drawRect: is specifically called from a layer&#039;s drawLayer:inContext: method. This is dangerous and counter-productive.&lt;/p&gt;

&lt;p&gt;This property of the CAGradientLayer should be set when the user sets the low or high colour, and only then.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You should not use -drawRect: to setup up properties of a CALayer !
The job of that method is only to DRAW content, never to setup properties, especially of a layer, when you know that drawRect: is specifically called from a layer&#8217;s drawLayer:inContext: method. This is dangerous and counter-productive.</p>

<p>This property of the CAGradientLayer should be set when the user sets the low or high colour, and only then.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Instruments alleges Memory leak with [UIColor CGColor] - Applerr.com All about Apple Products - Applerr.com All about Apple Products</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1607</link>
		<dc:creator>Instruments alleges Memory leak with [UIColor CGColor] - Applerr.com All about Apple Products - Applerr.com All about Apple Products</dc:creator>
		<pubDate>Sat, 14 May 2011 11:00:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1607</guid>
		<description>&lt;p&gt;[...] PS: I got the code for the GradientView from somewhere some months ago; it works very well (other than exposing the aforementioned memory leak). You can find the code here. [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] PS: I got the code for the GradientView from somewhere some months ago; it works very well (other than exposing the aforementioned memory leak). You can find the code here. [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: UIButton?????? &#187; nonomura.jp</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1604</link>
		<dc:creator>UIButton?????? &#187; nonomura.jp</dc:creator>
		<pubDate>Tue, 10 May 2011 18:27:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1604</guid>
		<description>&lt;p&gt;[...]  ????????UIButton????????  ?????????????????  [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...]  ????????UIButton????????  ?????????????????  [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mobile Design 1 &#171; iphone swing</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1538</link>
		<dc:creator>Mobile Design 1 &#171; iphone swing</dc:creator>
		<pubDate>Mon, 31 Jan 2011 08:35:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1538</guid>
		<description>&lt;p&gt;[...] http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/ [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/" rel="nofollow">http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/</a> [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1527</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Thu, 13 Jan 2011 18:30:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1527</guid>
		<description>&lt;p&gt;Hi ,&lt;/p&gt;

&lt;p&gt;This is a Great work,
I have tried it out, it works great,&lt;/p&gt;

&lt;p&gt;However, when I added to UITableCellView, it does not work.&lt;/p&gt;

&lt;p&gt;any idea?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi ,</p>

<p>This is a Great work,
I have tried it out, it works great,</p>

<p>However, when I added to UITableCellView, it does not work.</p>

<p>any idea?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: tuyennguyencanada</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1502</link>
		<dc:creator>tuyennguyencanada</dc:creator>
		<pubDate>Fri, 05 Nov 2010 14:56:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1502</guid>
		<description>&lt;p&gt;Thank you for your post.
I find it very useful for my project.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you for your post.
I find it very useful for my project.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: ios-dev</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1501</link>
		<dc:creator>ios-dev</dc:creator>
		<pubDate>Sun, 31 Oct 2010 03:24:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1501</guid>
		<description>&lt;p&gt;&lt;strong&gt;Fun With UIButtons and Core Animation Layers...&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><strong>Fun With UIButtons and Core Animation Layers&#8230;</strong></p>

<p>&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2010-08-30 &#124; Alones world</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1449</link>
		<dc:creator>links for 2010-08-30 &#124; Alones world</dc:creator>
		<pubDate>Tue, 31 Aug 2010 01:35:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1449</guid>
		<description>&lt;p&gt;[...] Cocoa Is My Girlfriend » Fun With UIButtons and Core Animation Layers (tags: uibutton cocoa core animation layer) [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Cocoa Is My Girlfriend » Fun With UIButtons and Core Animation Layers (tags: uibutton cocoa core animation layer) [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: stevek123</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1421</link>
		<dc:creator>stevek123</dc:creator>
		<pubDate>Sat, 14 Aug 2010 04:51:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1421</guid>
		<description>&lt;p&gt;Also, if I switch the &quot;colorWithRed...&quot; code back to &quot;redColor&quot; or the like, it works regardless of how you arrived at the ColorfulButtonsViewController class.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Also, if I switch the &#8220;colorWithRed&#8230;&#8221; code back to &#8220;redColor&#8221; or the like, it works regardless of how you arrived at the ColorfulButtonsViewController class.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: stevek123</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1420</link>
		<dc:creator>stevek123</dc:creator>
		<pubDate>Sat, 14 Aug 2010 03:29:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1420</guid>
		<description>&lt;p&gt;This is great.  Thanks.  However, I have a problem.  If I call ColorfulButtonsViewController from the main delegate as a:&lt;/p&gt;

&lt;p&gt;[window addSubView:viewController.view];&lt;/p&gt;

&lt;p&gt;I can send colorWithRed:126.0/255.0 green:179.0/255.0 blue:27.0/255.0 alpha:1.0]]; or the like in the setHighColor call and everthing works fine.&lt;/p&gt;

&lt;p&gt;However, if the main delegate calls a UINavigationController which in turn calls the exact same class with a:&lt;/p&gt;

&lt;p&gt;[self.navigationController pushViewController:buttonViewController animateed:YES];&lt;/p&gt;

&lt;p&gt;the same code results in an EXC_BAD_ACCESS crash.  It is crashing on in the drawRect procedure in the ColorfulButton class.  I can hardcode the [UIColor colorWithRed... into the gradientLayer call and it works, when I try to pass &quot;colorWithRed...&quot; in setHighColor or setLowColor is crashes.&lt;/p&gt;

&lt;p&gt;Again, the exact same code runs correctly if I don&#039;t go through the UINavigationController.&lt;/p&gt;

&lt;p&gt;Any help would be appreciated.   Thanks.&lt;/p&gt;

&lt;p&gt;(did I mention it&#039;s the same class code).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is great.  Thanks.  However, I have a problem.  If I call ColorfulButtonsViewController from the main delegate as a:</p>

<p>[window addSubView:viewController.view];</p>

<p>I can send colorWithRed:126.0/255.0 green:179.0/255.0 blue:27.0/255.0 alpha:1.0]]; or the like in the setHighColor call and everthing works fine.</p>

<p>However, if the main delegate calls a UINavigationController which in turn calls the exact same class with a:</p>

<p>[self.navigationController pushViewController:buttonViewController animateed:YES];</p>

<p>the same code results in an EXC_BAD_ACCESS crash.  It is crashing on in the drawRect procedure in the ColorfulButton class.  I can hardcode the [UIColor colorWithRed&#8230; into the gradientLayer call and it works, when I try to pass &#8220;colorWithRed&#8230;&#8221; in setHighColor or setLowColor is crashes.</p>

<p>Again, the exact same code runs correctly if I don&#8217;t go through the UINavigationController.</p>

<p>Any help would be appreciated.   Thanks.</p>

<p>(did I mention it&#8217;s the same class code).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: gmaletic</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1415</link>
		<dc:creator>gmaletic</dc:creator>
		<pubDate>Sun, 01 Aug 2010 09:19:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1415</guid>
		<description>&lt;p&gt;I noticed this class doesn&#039;t work if you try to instantiate the ColorfulButton directly, rather than go through Interface Builder. I have some ideas, but how would you attempt to fix this limitation? Thanks.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I noticed this class doesn&#8217;t work if you try to instantiate the ColorfulButton directly, rather than go through Interface Builder. I have some ideas, but how would you attempt to fix this limitation? Thanks.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: sfsam</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1367</link>
		<dc:creator>sfsam</dc:creator>
		<pubDate>Wed, 09 Jun 2010 07:08:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1367</guid>
		<description>&lt;p&gt;This is very neat, but how can you set different background colors for the different states (disabled, highlighted, etc)?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is very neat, but how can you set different background colors for the different states (disabled, highlighted, etc)?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Bynomial Code &#187; Fun with layers</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1347</link>
		<dc:creator>Bynomial Code &#187; Fun with layers</dc:creator>
		<pubDate>Sat, 08 May 2010 23:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1347</guid>
		<description>&lt;p&gt;[...] I originally learned about this stuff from this blog post. [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] I originally learned about this stuff from this blog post. [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: TechnologySolutionsGroup</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1327</link>
		<dc:creator>TechnologySolutionsGroup</dc:creator>
		<pubDate>Wed, 31 Mar 2010 19:44:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1327</guid>
		<description>&lt;p&gt;Thanks for the great code!&lt;/p&gt;

&lt;p&gt;I however had an access violation, and had to change to the following:&lt;/p&gt;

&lt;p&gt;@property (nonatomic, retain) UIColor *_highColor;
@property (nonatomic, retain) UIColor *_lowColor;&lt;/p&gt;

&lt;p&gt;You had (assign) instead, and in &quot;drawRect&quot; the colors were no longer accessible.&lt;/p&gt;

&lt;p&gt;I had a CustomerButton on two different view controllers. The first one showed fine, but when navigating to the second one, the crash would occur.&lt;/p&gt;

&lt;p&gt;Both view controllers were in separate nib&#039;s.&lt;/p&gt;

&lt;p&gt;Thanks,
Scott&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the great code!</p>

<p>I however had an access violation, and had to change to the following:</p>

<p>@property (nonatomic, retain) UIColor *_highColor;
@property (nonatomic, retain) UIColor *_lowColor;</p>

<p>You had (assign) instead, and in &#8220;drawRect&#8221; the colors were no longer accessible.</p>

<p>I had a CustomerButton on two different view controllers. The first one showed fine, but when navigating to the second one, the crash would occur.</p>

<p>Both view controllers were in separate nib&#8217;s.</p>

<p>Thanks,
Scott</p>]]></content:encoded>
	</item>
	<item>
		<title>By: akdalim@yahoo.com</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1324</link>
		<dc:creator>akdalim@yahoo.com</dc:creator>
		<pubDate>Tue, 30 Mar 2010 12:04:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1324</guid>
		<description>&lt;p&gt;I got it. 
the code needs to add the lib,&lt;/p&gt;

&lt;p&gt;import&lt;/p&gt;

&lt;p&gt;(You should write this for the newbies like me :). It took a long to figure it out. I had QuartzCore and CoreGraphics framework imported, but still need the .h file.&lt;/p&gt;

&lt;p&gt;Thanks for the tutorial. its great!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I got it. 
the code needs to add the lib,</p>

<p>import</p>

<p>(You should write this for the newbies like me :). It took a long to figure it out. I had QuartzCore and CoreGraphics framework imported, but still need the .h file.</p>

<p>Thanks for the tutorial. its great!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: akdalim@yahoo.com</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1323</link>
		<dc:creator>akdalim@yahoo.com</dc:creator>
		<pubDate>Tue, 30 Mar 2010 09:57:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1323</guid>
		<description>&lt;p&gt;hi, 
I have tried to make rounded rectangle button, but the color is not changed and have the following warning in these lines that : no -setCornerRadius etc. method found.&lt;/p&gt;

&lt;p&gt;[[loginButton layer] setCornerRadius:8.0f];
[[loginButton layer] setMasksToBounds:YES];
[[loginButton layer] setBorderWidth:1.0f];
[[loginButton layer] setBackgroundColor: [COLOR_BUTTON_LOGIN CGColor] ];&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>hi, 
I have tried to make rounded rectangle button, but the color is not changed and have the following warning in these lines that : no -setCornerRadius etc. method found.</p>

<p>[[loginButton layer] setCornerRadius:8.0f];
[[loginButton layer] setMasksToBounds:YES];
[[loginButton layer] setBorderWidth:1.0f];
[[loginButton layer] setBackgroundColor: [COLOR_BUTTON_LOGIN CGColor] ];</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Gejat: kleuren UIButtons</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1308</link>
		<dc:creator>Gejat: kleuren UIButtons</dc:creator>
		<pubDate>Thu, 25 Mar 2010 10:00:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1308</guid>
		<description>&lt;p&gt;[...] zijn andere oplossingen (bijvoorbeeld met &#8220;gestretchde-png-files&#8221;) en ik vond deze ook erg charmant maar uiteindelijk vind ik dit gewoon het [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] zijn andere oplossingen (bijvoorbeeld met &#8220;gestretchde-png-files&#8221;) en ik vond deze ook erg charmant maar uiteindelijk vind ik dit gewoon het [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1300</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 12 Mar 2010 16:26:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1300</guid>
		<description>&lt;p&gt;Nice!
I actually didn&#039;t realize this consequence of UIView being layer-based and instead wrote a tiny category that added a class-method to UIImage in order to easily generate glass-style-/gradient-buttons in code...&lt;/p&gt;

&lt;p&gt;I have to say I pretty much prefer doing it your way -- it feels much more...appropriate.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Nice!
I actually didn&#8217;t realize this consequence of UIView being layer-based and instead wrote a tiny category that added a class-method to UIImage in order to easily generate glass-style-/gradient-buttons in code&#8230;</p>

<p>I have to say I pretty much prefer doing it your way &#8212; it feels much more&#8230;appropriate.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: 2010-03-03 ???? iphone xml????</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1292</link>
		<dc:creator>2010-03-03 ???? iphone xml????</dc:creator>
		<pubDate>Wed, 03 Mar 2010 05:18:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1292</guid>
		<description>&lt;p&gt;[...] Fun With UIButtons and Core Animation Layers  [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Fun With UIButtons and Core Animation Layers  [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: JordanX</title>
		<link>http://www.cimgf.com/2010/01/28/fun-with-uibuttons-and-core-animation-layers/comment-page-1/#comment-1290</link>
		<dc:creator>JordanX</dc:creator>
		<pubDate>Tue, 02 Mar 2010 14:56:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=861#comment-1290</guid>
		<description>&lt;p&gt;Great post. Adding a drop shadow would really complete this class. But as it is. Great Job!&lt;/p&gt;

&lt;p&gt;First time reader. Love the blog!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Great post. Adding a drop shadow would really complete this class. But as it is. Great Job!</p>

<p>First time reader. Love the blog!</p>]]></content:encoded>
	</item>
</channel>
</rss>

