<?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: Differentiating Tap Counts on iOS [UPDATED]</title>
	<atom:link href="http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/</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: yar2050</title>
		<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/comment-page-1/#comment-1510</link>
		<dc:creator>yar2050</dc:creator>
		<pubDate>Fri, 19 Nov 2010 19:49:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=1072#comment-1510</guid>
		<description>&lt;p&gt;Thank you for leaving this as the post + the update. The method without gesture recognizers is an important thing to have on file, too.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you for leaving this as the post + the update. The method without gesture recognizers is an important thing to have on file, too.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Long</title>
		<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/comment-page-1/#comment-1377</link>
		<dc:creator>Matt Long</dc:creator>
		<pubDate>Tue, 15 Jun 2010 16:13:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=1072#comment-1377</guid>
		<description>&lt;p&gt;@jamie314, @Adion,&lt;/p&gt;

&lt;p&gt;Right you are. 350 milliseconds. Fixed!&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

&lt;p&gt;-Matt&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@jamie314, @Adion,</p>

<p>Right you are. 350 milliseconds. Fixed!</p>

<p>Thanks.</p>

<p>-Matt</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Long</title>
		<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/comment-page-1/#comment-1376</link>
		<dc:creator>Matt Long</dc:creator>
		<pubDate>Tue, 15 Jun 2010 15:55:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=1072#comment-1376</guid>
		<description>&lt;p&gt;@aclark&lt;/p&gt;

&lt;p&gt;Nice! Had missed the requireGestureRecognizerToFail method. That&#039;s great! I&#039;ve got some re-factoring to do now, you big jerk. ;-)&lt;/p&gt;

&lt;p&gt;Will update the blog post too.&lt;/p&gt;

&lt;p&gt;-Matt&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@aclark</p>

<p>Nice! Had missed the requireGestureRecognizerToFail method. That&#8217;s great! I&#8217;ve got some re-factoring to do now, you big jerk. ;-)</p>

<p>Will update the blog post too.</p>

<p>-Matt</p>]]></content:encoded>
	</item>
	<item>
		<title>By: PBenz</title>
		<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/comment-page-1/#comment-1375</link>
		<dc:creator>PBenz</dc:creator>
		<pubDate>Tue, 15 Jun 2010 14:25:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=1072#comment-1375</guid>
		<description>&lt;p&gt;I tried this out last night and discovered that aclark&#039;s suggestion of using gestures actually works, but Matt is also correct in that if you put a breakpoint in the handler for the single tap, it will get called. My test code simply NSLogs a line to the console, and the single tap handler definitely does not get called unless there&#039;s a breakpoint set within it. I must admit that I don&#039;t understand why.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I tried this out last night and discovered that aclark&#8217;s suggestion of using gestures actually works, but Matt is also correct in that if you put a breakpoint in the handler for the single tap, it will get called. My test code simply NSLogs a line to the console, and the single tap handler definitely does not get called unless there&#8217;s a breakpoint set within it. I must admit that I don&#8217;t understand why.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jamie314</title>
		<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/comment-page-1/#comment-1374</link>
		<dc:creator>jamie314</dc:creator>
		<pubDate>Tue, 15 Jun 2010 11:23:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=1072#comment-1374</guid>
		<description>&lt;p&gt;In the interest of picking nits:&lt;/p&gt;

&lt;p&gt;The method -peformSelector:withObject:afterDelay: takes a delay in seconds, so 0.35 translates to 350 milliseconds, not 35.&lt;/p&gt;

&lt;p&gt;It isn&#039;t hugely relevant in this example, but depending on your application an intentional delay of 350ms may become noticeable to users.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>In the interest of picking nits:</p>

<p>The method -peformSelector:withObject:afterDelay: takes a delay in seconds, so 0.35 translates to 350 milliseconds, not 35.</p>

<p>It isn&#8217;t hugely relevant in this example, but depending on your application an intentional delay of 350ms may become noticeable to users.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Adion</title>
		<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/comment-page-1/#comment-1373</link>
		<dc:creator>Adion</dc:creator>
		<pubDate>Tue, 15 Jun 2010 08:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=1072#comment-1373</guid>
		<description>&lt;p&gt;I suppose you meant 350 milliseconds, since the source code says 0.35, which I would assume are seconds.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I suppose you meant 350 milliseconds, since the source code says 0.35, which I would assume are seconds.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: aclark</title>
		<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/comment-page-1/#comment-1372</link>
		<dc:creator>aclark</dc:creator>
		<pubDate>Tue, 15 Jun 2010 05:19:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=1072#comment-1372</guid>
		<description>&lt;p&gt;Actually you can do this with UIGestureRecognizer. After creating your two (or more) recognizers simply instruct the single-tap recognizer that it can only succeed after the double-tap recognizer fails.&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;&lt;code&gt;UITapGestureRecognizer *singleTap, *doubleTap;&lt;/p&gt;

&lt;p&gt;singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTap)];
doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap)];&lt;/p&gt;

&lt;p&gt;doubleTap.numberOfTapsRequired = 2;&lt;/p&gt;

&lt;p&gt;[singleTap requireGestureRecognizerToFail:doubleTap];&lt;/p&gt;

&lt;p&gt;[view addGestureRecognizer:singleTap];
[view addGestureRecognizer:doubleTap];
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;In that way the singleTap recognizer will only have its action invoked if there is a delay between two taps longer than what the system has determined qualifies a double-tap. No magic numbers required.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Actually you can do this with UIGestureRecognizer. After creating your two (or more) recognizers simply instruct the single-tap recognizer that it can only succeed after the double-tap recognizer fails.</p>

<p><pre><code>UITapGestureRecognizer *singleTap, *doubleTap;</code></pre></p>

<p>singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTap)];
doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap)];</p>

<p>doubleTap.numberOfTapsRequired = 2;</p>

<p>[singleTap requireGestureRecognizerToFail:doubleTap];</p>

<p>[view addGestureRecognizer:singleTap];
[view addGestureRecognizer:doubleTap];
</p>

<p>In that way the singleTap recognizer will only have its action invoked if there is a delay between two taps longer than what the system has determined qualifies a double-tap. No magic numbers required.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Long</title>
		<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/comment-page-1/#comment-1371</link>
		<dc:creator>Matt Long</dc:creator>
		<pubDate>Mon, 14 Jun 2010 23:43:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=1072#comment-1371</guid>
		<description>&lt;p&gt;@ cpryland&lt;/p&gt;

&lt;p&gt;Gestures don&#039;t fix the problem. Try creating two gesture recognizers--one that responds to two taps and one that responds to one. Then set a break point in them both. If you double tap, they both still get called.&lt;/p&gt;

&lt;p&gt;Best regards.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@ cpryland</p>

<p>Gestures don&#8217;t fix the problem. Try creating two gesture recognizers&#8211;one that responds to two taps and one that responds to one. Then set a break point in them both. If you double tap, they both still get called.</p>

<p>Best regards.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: cpryland</title>
		<link>http://www.cimgf.com/2010/06/14/differentiating-tap-counts-on-ios/comment-page-1/#comment-1370</link>
		<dc:creator>cpryland</dc:creator>
		<pubDate>Mon, 14 Jun 2010 23:29:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/?p=1072#comment-1370</guid>
		<description>&lt;p&gt;Gosh, shouldn&#039;t you just assume 3.2 and use the gesture support?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Gosh, shouldn&#8217;t you just assume 3.2 and use the gesture support?</p>]]></content:encoded>
	</item>
</channel>
</rss>

