<?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>Adoption Curve</title>
	<atom:link href="http://www.adoptioncurve.net/feed" rel="self" type="application/rss+xml" />
	<link>http://www.adoptioncurve.net</link>
	<description></description>
	<lastBuildDate>Wed, 22 Feb 2012 11:42:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Add Color to the Terminal in Mac OS X</title>
		<link>http://osxdaily.com/2012/02/21/add-color-to-the-terminal-in-mac-os-x/</link>
		<comments>http://osxdaily.com/2012/02/21/add-color-to-the-terminal-in-mac-os-x/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 11:42:46 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://pinboard.in/u:timd/b:c7a091afb47e/</guid>
		<description><![CDATA[&#34;Adding colorized ls output to the Terminal in Mac OS X is a good way to make navigating around the command line a bit easier on the eyes.&#34;]]></description>
			<content:encoded><![CDATA["Adding colorized ls output to the Terminal in Mac OS X is a good way to make navigating around the command line a bit easier on the eyes."]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/02/add-color-to-the-terminal-in-mac-os-x.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Engineering: Simple Strategies for Smooth Animation on the iPhone</title>
		<link>http://engineering.twitter.com/2012/02/simple-strategies-for-smooth-animation.html</link>
		<comments>http://engineering.twitter.com/2012/02/simple-strategies-for-smooth-animation.html#comments</comments>
		<pubDate>Wed, 22 Feb 2012 08:38:22 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://pinboard.in/u:timd/b:219499dc2d69/</guid>
		<description><![CDATA[&#34;The iPhone was revolutionary for its use of direct manipulation – the feeling that you’re really holding content in your hands and manipulating it with your fingertips. While many mobile platforms have touch, it is the realistic physics and fluid animation of the iPhone that sets it apart from its competitors.

However, jerky scrolling ruins the experience. The new UI of Twitter for iPhone 4.0 contains many details that could impact performance, so we had to treat 60 frame-per-second animation as a priority. If you are troubleshooting animation performance, this post should provide some useful pointers.&#34;]]></description>
			<content:encoded><![CDATA["The iPhone was revolutionary for its use of direct manipulation – the feeling that you’re really holding content in your hands and manipulating it with your fingertips. While many mobile platforms have touch, it is the realistic physics and fluid animation of the iPhone that sets it apart from its competitors.

However, jerky scrolling ruins the experience. The new UI of Twitter for iPhone 4.0 contains many details that could impact performance, so we had to treat 60 frame-per-second animation as a priority. If you are troubleshooting animation performance, this post should provide some useful pointers."]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/02/twitter-engineering-simple-strategies-for-smooth-animation-on-the-iphone.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automating iOS build versions</title>
		<link>http://useyourloaf.com/blog/2010/8/18/setting-iphone-application-build-versions.html</link>
		<comments>http://useyourloaf.com/blog/2010/8/18/setting-iphone-application-build-versions.html#comments</comments>
		<pubDate>Sat, 18 Feb 2012 08:52:14 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://pinboard.in/u:timd/b:cee851a0bf4e/</guid>
		<description><![CDATA[Instructions for automating the build number of iOS apps with command line tools]]></description>
			<content:encoded><![CDATA[Instructions for automating the build number of iOS apps with command line tools]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/02/automating-ios-build-versions.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Secret Ninja Cucumber Scrolls</title>
		<link>http://cuke4ninja.com/toc.html</link>
		<comments>http://cuke4ninja.com/toc.html#comments</comments>
		<pubDate>Fri, 17 Feb 2012 02:04:20 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://pinboard.in/u:timd/b:e8a6233d64f2/</guid>
		<description><![CDATA[Cucumber documentation (covers Sinatra and other non-Rails frameworks)]]></description>
			<content:encoded><![CDATA[Cucumber documentation (covers Sinatra and other non-Rails frameworks)]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/02/the-secret-ninja-cucumber-scrolls.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up PostgreSQL for Ruby on Rails development on OS X « Will writes</title>
		<link>http://blog.willj.net/2011/05/31/setting-up-postgresql-for-ruby-on-rails-development-on-os-x/</link>
		<comments>http://blog.willj.net/2011/05/31/setting-up-postgresql-for-ruby-on-rails-development-on-os-x/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 01:18:31 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://pinboard.in/u:timd/b:0a5c15aee55b/</guid>
		<description><![CDATA[Useful instructions for setting up Postgres on OS X]]></description>
			<content:encoded><![CDATA[Useful instructions for setting up Postgres on OS X]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/02/setting-up-postgresql-for-ruby-on-rails-development-on-os-x-will-writes.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Clear cleverness: showing new screens</title>
		<link>http://www.adoptioncurve.net/archives/2012/02/more-clear-cleverness-showing-new-screens.php</link>
		<comments>http://www.adoptioncurve.net/archives/2012/02/more-clear-cleverness-showing-new-screens.php#comments</comments>
		<pubDate>Thu, 16 Feb 2012 10:06:35 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[tableViews]]></category>

		<guid isPermaLink="false">http://www.adoptioncurve.net/?p=2874</guid>
		<description><![CDATA[Another trick of the Clear app is the way that it takes the established pull-to-refresh interaction of a table view, and extends it to present new screens. So pulling the to-do items table down will first add a new item at the top of the table, then causes the lists table to slide down from [...]]]></description>
			<content:encoded><![CDATA[<p>Another trick of the Clear app is the way that it takes the established pull-to-refresh interaction of a table view, and extends it to present new screens. So pulling the to-do items table down will first add a new item at the top of the table, then causes the lists table to slide down from the top.</p>
<p>Doing the same in the Lists table results in the Settings table appearing in the same way.  The reverse is also true &#8211; pulling the table &#8220;up&#8221; from the bottom will result in the previous screen sliding up from the bottom.</p>
<p>This works by exploiting a property of <code>UIScrollView</code>, from which <code>UITableView</code> inherits.   The <code>contentOffset</code> property measures how far from the top of its frame the table has been scrolled &#8211; it&#8217;s measured in pixels, so if a 1000-pixel tall tableView was scrolled halfway, the <code>contentOffset</code> would be 500px.</p>
<p>The trick here is that the <code>contentOffset</code> can also be negative &#8211; which occurs when the tableView&#8217;s contents are dragged down from the top to leave a gap.  Often this triggers the pull-to-refresh methods, but in Clear&#8217;s case it&#8217;s the cue for new views to be presented.</p>
<p>To catch the user pulling the table down in this way, you can use the <code>scrollViewDidEndDragging:willDecelerate:</code> method which gets called when the user lifts their touch after dragging the table around.</p>
<p>If you check the tableView&#8217;s <code>contentOffset</code> at this point and discover that it&#8217;s more than, say, minus 60 pixels, you can use that to trigger another method &#8211; be it calling a data update, or pushing in new views.  An example might look something like this:</p>
<div id="gist-1843757" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">-</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="nf">scrollViewDidEndDragging:</span><span class="p">(</span><span class="n">UIScrollView</span> <span class="o">*</span><span class="p">)</span><span class="nv">scrollView</span> <span class="nf">willDecelerate:</span><span class="p">(</span><span class="kt">BOOL</span><span class="p">)</span><span class="nv">decelerate</span> <span class="p">{</span></div><div class='line' id='LC2'>&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">CGFloat</span> <span class="n">contentOffsetY</span> <span class="o">=</span> <span class="n">scrollView</span><span class="p">.</span><span class="n">contentOffset</span><span class="p">.</span><span class="n">y</span><span class="p">;</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">contentOffsetY</span> <span class="o">&lt;</span> <span class="o">-</span><span class="mf">60.0</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">self</span> <span class="n">displayActivitySpinner</span><span class="p">];</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC9'><span class="p">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1843757/8fd61995d4a9e8e6aa8572b2a1152c5c8901f00e/scrollViewDidEndDragging.m" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1843757#file_scroll_view_did_end_dragging.m" style="float:right;margin-right:10px;color:#666">scrollViewDidEndDragging.m</a>
            <a href="https://gist.github.com/1843757">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>Detecting a pull at the bottom of the table is similar &#8211; instead of looking for a negative <code>contentOffset</code>, though, you need to detect a <code>contentOffset</code> that&#8217;s greater than the tableView&#8217;s <code>contentSize</code>.</p>
<p>Again, you&#8217;ll need to apply a threshold to this to prevent the new view or whatever being presented as a result of a &#8216;normal&#8217; scroll action.  If the tableView is flicked to the bottom, the <code>contentOffset</code> will exceed the contentSize as the table &#8220;bounces&#8221;.</p>
<p>What Clear seems to do is have three tableViews loaded at any given time, and then change their frames in a <code>UIView</code> animation block to animate them sliding from the top and bottom of the screen.</p>
<p>It&#8217;s clever, although it does rely on the user discovering these interactions &#8211; there&#8217;s no obvious call-to-action as there would be in the case of a &#8220;back&#8221; button, for example.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/02/more-clear-cleverness-showing-new-screens.php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to do Clear-style swiping in iOS tables</title>
		<link>http://www.adoptioncurve.net/archives/2012/02/how-to-do-clear-style-swiping-in-ios-tables.php</link>
		<comments>http://www.adoptioncurve.net/archives/2012/02/how-to-do-clear-style-swiping-in-ios-tables.php#comments</comments>
		<pubDate>Wed, 15 Feb 2012 12:52:10 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[tableViews]]></category>

		<guid isPermaLink="false">http://www.adoptioncurve.net/?p=2860</guid>
		<description><![CDATA[The latest app that everyone&#8217;s raving about is Clear &#8211; if you haven&#8217;t seen it, it&#8217;s basically a task list, but one with a rather interesting take on the interface. Instead of the usual tab-bar-and-table-vew setup, the table is full-screen and makes extensive use of gestures. Deleting and completing tasks are done by swiping the [...]]]></description>
			<content:encoded><![CDATA[<p>The latest app that everyone&#8217;s raving about is <a href="http://www.realmacsoftware.com/clear/">Clear</a> &#8211; if you haven&#8217;t seen it, it&#8217;s basically a task list, but one with a rather interesting take on the interface. Instead of the usual tab-bar-and-table-vew setup, the table is full-screen and makes extensive use of gestures.</p>
<p><a href="http://www.adoptioncurve.net/wp-content/uploads/2012/02/ClearScreenshot1.png"><img class="alignleft size-full wp-image-2869" title="ClearScreenshot" src="http://www.adoptioncurve.net/wp-content/uploads/2012/02/ClearScreenshot1.png" alt="" width="160" height="240" /></a>Deleting and completing tasks are done by swiping the row &#8211; a left swipe deletes the item, a right swipe marks it as complete. Here&#8217;s the basis of how that&#8217;s done.</p>
<p>The effect relies on the cell&#8217;s <code>contentView</code> having two <code>UIViews</code> &#8220;stacked&#8221; one on top of the other, and a pair of <code>UISwipeGestureRecognizers</code> attached to the cell &#8211; one for left swipes, and one for right swipes. When a swipe is detected, the uppermost <code>UIView</code> is animated left or right to &#8220;reveal&#8221; the <code>UIView</code> that sits &#8220;underneath&#8221;. By chaining the animations together with <code>UIView</code> animation blocks, you can also do things like make the animations &#8220;bounce&#8221; at each end of their range of movement.</p>
<p>The outline process runs like this:</p>
<ol>
<li>Create a <code>UITableView</code> and wire up with delegate and data source as per usual.</li>
<li>Create a custom <code>UITableViewCell</code> class, and override the <code>initWithStyle:reuseIdentifer:</code> method to lay out the <code>UIViews</code> inside it. Then implement the animation methods in the custom cell&#8217;s subclass, and add the <code>UISwipeGestureRecognizers</code>.</li>
<li>Populate your table with instances of your custom <code>UITableViewCell</code>.</li>
</ol>
<p>The first and third steps are pretty routine, so don&#8217;t really need much explanation. The magic, such as it is, happens within the <code>UITableViewCell</code> subclass. The <code>initWithStyle:reusedIdentifier:</code> method can be used to lay out the contents of the cell and set up the <code>UISwipeGestureRecognizers</code> &#8211; here&#8217;s a sample method:</p>
<div id="gist-1835423" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">-</span> <span class="p">(</span><span class="kt">id</span><span class="p">)</span><span class="nf">initWithStyle:</span><span class="p">(</span><span class="n">UITableViewCellStyle</span><span class="p">)</span><span class="nv">style</span> <span class="nf">reuseIdentifier:</span><span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">reuseIdentifier</span></div><div class='line' id='LC2'><span class="p">{</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">self</span> <span class="o">=</span> <span class="p">[</span><span class="n">super</span> <span class="nl">initWithStyle:</span><span class="n">style</span> <span class="nl">reuseIdentifier:</span><span class="n">reuseIdentifier</span><span class="p">];</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Initialization code</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Create the top view</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">_topView</span> <span class="o">=</span> <span class="p">[[</span><span class="n">UIView</span> <span class="n">alloc</span><span class="p">]</span> <span class="nl">initWithFrame:</span><span class="n">CGRectMake</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">self</span><span class="p">.</span><span class="n">contentView</span><span class="p">.</span><span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">width</span><span class="p">,</span> <span class="mi">80</span><span class="p">)];</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">_topView</span> <span class="nl">setBackgroundColor:</span><span class="p">[</span><span class="n">UIColor</span> <span class="n">whiteColor</span><span class="p">]];</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Create the top label</span></div><div class='line' id='LC12'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">UILabel</span> <span class="o">*</span><span class="n">label</span> <span class="o">=</span> <span class="p">[[</span><span class="n">UILabel</span> <span class="n">alloc</span><span class="p">]</span> <span class="nl">initWithFrame:</span><span class="n">CGRectMake</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="mi">150</span><span class="p">,</span> <span class="mi">40</span><span class="p">)];</span></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">label</span> <span class="nl">setFont:</span><span class="p">[</span><span class="n">UIFont</span> <span class="nl">fontWithName:</span><span class="s">@&quot;Zapfino&quot;</span> <span class="nl">size:</span><span class="mi">18</span><span class="p">]];</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">label</span> <span class="nl">setTextColor:</span><span class="p">[</span><span class="n">UIColor</span> <span class="n">blackColor</span><span class="p">]];</span></div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">label</span> <span class="nl">setText:</span><span class="s">@&quot;Swipe me!&quot;</span><span class="p">];</span></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">_topView</span> <span class="nl">addSubview:</span><span class="n">label</span><span class="p">];</span></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Create the top image</span></div><div class='line' id='LC19'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">UIImageView</span> <span class="o">*</span><span class="n">pointImage</span> <span class="o">=</span> <span class="p">[[</span><span class="n">UIImageView</span> <span class="n">alloc</span><span class="p">]</span> <span class="nl">initWithImage:</span><span class="p">[</span><span class="n">UIImage</span> <span class="nl">imageNamed:</span><span class="s">@&quot;point&quot;</span><span class="p">]];</span></div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC21'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">CGFloat</span> <span class="n">pointImageXposition</span> <span class="o">=</span> <span class="n">self</span><span class="p">.</span><span class="n">contentView</span><span class="p">.</span><span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">width</span> <span class="o">-</span> <span class="mi">160</span><span class="p">;</span></div><div class='line' id='LC22'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">pointImage</span> <span class="nl">setFrame:</span><span class="n">CGRectMake</span><span class="p">(</span><span class="n">pointImageXposition</span><span class="p">,</span> <span class="mi">18</span><span class="p">,</span> <span class="mi">144</span><span class="p">,</span> <span class="mi">44</span><span class="p">)];</span></div><div class='line' id='LC23'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">_topView</span> <span class="nl">addSubview:</span><span class="n">pointImage</span><span class="p">];</span></div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC25'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Create the swipe view</span></div><div class='line' id='LC26'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">_swipeView</span> <span class="o">=</span> <span class="p">[[</span><span class="n">UIView</span> <span class="n">alloc</span><span class="p">]</span> <span class="nl">initWithFrame:</span><span class="n">CGRectMake</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">self</span><span class="p">.</span><span class="n">contentView</span><span class="p">.</span><span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">width</span><span class="p">,</span> <span class="mi">80</span><span class="p">)];</span></div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">_swipeView</span> <span class="nl">setBackgroundColor:</span><span class="p">[</span><span class="n">UIColor</span> <span class="n">darkGrayColor</span><span class="p">]];</span></div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC29'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Create the swipe label</span></div><div class='line' id='LC30'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">UILabel</span> <span class="o">*</span><span class="n">haveSwipedlabel</span> <span class="o">=</span> <span class="p">[[</span><span class="n">UILabel</span> <span class="n">alloc</span><span class="p">]</span> <span class="nl">initWithFrame:</span><span class="n">CGRectMake</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">25</span><span class="p">,</span> <span class="mi">200</span><span class="p">,</span> <span class="mi">30</span><span class="p">)];</span></div><div class='line' id='LC31'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">haveSwipedlabel</span> <span class="nl">setFont:</span><span class="p">[</span><span class="n">UIFont</span> <span class="nl">fontWithName:</span><span class="s">@&quot;GillSans-Bold&quot;</span> <span class="nl">size:</span><span class="mi">18</span><span class="p">]];</span></div><div class='line' id='LC32'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">haveSwipedlabel</span> <span class="nl">setTextColor:</span><span class="p">[</span><span class="n">UIColor</span> <span class="n">whiteColor</span><span class="p">]];</span></div><div class='line' id='LC33'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">haveSwipedlabel</span> <span class="nl">setBackgroundColor:</span><span class="p">[</span><span class="n">UIColor</span> <span class="n">darkGrayColor</span><span class="p">]];</span></div><div class='line' id='LC34'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">haveSwipedlabel</span> <span class="nl">setText:</span><span class="s">@&quot;I&#39;ve been swiped!&quot;</span><span class="p">];</span></div><div class='line' id='LC35'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">_swipeView</span> <span class="nl">addSubview:</span><span class="n">haveSwipedlabel</span><span class="p">];</span></div><div class='line' id='LC36'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC37'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Add views to contentView</span></div><div class='line' id='LC38'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">contentView</span> <span class="nl">addSubview:</span><span class="n">_swipeView</span><span class="p">];</span></div><div class='line' id='LC39'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">contentView</span> <span class="nl">addSubview:</span><span class="n">_topView</span><span class="p">];</span></div><div class='line' id='LC40'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC41'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Create the gesture recognizers</span></div><div class='line' id='LC42'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">UISwipeGestureRecognizer</span> <span class="o">*</span><span class="n">swipeRight</span> <span class="o">=</span> <span class="p">[[</span><span class="n">UISwipeGestureRecognizer</span> <span class="n">alloc</span><span class="p">]</span> <span class="nl">initWithTarget:</span><span class="n">self</span> <span class="nl">action:</span><span class="k">@selector</span><span class="p">(</span><span class="nl">didSwipeRightInCell:</span><span class="p">)];</span></div><div class='line' id='LC43'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">swipeRight</span> <span class="nl">setDirection:</span><span class="n">UISwipeGestureRecognizerDirectionRight</span><span class="p">];</span></div><div class='line' id='LC44'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC45'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">UISwipeGestureRecognizer</span> <span class="o">*</span><span class="n">swipeLeft</span> <span class="o">=</span> <span class="p">[[</span><span class="n">UISwipeGestureRecognizer</span> <span class="n">alloc</span><span class="p">]</span> <span class="nl">initWithTarget:</span><span class="n">self</span> <span class="nl">action:</span><span class="k">@selector</span><span class="p">(</span><span class="nl">didSwipeLeftInCell:</span><span class="p">)];</span></div><div class='line' id='LC46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">swipeLeft</span> <span class="nl">setDirection:</span><span class="n">UISwipeGestureRecognizerDirectionLeft</span><span class="p">];</span></div><div class='line' id='LC47'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC48'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">self</span> <span class="nl">addGestureRecognizer:</span><span class="n">swipeRight</span><span class="p">];</span></div><div class='line' id='LC49'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">self</span> <span class="nl">addGestureRecognizer:</span><span class="n">swipeLeft</span><span class="p">];</span></div><div class='line' id='LC50'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC51'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Prevent selection highlighting</span></div><div class='line' id='LC52'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">self</span> <span class="nl">setSelectionStyle:</span><span class="n">UITableViewCellSelectionStyleNone</span><span class="p">];</span></div><div class='line' id='LC53'><br/></div><div class='line' id='LC54'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC55'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="n">self</span><span class="p">;</span></div><div class='line' id='LC56'><span class="p">}</span></div><div class='line' id='LC57'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1835423/dc0e853c681a20e1cb4d02d86c380ce1011fe4fd/swipeCell.m" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1835423#file_swipe_cell.m" style="float:right;margin-right:10px;color:#666">swipeCell.m</a>
            <a href="https://gist.github.com/1835423">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>This is fairly verbose, but breaks down into four stages:</p>
<ol>
<li>creating the top view, which is the one which is viewable when the cell is in the &#8220;normal&#8221; state</li>
<li>creating the bottom view, which is the one that gets revealed when the top view moves</li>
<li>adding these two views to the cell&#8217;s contentView</li>
<li>creating and adding two <code>UISwipeGestureRecognizers</code> to the cell and using these to fire the animation methods.</li>
</ol>
<p>The animation is done by two methods in the cell subclass, one for right and one for left. Here&#8217;s the detail of the rightward-swipe method:</p>
<div id="gist-1835417" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="k">-</span><span class="p">(</span><span class="kt">IBAction</span><span class="p">)</span><span class="nf">didSwipeLeftInCell:</span><span class="p">(</span><span class="kt">id</span><span class="p">)</span><span class="nv">sender</span> <span class="p">{</span></div><div class='line' id='LC2'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">UIView</span> <span class="nl">setAnimationCurve:</span><span class="n">UIViewAnimationCurveEaseIn</span><span class="p">];</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">UIView</span> <span class="nl">animateWithDuration:</span><span class="mf">1.0</span> <span class="nl">animations:</span><span class="o">^</span><span class="p">{</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">_topView</span> <span class="nl">setFrame:</span><span class="n">CGRectMake</span><span class="p">(</span><span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">320</span><span class="p">,</span> <span class="mi">80</span><span class="p">)];</span></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span> <span class="nl">completion:</span><span class="o">^</span><span class="p">(</span><span class="kt">BOOL</span> <span class="n">finished</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">UIView</span> <span class="nl">animateWithDuration:</span><span class="mf">0.15</span> <span class="nl">animations:</span><span class="o">^</span><span class="p">{</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">[</span><span class="n">_topView</span> <span class="nl">setFrame:</span><span class="n">CGRectMake</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">320</span><span class="p">,</span> <span class="mi">80</span><span class="p">)];</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}];</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}];</span></div><div class='line' id='LC10'><span class="p">}</span></div><div class='line' id='LC11'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1835417/3f41924b5afdf2314b6e8f61bbf8937fcd974d9d/didSwipeLeftInCell.m" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1835417#file_did_swipe_left_in_cell.m" style="float:right;margin-right:10px;color:#666">didSwipeLeftInCell.m</a>
            <a href="https://gist.github.com/1835417">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>It uses <code>UIView's</code> block-based <code>animatedWithDuration:animations:</code> method to chain together a series of moves to give a &#8220;bounce&#8221; effect &#8211; the view that&#8217;s doing the movement &#8220;overshoots&#8221; the end position slightly, and then settles back. The durations in this code are deliberately long to show the effect, but when they&#8217;re shorted in practice the bounce effect can really liven up the interface.</p>
<p>In the case of Clear, the swipe gesture methods also trigger updates to the tableView&#8217;s data model to mark the task as completed (or deleting it). At a rough guess, there&#8217;s a separate section of the table for deleted items that uses another custom <code>UITableViewCell</code> subclass to style the items with the strikethrough and dark background.</p>
<p>The swipe effects are a nice detail in the Clear app, and it&#8217;s a great example of how gestures can be used in place of more traditional tap-based interactions. The tradeoff is that the interactions are less apparent &#8211; the call to action of a Delete button is obvious, whereas a gesture has to be either explicitly explained or discovered. It&#8217;ll be interesting to see if this is the start of a pattern in app design.</p>
<p>[I've put an example app that's a full implementation of the swipe interactions shown above up on GitHub at <a title="https://github.com/timd/SwipingTable" href="https://github.com/timd/SwipingTable">https://github.com/timd/SwipingTable</a> . And the full process is shown in detail in my book, for which <a href="http://www.amazon.co.uk/Pro-iOS-Table-Views-iPhone/dp/1430233486/">this is a shameless plug</a> (well, if I can't promote it on my own blog, where can I? <img src='http://www.adoptioncurve.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/02/how-to-do-clear-style-swiping-in-ios-tables.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Six months of freelance, DAYS OF FEAR and how I found work &#8211; Liz Elcoate</title>
		<link>http://lizelcoate.tumblr.com/post/16466600857/freelance</link>
		<comments>http://lizelcoate.tumblr.com/post/16466600857/freelance#comments</comments>
		<pubDate>Tue, 14 Feb 2012 11:51:22 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://pinboard.in/u:timd/b:f1700fce246c/</guid>
		<description><![CDATA[&#34;This post is predominantly about how I’ve found work in the first six months. This is a question that I have been asked time and time again by other, slightly wild eyed, mildly frantic designers/developers who have either made the break and gone freelance or are planning to make the break and go freelance. I myself also asked this question of other people many times in the early DAYS OF FEAR (I’ll come to those later).]]></description>
			<content:encoded><![CDATA["This post is predominantly about how I’ve found work in the first six months. This is a question that I have been asked time and time again by other, slightly wild eyed, mildly frantic designers/developers who have either made the break and gone freelance or are planning to make the break and go freelance. I myself also asked this question of other people many times in the early DAYS OF FEAR (I’ll come to those later).]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/02/six-months-of-freelance-days-of-fear-and-how-i-found-work-liz-elcoate.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Baker Ebook Framework 3.1</title>
		<link>http://bakerframework.com/</link>
		<comments>http://bakerframework.com/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 00:44:55 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://pinboard.in/u:timd/b:b67cca3824fd/</guid>
		<description><![CDATA[HTML framework for ebook production
Ebook HTML framework design CSS code]]></description>
			<content:encoded><![CDATA[HTML framework for ebook production
Ebook HTML framework design CSS code]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/02/baker-ebook-framework-3-1.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby HTTP clients features</title>
		<link>https://spreadsheets0.google.com/pub?hl=en&#038;hl=en&#038;key=0AiZsKd8d4hSJdHFFbjR5aWNjWjlzWlhiNGxQejdBWWc&#038;output=html</link>
		<comments>https://spreadsheets0.google.com/pub?hl=en&#038;hl=en&#038;key=0AiZsKd8d4hSJdHFFbjR5aWNjWjlzWlhiNGxQejdBWWc&#038;output=html#comments</comments>
		<pubDate>Tue, 31 Jan 2012 15:16:44 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://pinboard.in/u:timd/b:c70c55a15920/</guid>
		<description><![CDATA[Rather scarily detailed list of Ruby HTTP clients]]></description>
			<content:encoded><![CDATA[Rather scarily detailed list of Ruby HTTP clients]]></content:encoded>
			<wfw:commentRss>http://www.adoptioncurve.net/archives/2012/01/ruby-http-clients-features.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

