<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hans Pinckaers &#187; uitableview</title>
	<atom:link href="http://www.hanspinckaers.com/category/uitableview/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hanspinckaers.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 17 Jul 2010 11:08:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to create a UITableViewCell with &#8220;copy&#8221; ability</title>
		<link>http://www.hanspinckaers.com/how-to-create-a-uitableviewcell-with-copy-possibility</link>
		<comments>http://www.hanspinckaers.com/how-to-create-a-uitableviewcell-with-copy-possibility#comments</comments>
		<pubDate>Sun, 31 Jan 2010 21:37:48 +0000</pubDate>
		<dc:creator>Hans Pinckaers</dc:creator>
				<category><![CDATA[iPhone development]]></category>
		<category><![CDATA[uitableview]]></category>

		<guid isPermaLink="false">http://www.hanspinckaers.com/?p=237</guid>
		<description><![CDATA[It&#8217;s possible to copy the content of a UITableViewCell in the Contacts app of Apple. When you tap and hold you will see a small menu with &#8220;Copy&#8221;. I needed this functionality myself, so I subclassed the class. You are free to use this in any application, but it would be awesome if you mention [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s possible to copy the content of a UITableViewCell in the Contacts app of Apple. When you tap and hold you will see a small menu with &#8220;Copy&#8221;. I needed this functionality myself, so I subclassed the class. You are free to use this in any application, but it would be awesome if you mention me in the credits of your App. <span id="more-237"></span></p>
<h3>It&#8217;s easy to use</h3>
<ol>
<li>Copy the files in your project.</li>
<li>Use this code to create a cell:

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>HPCopyTableViewCell alloc<span style="color: #002200;">&#93;</span> 
			initWithStyle<span style="color: #002200;">:</span>UITableViewCellStyleValue2 
		      reuseIdentifier<span style="color: #002200;">:</span>CellIdentifier<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;</pre></div></div>

<h3>Download</h3>
<p><a href="http://www.hanspinckaers.com/HPCopyTableViewCell.zip">HPCopyTableViewCell.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hanspinckaers.com/how-to-create-a-uitableviewcell-with-copy-possibility/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>High performance rounded corner UITableView</title>
		<link>http://www.hanspinckaers.com/high-performance-rounded-corner-uitableview</link>
		<comments>http://www.hanspinckaers.com/high-performance-rounded-corner-uitableview#comments</comments>
		<pubDate>Sat, 24 Oct 2009 07:51:55 +0000</pubDate>
		<dc:creator>Hans Pinckaers</dc:creator>
				<category><![CDATA[iPhone development]]></category>
		<category><![CDATA[uitableview]]></category>

		<guid isPermaLink="false">http://www.hanspinckaers.com/?p=143</guid>
		<description><![CDATA[The problem with the previous example was that I was using a second UIScrollView to scroll the UITableView and not the UITableView itself, which is a subclass of UIScrollView and highly optimized for scrolling. Here is a solution. The advantage of this one is that it is fast, but it&#8217;s not that easy and straightforward. [...]]]></description>
			<content:encoded><![CDATA[<p>The problem with the previous example was that I was using a second UIScrollView to scroll the UITableView and not the UITableView itself, which is a subclass of UIScrollView and highly optimized for scrolling.</p>
<p>Here is a solution. The advantage of this one is that it is fast, but it&#8217;s not that easy and straightforward.<span id="more-143"></span><br />
There are three view related properties for the uitableviewcell:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">@property</span><span style="color: #002200;">&#40;</span>nonatomic, readonly, retain<span style="color: #002200;">&#41;</span> UIView <span style="color: #002200;">*</span>contentView
&nbsp;
<span style="color: #a61390;">@property</span><span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> UIView <span style="color: #002200;">*</span>backgroundView
&nbsp;
<span style="color: #a61390;">@property</span><span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> UIView <span style="color: #002200;">*</span>selectedBackgroundView</pre></div></div>

<p>The backgroundView of the first and last UITableCell will be changed so that they have rounded corners at the proper place.</p>
<p>The selectedBackgroundview will be changed so that the blue selection of the first and last table cell will be corrected with the rounded corners of the backgroundView.</p>
<p>The gradient is drawn with Core Graphics. So you also learn with this project how to draw a gradient.</p>
<p>The only negative point of this technique is that I needed to make the separatorColor &#8220;clearColor&#8221;.</p>
<h3>Download the project</h3>
<p><a href="http://hanspinckaers.com/UIRoundedCornerTableView.zip">Here</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hanspinckaers.com/high-performance-rounded-corner-uitableview/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reproducing a tableView like in Stocks/Spotlight/Weather</title>
		<link>http://www.hanspinckaers.com/reproducing-a-tableview-like-in-stocks-spotlight-weather</link>
		<comments>http://www.hanspinckaers.com/reproducing-a-tableview-like-in-stocks-spotlight-weather#comments</comments>
		<pubDate>Wed, 21 Oct 2009 12:00:40 +0000</pubDate>
		<dc:creator>Hans Pinckaers</dc:creator>
				<category><![CDATA[iPhone development]]></category>
		<category><![CDATA[uitableview]]></category>

		<guid isPermaLink="false">http://www.hanspinckaers.com/?p=125</guid>
		<description><![CDATA[This article is outdated. You can find the better optimized tableView here: http://www.hanspinckaers.com/high-performance-rounded-corner-uitableview To come straight out with it: the trick is view.layer.cornerRadius = 10; For this to work you need to include the QuartzCore into the class which you call that property: #import &#60;QuartzCore/QuartzCore.h&#62; I heard that this only works since OS 3.0. Haven&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><strong>This article is outdated. You can find the better optimized tableView here: <a href="http://www.hanspinckaers.com/high-performance-rounded-corner-uitableview">http://www.hanspinckaers.com/high-performance-rounded-corner-uitableview</a></strong></p>
<p>To come straight out with it: the trick is</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">view.layer.cornerRadius <span style="color: #002200;">=</span> <span style="color: #2400d9;">10</span>;</pre></div></div>

<p><span id="more-125"></span><br />
For this to work you need to include the QuartzCore into the class which you call that property:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &lt;QuartzCore/QuartzCore.h&gt;</span></pre></div></div>

<p>I heard that this only works since OS 3.0. Haven&#8217;t checked it though.</p>
<p>This is the idea:<br />
Scrollview (rounded corners) -> TableView (rounded corners, scrolling disabled)</p>
<p><strong>Don&#8217;t use this with big tables because it will ruin the cache system of the table. I will post a solution and better method next week.</strong></p>
<p>This is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">self.view <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIView alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
&nbsp;
scrollView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIScrollView alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
scrollView.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">10</span>, <span style="color: #2400d9;">40</span>, <span style="color: #2400d9;">300</span>, <span style="color: #2400d9;">380</span><span style="color: #002200;">&#41;</span>;
scrollView.layer.cornerRadius <span style="color: #002200;">=</span> <span style="color: #2400d9;">15</span>;
<span style="color: #002200;">&#91;</span>self.view addSubview<span style="color: #002200;">:</span>scrollView<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>scrollView setShowsVerticalScrollIndicator<span style="color: #002200;">:</span><span style="color: #a61390;">NO</span><span style="color: #002200;">&#93;</span>;
&nbsp;
table <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>RoundedCornerTableViewController alloc<span style="color: #002200;">&#93;</span> initWithStyle<span style="color: #002200;">:</span>UITableViewStylePlain<span style="color: #002200;">&#93;</span>;
table.tableView.scrollEnabled <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
table.tableView.layer.cornerRadius <span style="color: #002200;">=</span> <span style="color: #2400d9;">15</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//Should be set the same as</span>
<span style="color: #002200;">&#91;</span>scrollView setContentSize<span style="color: #002200;">:</span>CGSizeMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">300</span>, <span style="color: #2400d9;">800</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
table.tableView.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">300</span>, <span style="color: #2400d9;">800</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#91;</span>scrollView addSubview<span style="color: #002200;">:</span>table.tableView<span style="color: #002200;">&#93;</span>;</pre></div></div>

<h3>Download the sample project</h3>
<p><a href="http://hanspinckaers.com/RoundedCornerTableView.zip">Here.</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hanspinckaers.com/reproducing-a-tableview-like-in-stocks-spotlight-weather/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
