<?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>Rune&#039;s Blog</title>
	<atom:link href="http://runmad.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://runmad.com/blog</link>
	<description>A blog about code, graphics, UI, marketing and whatever else interests me</description>
	<lastBuildDate>Fri, 09 Jul 2010 00:23:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Quick guide to updating your app&#8217;s UI for iPhone 4</title>
		<link>http://runmad.com/blog/2010/06/quick-guide-to-updating-your-apps-ui-for-iphone-4/</link>
		<comments>http://runmad.com/blog/2010/06/quick-guide-to-updating-your-apps-ui-for-iphone-4/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 02:54:26 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone 4]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[retina]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://runmad.com/blog/?p=198</guid>
		<description><![CDATA[iPhone 4 will make your UI look stunning. Everything in UIKit has been scaled up already so it will require only a bit of work on your end to make the rest of your app look amazing on iPhone 4. If you only code and don&#8217;t...]]></description>
			<content:encoded><![CDATA[<p>iPhone 4 will make your UI look stunning. Everything in UIKit has been scaled up already so it will require only a bit of work on your end to make the rest of your app look amazing on iPhone 4. If you only code and don&#8217;t touch Photoshop, you&#8217;re in luck. However, if you&#8217;re a UI designer or have the skills to do your own UI, hopefully you did your original artwork in a nice high resolution &#8211; if not, you have a bit of work cut out for you with updating all the UI elements to 2x the resolution.</p>
<p>Updating your app&#8217;s UI to be compatible with iPhone 4&#8242;s <a href="http://www.apple.com/iphone/features/retina-display.html" target="_blank">Retina Display</a> is amazingly simple. Since the scale works in points, not pixels, you will have to do very little work on the layout itself. Apple Engineers have made it really simple to use new graphics for all your UI on iPhone 4, at the same time as being compatible (and not using 2x memory) on older, lower resolution, lower memory devices.</p>
<p>All you have to do is add the same image file at 2x the pixels to your app&#8217;s resources and name it the same it&#8217;s lower resolutions sibling with the following suffix: &#8220;@2x&#8221;.</p>
<p>For example, in your Resources folder, you will now need to have two image files, one for older devices called <em>myImage.png and </em>one for iPhone 4 called <em>myImage@2x.png, </em>which is twice the resolution.</p>
<p>This way, when you call <em>[UIImage imageNamed:@"myImage.png"]</em>; (or <em>contentsOfFile:)</em> iPhone 4 will <strong>automatically</strong> grab the filename with a @2x suffix, and lower resolution images will grab the lower resolution copy. You don&#8217;t have to check for the device loading the image and write any additional code to grab the correct image. Genius!</p>
<p>If you have seen an iPhone app on the iPad in 2x scale, that&#8217;s pretty much how your app is going to look on the iPhone 4. Perhaps not so drastic, but there will be a noticeable difference from app not optimized for iPhone 4 and &#8220;Retina Apps&#8221; as Apple calls them.</p>
<p><strong>Thoughts on @2x on iPad&#8230;</strong><br />
I didn&#8217;t hear anything at WWDC regarding this, but my thought is that they&#8217;ll integrate this into the iPad for the next major OS release. Basically, it will be able to do the same and grab the higher resolution image appropriately for iPhone apps running at 2x scale.</p>
<p>Happy Photoshopping to UI designers and happy relaxing programmers!</p>
<table width="100%">
<tbody>
<tr>
<td><span style="font-weight: bold; color: #000000;">UPDATE JULY 7, 2010:</span></td>
</tr>
</tbody>
</table>
<p>I have discovered a bug in Apple&#8217;s code that deals with grabbing the correct image on iPhone 4. If you are using imageWithContentsOfFile: the code will in fact not automatically grab the @2x if running on iPhone 4. I have submitted a bug report to Apple, and they&#8217;ve informed me they are now aware of the issue and the Engineers are currently working to fix the bug. So for now, stick with imageNamed: for all your images.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2010/06/quick-guide-to-updating-your-apps-ui-for-iphone-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Debugging Executables for Push Notifications</title>
		<link>http://runmad.com/blog/2010/06/debugging-executables-for-push-notifcations/</link>
		<comments>http://runmad.com/blog/2010/06/debugging-executables-for-push-notifcations/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 15:33:09 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[executable]]></category>
		<category><![CDATA[push notifications]]></category>

		<guid isPermaLink="false">http://runmad.com/blog/?p=193</guid>
		<description><![CDATA[I am implementing Push Notifications in one of my apps. Doing so may be a bit tricky in terms of debugging since you cannot actually debug incoming Push Notifications appropriately while the app is running, so I wanted to share this tip. Also, I am...]]></description>
			<content:encoded><![CDATA[<p>I am implementing Push Notifications in one of my apps. Doing so may be a bit tricky in terms of debugging since you cannot actually debug incoming Push Notifications appropriately while the app is running, so I wanted to share this tip. Also, I am writing this post on my iPad on an airplane, so pretty excited about that <img src='http://runmad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Xcode allows you to debug applications that are running locally on your device. You can even set breakpoints in your code and print out any information you may need from the console in order to debug your app and fix whatever issue you&#8217;re experiencing, should you not be able to fix it via &#8220;live&#8221; debugging.</p>
<p>This feature is especially useful if you&#8217;re doing Push Notifications (a great way to easily communicate information to your user with their permission, such as notifications, reminders, marketing (be careful with this one), etc.).</p>
<p>With Push Notifications, your app receives data from Apple Push Notification servers in a dictionary in the UIApplication delegate <em>application:didFinishLaunchingWithOptions:</em> that you&#8217;ll need to parse and do in your app whatever is appropriate for the implementation you&#8217;ve chosen (launching with specific views in front, etc.). Since your app cannot be running while receiving Push Notifications (it actually does receive notifications while running, but you&#8217;re required to deal with that through another delegate method), you&#8217;ll need to use the &#8220;debug executables&#8221; with &#8220;Wait for next launch/push notifications&#8221; ticked. Once you run the debugger and launch your app (for example directly via a Push Notifications UIAlertView) you can set breakpoints anywhere in your code and use the console to print out (po) any objects you may wish to inspect.</p>
<p>As your app launches immediately when you debug, it&#8217;s a problem if you&#8217;re debugging Push Notification (which, by the way, does not work in Simulator). So here&#8217;s the hidden treasure in Xcode: In the Groups &amp; Folder pane, find Executables, expand and select your app executable. Hit command+option+i to &#8220;Get Info&#8221; and select the Debugging tab. From here, tick &#8220;Wait for next launch/push notification&#8221;.</p>
<p><img class="aligncenter size-full wp-image-195" title="Executable Info" src="http://runmad.com/blog/wp-content/uploads/2010/06/ExecutableInfo.png" alt="" width="470" height="423" /></p>
<p>Now, when you Run &amp; Debug your app it will not launch, but instead wait until you tap the app icon to launch it or the app is launched via a Push Notification UIAlertView (this of course requires you have not set the &#8220;action-loc-key&#8221; to null in your Push Notification JSON dictionary).</p>
<p><a href="http://runmad.com/blog/wp-content/uploads/2010/06/WaitingForLaunch.png"><img class="aligncenter size-full wp-image-196" title="Waiting For Launch" src="http://runmad.com/blog/wp-content/uploads/2010/06/WaitingForLaunch.png" alt="" width="543" height="193" /></a></p>
<p>Once your app launches via a Push Notification, it will stop at the breakpoint you set and you can now print out any information you need to debug your app, such as the NSDictionary your app receives, whether the appropriate view will be displayed and any other issue you may have.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2010/06/debugging-executables-for-push-notifcations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some notes on UIView animation</title>
		<link>http://runmad.com/blog/2010/05/som-notes-on-uiview-animation/</link>
		<comments>http://runmad.com/blog/2010/05/som-notes-on-uiview-animation/#comments</comments>
		<pubDate>Mon, 17 May 2010 14:00:26 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[uibarbutton]]></category>
		<category><![CDATA[uiview]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[user interface design]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://runmad.com/blog/?p=175</guid>
		<description><![CDATA[UIView animation is a simple and nice way to add to your user experience. I just wanted to point out a few suggestions when using UIView animations. Duration (speed): If you choose to use animation to compliment some of the stuff already happening in UIKit,...]]></description>
			<content:encoded><![CDATA[<p>UIView animation is a simple and nice way to add to your user experience. I just wanted to point out a few suggestions when using UIView animations.</p>
<p><strong>Duration (speed):</strong><br />
If you choose to use animation to compliment some of the stuff already happening in UIKit, either at the same time or before/after, it makes a big difference how fast your animations are. Pretty much all the UIKit animations I have come across have a duration of 0.3f and so should yours. Of course, it&#8217;s doesn&#8217;t always work 100% but for the most part, 0.3f is what you should aim for. It&#8217;s quick so your user don&#8217;t wait for something to finish animating before continuing with the next input action, and it&#8217;s not too fast so that the user doesn&#8217;t have a chance to see where the object came from or what happened.</p>
<p>If you have an animation happening while the keyboard animates up or down, use an animationDuration of 0.3f. Same with pushing and popping the navigationController. Annotations in MKMapView also drop at a duration of 0.3f.</p>
<p>0.3f is the way to go.</p>
<p>A simple UIView animation can be added with the following code:</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#dd0000;">[</span>UIView <span style="color:#003369;">beginAnimations</span>:nil <span style="color:#003369;">context</span>:<span style="color:#003369;">nil</span><span style="color:#dd0000;">]</span>;<br />
<span style="color:#dd0000;">[</span>UIView <span style="color:#003369;">setAnimationDuration</span>:<span style="color:#0000ff;">0.3f</span><span style="color:#dd0000;">]</span>;<br />
self.segmentControl.alpha = 1.0f;<br />
<span style="color:#dd0000;">[</span>UIView <span style="color:#003369;">commitAnimations</span><span style="color:#dd0000;">]</span>;</div>
<p>The above example is from an app I&#8217;m doing, where the segmentControl is enabled and I increase its visibility in the toolBar at the same rate as a pin drops in the map within the same screen.</p>
<p><strong>When to use animation:</strong><br />
A few objects come with free animation (also at a duration of 0.3f, of course). For example, when adding a UIBarButton to your UINavigationBar, consider setting these with animation. If you replace a UIBarButton with another, they&#8217;ll even animate in and out nicely during the change. When adding a pin to a map, why not drop it onto the map with an animation, instead of it suddenly appearing on a map from nowhere?</p>
<p>Another good advice is to do animation (whether your own or with objects that include animations) to bring attention to an object. For example, if you have a pushed view, consider what you can &#8220;add&#8221; after the view has appeared through animating your objects in viewDidAppear.</p>
<p><strong>Create a better UX with animation</strong><br />
Consider all the ways you can use UIView animation blocks in your app to enhance the user experience. It&#8217;s a great way to create a more fluid and pleasant experience for your users. A user&#8217;s inputs and actions will feel less rough and more smooth and soft to the touch. Don&#8217;t go overboard with animations. Too many will become annoying and it&#8217;s important to use animations only where appropriate.</p>
<p>The best advice is probably to have a look at many of the built in apps designed by Apple as well as the many free animations that a part of UIKit objects (how UIBarButtons animate in and out when you push a UIViewController stack, how a modal view appears from the bottom, etc.).</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2010/05/som-notes-on-uiview-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why the whole world can&#8217;t have iPad now</title>
		<link>http://runmad.com/blog/2010/05/why-the-whole-world-cant-have-ipad-now/</link>
		<comments>http://runmad.com/blog/2010/05/why-the-whole-world-cant-have-ipad-now/#comments</comments>
		<pubDate>Tue, 11 May 2010 20:13:24 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[manufacturing]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[supply and demand]]></category>

		<guid isPermaLink="false">http://runmad.com/blog/?p=168</guid>
		<description><![CDATA[I was chatting with a friend today regarding the possible release of iPhone HD on the day of this year&#8217;s WWDC June 7th keynote. This lead us to talk about previous year&#8217;s release dates and whether the iPhone HD will be available worldwide on the...]]></description>
			<content:encoded><![CDATA[<p>I was chatting with a friend today regarding the possible release of iPhone HD on the day of this year&#8217;s WWDC June 7th keynote. This lead us to talk about previous year&#8217;s release dates and whether the iPhone HD will be available worldwide on the same day (or at least not a US-only release).</p>
<p>We all know the first iPhone was released a full year before becoming available anywhere else and that recently, the iPad was released in the US prior to becoming available in other countries, including Canada. The iPad&#8217;s international premiere was even pushed back another month due to the incredibly high sales in the US.</p>
<p>You may already know the reasoning behind the spread in release dates or perhaps you never thought of it, but just felt annoyed by not being able to buy awesome product at the same time as the Americans. Here are my three thoughts on why iPhone and iPad have been released with spread-out released dates.</p>
<p><strong>1. Test the waters</strong><br />
The first iPhone was a huge step for Apple. Last time they released a <a href="http://en.wikipedia.org/wiki/Newton_%28platform%29">similar product</a> it flopped. Diving face first into a packed market place with so much competition and going head-to-head with companies such as RIM, Motorola and Nokia was a huge step. You can argue that Apple was more fit this time around, but it&#8217;s still a big step, even for a company like Apple. It&#8217;s simply too risky to go ahead and release a new product in an entirely new product category (one can argue that Apple extended the mobile computing category and/or mobile phone category with the iPhone) without knowing how the product will be received <em>in reality</em> (one thing is hype (read: geeks) another thing is public reception).</p>
<p>Obviously the iPhone was a huge success and there was a big demand from international markets as well. Following the first iPhone, new models have generally been released more or less at the same time.</p>
<p>Remember the first PlayStation? Yeah, same thing&#8230; It was an entirely (though less saturated) market for Sony, which meant a late &#8217;94 release in Japan and late &#8217;95 release for the rest of the world. With the PlayStation 2 and PlayStation 3, release dates have been considerably less time apart (6 months and 6 days, respectively) from Japan to US/Europe.</p>
<p>iPad is perhaps not an entirely product for Apple (Mac + iPhone = iPad), but the spread out release dates still gives Apple a chance to test the waters and adjust their strategy for the worldwide market as needed.</p>
<p><strong>2. Supply and demand</strong><br />
Why was the iPad delayed internationally? Well, Apple actually <a href="http://www.apple.com/pr/library/2010/04/14advisory_ipad.html">said so themselves</a>. The US demand has simply been too high to keep up with production. Nintendo saw the same issue with the Wii being sold out consistently for years (however, it was simply getting ridiculous after two years. That should be enough time to sort out the manufacturing bottleneck).</p>
<p>From previous experiences, Apple was wise enough to contain the release to one market first and once they can keep up with demand in that market, open up for more markets, doubling the possible demand for iPads. Some people would argue that it&#8217;s great for buzz and hype if there&#8217;s so much demand for your product you can&#8217;t keep up with production. This was maybe true for Nintendo (I can&#8217;t imagine how stressful some parents must have been, trying to find their kids a Wii for Christmas), but Apple has a pretty clean history of being able to keep up with demand. Both the iPhone and iPad have been easily available since launch. Sure, there have been a few times and a few places where it has been hard to obtain one, but generally, anyone, not only hardcore release-day-campers or those who pre-order a month in advance, have been able to get their hands on an iPhone or iPad. The iPad has already found it&#8217;s way into the hands of a diverse group of consumers &#8211; not only the early adapters.</p>
<p><strong>3. Manufacturing strength</strong><br />
With any new product comes new manufacturing methods and requirements. This was true for the iPhone and is true for the iPad as well. Over the years, Apple has expanded it&#8217;s manufacturing facilities and collection of suppliers to accommodate high sales volumes. </p>
<p>I can&#8217;t imagine the cost of setting up a new facility to output an unproven piece of hardware and at the same time making sure enough products are initially manufactured to keep up with an expected high demand. Just the fact that they&#8217;ve been able to produce enough iPads to sell <a href="http://www.cnbc.com/id/36911690">1 million iPads in 28 days</a> is incredible considering they&#8217;re also starting production on iPads for other markets.</p>
<p>The next iPad will probably be released in all the markets where the current iPad is already available (at that time), because Apple will simply have been able to ramp up their manufacturing to accommodate the demand. </p>
<p>That&#8217;s my take on why the whole world can&#8217;t have iPad at the same time as the US. Feel free to add anything in the comments below <img src='http://runmad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2010/05/why-the-whole-world-cant-have-ipad-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UITabBarController and UIActionSheet &#8211; 65% less hit point!</title>
		<link>http://runmad.com/blog/2010/04/uitabbarcontroller-and-uiactionsheet-65-percent-less-hit-point/</link>
		<comments>http://runmad.com/blog/2010/04/uitabbarcontroller-and-uiactionsheet-65-percent-less-hit-point/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 16:05:33 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[uiactionsheet]]></category>
		<category><![CDATA[uiapplication]]></category>
		<category><![CDATA[uitabbarcontroller]]></category>

		<guid isPermaLink="false">http://runmad.com/blog/?p=111</guid>
		<description><![CDATA[Ever noticed an app where the UIActionSheet&#8217;s bottom button doesn&#8217;t want to respond to your taps, unless you hit exactly in the top of the button? If you have a UITabBarController and want to display a UIActionSheet, you have to be careful with what view...]]></description>
			<content:encoded><![CDATA[<p>Ever noticed an app where the UIActionSheet&#8217;s bottom button doesn&#8217;t want to respond to your taps, unless you hit exactly in the top of the button? If you have a UITabBarController and want to display a UIActionSheet, you have to be careful with what view you show the UIActionSheet in.</p>
<p>If a UIActionSheet is shown in &#8220;self&#8221; or &#8220;self.view&#8221; and you got a UITabBarController behind it less than half of the last button will respond to taps:</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#400080;">UIActionSheet</span> *actionSheet = [[<span style="color:#400080;">UIActionSheet</span> <span style="color:#ff0000;">alloc</span>] <span style="color:#6c0540;">initWithTitle:</span><span style="color:#760f15;">@&quot;UIActionSheet Title&quot;</span> <span style="color:#6c0540;">delegate:</span><span style="color:#881350;">nil</span> <span style="color:#6c0540;">cancelButtonTitle:</span><span style="color:#760f15;">@&quot;Cancel&quot;</span> <span style="color:#6c0540;">destructiveButtonTitle:</span><span style="color:#881350;">nil</span> <span style="color:#6c0540;">otherButtonTitles:</span><span style="color:#760f15;">@&quot;Option 1&quot;</span>, <span style="color:#760f15;">@&quot;Option 2&quot;</span>, <span style="color:#881350;">nil</span>];<br />
actionSheet.actionSheetStyle = <span style="color:#400080;">UIActionSheetStyleBlackTranslucent</span>;<br />
[actionSheet <span style="color:#6c0540;">showInView:</span><span style="color:#881350;">self</span>];<br />
[actionSheet <span style="color:#ff0000;">release</span>];</div>
<p>Here&#8217;s how much of the button will actually respond to taps:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-112" title="cannothituiactionsheet" src="http://runmad.com/blog/wp-content/uploads/2010/04/cannothituiactionsheet.png" alt="" width="414" height="251" /></p>
<p>Here&#8217;s what you need to do to fix it:</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">[actionSheet <span style="color:#6c0540;">showInView:</span>[[[<span style="color:#400080;">UIApplication</span> <span style="color:#6c0540;">sharedApplication</span>] <span style="color:#6c0540;">windows</span>] <span style="color:#6c0540;">objectAtIndex:</span><span style="color:#0000ff;">0</span>]];</div>
<p>And what it does:</p>
<p><img class="aligncenter size-full wp-image-115" title="canhituiactionsheet" src="http://runmad.com/blog/wp-content/uploads/2010/04/canhituiactionsheet.png" alt="" width="414" height="251" /></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2010/04/uitabbarcontroller-and-uiactionsheet-65-percent-less-hit-point/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Linking *directly* into your app&#039;s reviews in the App Store [UPDATED]</title>
		<link>http://runmad.com/blog/2010/01/linking-directly-into-your-apps-reviews-in-the-app-store/</link>
		<comments>http://runmad.com/blog/2010/01/linking-directly-into-your-apps-reviews-in-the-app-store/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 21:59:56 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[App Store]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[ratings]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[uialertview]]></category>

		<guid isPermaLink="false">http://www.davesenior.com/rune/?p=104</guid>
		<description><![CDATA[UPDATED 10/3: I have received some feedback regarding this post that I thought I would share: One developer implemented this feature in a UIAlertView pop-up, asking users nicely if they&#8217;re enjoying the app and whether they would like to be taken to the App Store...]]></description>
			<content:encoded><![CDATA[<table width="100%">
<tbody>
<tr>
<td><span style="font-weight: bold; color: #00000;">UPDATED 10/3:</span></td>
</tr>
</tbody>
</table>
<p>I have received some feedback regarding this post that I thought I would share:</p>
<p>One developer implemented this feature in a UIAlertView pop-up, asking users nicely if they&#8217;re enjoying the app and whether they would like to be taken to the App Store to review the app. This UIAlertView happens after the 10th app launch, so you&#8217;re already dealing with people who have used your app enough that they must be liking it. It&#8217;s a $0.99 app by the way.</p>
<p>In just two short hours after implementing this, he had received 6 new app store reviews, all with positive feedback along with 4 or 5 stars, nothing less!</p>
<p>What can we learn from this?</p>
<p>1. People are, by nature, lazy. Consider the steps required to actually reviews an app that you like: You have to actively find it again in the App Store, scroll down and go to the review page. Then tap the button to submit your own review, login, etc. Unless someone&#8217;s super excited or very pissed off about your app, you will only see a small percentage of people taking their time to go through all those steps to review and rate your app. By asking users, who&#8217;ve been using your app more than just a few times nicely for a review, then <strong>linking *directly* to the App Store, they&#8217;re already skipping many of the above steps and rating and reviewing your app becomes a quick activity related to an app they&#8217;re enjoying.</strong></p>
<p>2. Reviews are <em>generally</em> positive. <strong>Ratings on the other hand tend to be more black and white.</strong> Either people hate your app, delete it and quickly give it 1 star. I doubt a lot of people give apps 4-5 stars when they delete an app. They&#8217;re deleting it for a reason; either they didn&#8217;t like it, or it just wasn&#8217;t what they needed/expected. If they like the app, chances are they&#8217;d never delete it, and you wouldn&#8217;t be getting those great 4-5 star ratings (refer to #1). I have seen reviews that have pointed out several wrongs about apps, but they&#8217;re still adding a 4-5 star rating with the review. It may seem there&#8217;s a difference in people&#8217;s mind about a review and a rating.<strong> I think a lot of users think of reviews as a way of communicating to the developer that there&#8217;s an issue with the app, or they want this or that added, but they still use and love the app regardless (giving it a high rating)</strong>.</p>
<p>3. <strong>You&#8217;re asking the right users. </strong>When deleting an app, Apple has implemented a horrible UIAlertView asking the same people who just got rid of your app to rate it. I think we all agree this is ridiculous (refer to #2). With a UIAlertView inside your app for 10+ launches linking into the reviews of your app in the App Store, you can pretty much assume these people are enjoying the app, especially if they agree to review it. If they&#8217;re don&#8217;t like it that much or don&#8217;t have time, it&#8217;s just a simple tap to dismiss the UIAlertView.</p>
<table width="100%">
<tbody>
<tr>
<td><span style="font-weight: bold; color: #00000;">ORIGINAL:</span></td>
</tr>
</tbody>
</table>
<p>Today <a href="http://twitter.com/coffeeandiphone">@coffeeandiphone</a> we briefly discussed ratings/reviews for apps, and one person mentioned he&#8217;d like to show some of the users who have used his app more than X amount of times an alert where he&#8217;d ask them to review his app in the app store.</p>
<p>So here&#8217;s a link that will take people directly to the review section of your app in the App Store. Note, though, they won&#8217;t be able to go &#8220;Back&#8221; to the actual page for your app in the App Store (when on a device), so they can&#8217;t really see that they&#8217;re on the review page for <em>your </em>app. Therefore, you probably want to make it <em>very</em>clear where your linking to and before sending them out of your app, into the App Store.</p>
<p><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=341136260&amp;pageNumber=0&amp;sortOrdering=1&amp;type=Purple+Software&amp;mt=8">http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=341136260&amp;pageNumber=0&amp;sortOrdering=1&amp;type=Purple+Software&amp;mt=8</a></p>
<p>See where is says &#8220;?id=341136260&#8243; ? That&#8217;s the only thing you need to change. Just insert your own app ID there and you&#8217;re good to go. Don&#8217;t get confused by &#8220;type=Purple+Software&amp;mt=8&#8243;, because if you change that, it won&#8217;t work for some reason. I am not quite sure why it has to say Purple Software, but I don&#8217;t really care as long as it works <img src='http://runmad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Combine it with something like <a href="http://www.mobileorchard.com/fighting-back-against-the-app-stores-negative-rating-bias/" target="_blank">this</a> (&#8220;Fighting Back Against The App Store’s Negative Rating Bias&#8221;) and you&#8217;re good to go!</p>
<p>Edit: I can&#8217;t remember where I got this info from, but credit goes to whoever/wherever, of course.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2010/01/linking-directly-into-your-apps-reviews-in-the-app-store/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Colouring fun with moreNavigationController</title>
		<link>http://runmad.com/blog/2010/01/coloring-fun-with-morenavigationcontroller-and-it/</link>
		<comments>http://runmad.com/blog/2010/01/coloring-fun-with-morenavigationcontroller-and-it/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 16:03:40 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[barStyle]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[morenavigationcontroller]]></category>
		<category><![CDATA[tintColor]]></category>
		<category><![CDATA[uitabbarcontroller]]></category>

		<guid isPermaLink="false">http://www.davesenior.com/rune/?p=95</guid>
		<description><![CDATA[When adding more than 5 view controllers to your UITabBarController, a &#8220;More&#8221; tab is automatically setup for you, which includes a view controller and even a modal view for letting the user edit the app&#8217;s tabs in the order they want. By default, the navigation...]]></description>
			<content:encoded><![CDATA[<p>When adding more than 5 view controllers to your <em>UITabBarController</em>, a &#8220;More&#8221; tab is automatically setup for you, which includes a view controller and even a modal view for letting the user edit the app&#8217;s tabs in the order they want.</p>
<p>By default, the navigation bars for both the <em>moreNavigationController</em> and the modal view (edit) are the Default blue, but changing these colours isn&#8217;t exactly straightforward.</p>
<p>Here&#8217;s an example of what we want to achieve:</p>
<p><a href="http://runmad.com/blog/wp-content/uploads/2010/01/55780969-9ac509b43e33b4791a779eddd953138c.4b48a8ff-full1.png"><img class="aligncenter size-full wp-image-126" title="Custom colour in your moreViewController's navigation bar" src="http://runmad.com/blog/wp-content/uploads/2010/01/55780969-9ac509b43e33b4791a779eddd953138c.4b48a8ff-full1.png" alt="" width="414" height="770" /></a></p>
<p>I use an orange colour in one of my apps for the navigation bars and it just looks wrong when the more tab&#8217;s navigation bars are blue.</p>
<p>Changing the colour of the <em>moreNavigationController</em> is quite easy. After you alloc the <em>UITabBarController</em>, set the colour of the <em>moreNavigationController</em>:</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">tabBarController.moreNavigationController.navigationBar.tintColor = [<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">orangeColor</span>];</div>
<p>You can also use the <em>barStyle</em> property if you like:</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">tabBarController.moreNavigationController.navigationBar.barStyle = <span style="color:#400080;">UIBarStyleBlackOpaque</span>;</div>
<p>That wasn&#8217;t so hard. But the navigation bar for the modal view that pops up when the user taps &#8220;Edit&#8221; is still the default blue. So let&#8217;s change that as well:</p>
<p>First, if you haven&#8217;t already, make sure your AppDelegate implements the <em>UITabBarControllerDelegate</em>. Then add the optional delegate method <em>willBeginCustomizingViewControllers:</em> in your AppDelegate&#8217;s implementation file, and add the following lines of code:</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">- (<span style="color:#881350;">void</span>)<span style="color:#6c0540;">tabBarController:</span>(<span style="color:#400080;">UITabBarController</span> *)controller <span style="color:#6c0540;">willBeginCustomizingViewControllers:</span>(<span style="color:#400080;">NSArray</span> *)viewControllers {<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#400080;">UIView</span> *editView = [controller.view.subviews <span style="color:#6c0540;">objectAtIndex:</span><span style="color:#0000ff;">1</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#400080;">UINavigationBar</span> *modalNavBar = [editView.subviews <span style="color:#6c0540;">objectAtIndex:</span><span style="color:#0000ff;">0</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;modalNavBar.tintColor = [<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">orangeColor</span>];<br />
}</div>
<p>Again, it&#8217;s possible to set the <em>barStyle</em> property instead of the <em>tintColor</em>, but <em>barStyle</em> won&#8217;t give you all the colour options, of course.</p>
<p>Now that you have gained control of the modal view, you change more properties. By default, the navigation bar title says &#8220;Configure&#8221;, but you can change that as well, or how about the background colour? Here&#8217;s how:</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">- (<span style="color:#881350;">void</span>)<span style="color:#6c0540;">tabBarController:</span>(<span style="color:#400080;">UITabBarController</span> *)controller <span style="color:#6c0540;">willBeginCustomizingViewControllers:</span>(<span style="color:#400080;">NSArray</span> *)viewControllers {<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#400080;">UIView</span> *editView = [controller.view.subviews <span style="color:#6c0540;">objectAtIndex:</span><span style="color:#0000ff;">1</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;editView.backgroundColor = [<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">grayColor</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#400080;">UINavigationBar</span> *modalNavBar = [editView.subviews <span style="color:#6c0540;">objectAtIndex:</span><span style="color:#0000ff;">0</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;modalNavBar.tintColor = [<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">orangeColor</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;modalNavBar.topItem.title = <span style="color:#760f15;">@&quot;Edit Tabs&quot;</span>;<br />
}</div>
<p>Regarding the HIG&#8230; I am not sure if all this is allowed. I will be submitting an update with an orange coloured navigation bar for both those views, and I believe other apps have it (NY Times) so I don&#8217;t think it goes against the HIG.</p>
<p>However, I don&#8217;t think it&#8217;s a good idea to change the <em>backgroundColor</em> property of the &#8220;editView&#8221;. I tried with a grey colour and it doesn&#8217;t look right. It might also get your app rejected, because it&#8217;s such a big change. That your navigation bars are the same colour throughout your app only makes it look better in my opinion, rather than having a blue navigation bar clash with the rest of your beautifully designed app <img src='http://runmad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2010/01/coloring-fun-with-morenavigationcontroller-and-it/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Dedicated Static Analyzer Debug Configuration in Xcode</title>
		<link>http://runmad.com/blog/2009/12/dedicated-static-analyzer-debug-configuration-in-xcode/</link>
		<comments>http://runmad.com/blog/2009/12/dedicated-static-analyzer-debug-configuration-in-xcode/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 14:34:58 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[analyze]]></category>
		<category><![CDATA[clang]]></category>
		<category><![CDATA[tech talk]]></category>

		<guid isPermaLink="false">http://www.davesenior.com/rune/?p=90</guid>
		<description><![CDATA[I went to iPhone Tech Talk in Toronto yesterday, and among the many sessions, I attended Michael Jurewitz&#8217; (@jurewitz) session, &#8220;Testing and Debugging Your iPhone Application.&#8221; He covered a lot of the basics for using Instruments (very similar to last year&#8217;s session on that), how...]]></description>
			<content:encoded><![CDATA[<p>I went to iPhone Tech Talk in Toronto yesterday, and among the many sessions, I attended Michael Jurewitz&#8217; (<a href="http://www.twitter.com/jurewitz">@jurewitz</a>) session, &#8220;Testing and Debugging Your iPhone Application.&#8221; He covered a lot of the basics for using Instruments (very similar to last year&#8217;s session on that), how to setup provisioning, etc. for Ad-Hoc Beta testing, etc.</p>
<p>He also covered Xcode&#8217;s new built in Static Analyzer (Clang), which is incredibly useful and powerful now that it&#8217;s a part of Xcode. However, I haven&#8217;t been using it that much (he said to use it <em>at least</em> once a week), but he briefly showed that there&#8217;s actually a setting in the project&#8217;s build settings called &#8220;Run Static Analyzer,&#8221; which is a checkbox and checking this will run the Static Analyzer every time you build your project. Jurewitz mentioned you could make a duplicate Debug build configuration that is dedicated to running the Static Analyzer.</p>
<p>He went over this very fast, so I think a lot of people missed the benefit of this great tip!</p>
<p>So here&#8217;s how you do it:</p>
<p>Open your project settings and go to the Configurations pane. Pick your Debug configuration (or whichever build configuration you want to dedicate to running the Static Analyzer) and hit Duplicate in the bottom of the window. I called mine &#8220;Debug with Clang,&#8221; so I know it&#8217;s my Debug build configuration.</p>
<p><a href="http://runmad.com/blog/wp-content/uploads/2009/12/Screen-shot-2010-05-10-at-8.36.33-PM.png"><img class="aligncenter size-full wp-image-133" title="Xcode Project Build Configurations" src="http://runmad.com/blog/wp-content/uploads/2009/12/Screen-shot-2010-05-10-at-8.36.33-PM.png" alt="" width="379" height="141" /></a></p>
<p>Next, hop into the Build pane and find &#8220;Build Options&#8221;. Within those options you&#8217;ll find the &#8220;Run Static Analyzer&#8221; option. Check the checkbox and you&#8217;re good to go!</p>
<p><a href="http://runmad.com/blog/wp-content/uploads/2009/12/Run_Clang_Option1.png"><img class="aligncenter size-full wp-image-135" title="Run With Clang/Static Analyzer Option In Xcode" src="http://runmad.com/blog/wp-content/uploads/2009/12/Run_Clang_Option1.png" alt="" width="331" height="140" /></a></p>
<p>Now, every time you build your project using your new &#8220;Debug with Clang&#8221; it&#8217;ll automatically analyze your project. Personally it&#8217;ll probably help me remember to run the Static Analyzer way more often on my project, instead of just once in a while.</p>
<p>Keep in mind that running the Static Analyzer increases the time it takes to build your project, so don&#8217;t choose that build setting if you&#8217;re just testing new code, etc. Also, I find it&#8217;s a good idea to &#8220;Clean All Targets&#8221; once in while, as it seems to &#8216;reset&#8217; the Static Analyzer, because otherwise I am finding that it tends to miss certain errors on the second, third, fourth, etc. time you build with the &#8220;Run Static Analyzer&#8221; option on.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2009/12/dedicated-static-analyzer-debug-configuration-in-xcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shadow offset in custom UITableViewCells (for the inner OCD in you)</title>
		<link>http://runmad.com/blog/2009/11/shadow-offset-in-custom-uitableviewcells/</link>
		<comments>http://runmad.com/blog/2009/11/shadow-offset-in-custom-uitableviewcells/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 16:32:03 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[shadowOffset]]></category>
		<category><![CDATA[uitableview]]></category>
		<category><![CDATA[uitableviewcell]]></category>

		<guid isPermaLink="false">http://www.davesenior.com/rune/?p=68</guid>
		<description><![CDATA[Apple has a great example code for drawing fast UITableView using custom, complex UITableViewCells called AdvancedTableViewCells. In the example code, you get three versions and I prefer the one named CompositeSubviewBasedApplicationCell, because it draws your cell as one view, just like Loren Brichter&#8217;s Fast Scrolling...]]></description>
			<content:encoded><![CDATA[<p>Apple has a great example code for drawing fast UITableView using custom, complex UITableViewCells called <a href="http://developer.apple.com/iphone/library/samplecode/AdvancedTableViewCells/index.html">AdvancedTableViewCells</a>. In the example code, you get three versions and I prefer the one named <em>CompositeSubviewBasedApplicationCell</em>, because it draws your cell as one view, just like Loren Brichter&#8217;s <a href="http://blog.atebits.com/2008/12/fast-scrolling-in-tweetie-with-uitableview/">Fast Scrolling example</a>.</p>
<p>However, Apple&#8217;s example code goes a bit further than Loren&#8217;s code and adds example for drawing images, different coloured backgrounds and also has better code for handling highlighted cells in my opinion.</p>
<p>As great as the code is, they left out one small detail that really adds a bit extra to the look of your UITableView, plus I find it makes the text less blurry and easier to read. It only requires a few lines of code for each piece of text you&#8217;re drawing. The example code provided is actually from the App Store, which, if you look on your device has the nice white shadow y offset.</p>
<p>Here are the before and after pictures:</p>
<p style="text-align: center;"><a href="http://runmad.com/blog/wp-content/uploads/2009/11/cells_before1.png"><img class="aligncenter size-full wp-image-137" title="UITableViewCells before applying shadow offset" src="http://runmad.com/blog/wp-content/uploads/2009/11/cells_before1.png" alt="" width="320" height="146" /></a><strong>BEFORE</strong></p>
<p style="text-align: center;"><strong><a href="http://runmad.com/blog/wp-content/uploads/2009/11/cell_after1.png"><img class="aligncenter size-full wp-image-139" title="UITableViewCells after applying shadow offset" src="http://runmad.com/blog/wp-content/uploads/2009/11/cell_after1.png" alt="" width="320" height="146" /></a><br />
AFTER</strong></p>
<p>Original code:</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">_highlighted ? [[<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">whiteColor</span>] <span style="color:#6c0540;">set</span>] : [[<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">blackColor</span>] <span style="color:#6c0540;">set</span>];<br />
[_cell.name <span style="color:#6c0540;">drawAtPoint:</span><span style="color:#400080;">CGPointMake</span>(<span style="color:#0000ff;">81.0</span>, <span style="color:#0000ff;">22.0</span>) <span style="color:#6c0540;">withFont:</span>[<span style="color:#400080;">UIFont</span> <span style="color:#6c0540;">boldSystemFontOfSize:</span><span style="color:#0000ff;">17.0</span>]];</div>
<p>Drawing the shadow:</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#400080;">CGPoint</span> point = <span style="color:#400080;">CGPointMake</span>(<span style="color:#0000ff;">81.0</span>, <span style="color:#0000ff;">23.0</span>);<br />
_highlighted ? [[<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">clearColor</span>] <span style="color:#6c0540;">set</span>] : [[<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">colorWithWhite:</span><span style="color:#0000ff;">1.0</span> <span style="color:#6c0540;">alpha:</span><span style="color:#0000ff;">0.3</span>] <span style="color:#6c0540;">set</span>];<br />
[_cell.name <span style="color:#6c0540;">drawAtPoint:</span>point <span style="color:#6c0540;">withFont:</span>[<span style="color:#400080;">UIFont</span> <span style="color:#6c0540;">boldSystemFontOfSize:</span><span style="color:#0000ff;">17.0</span>]];<br />
point.y -= <span style="color:#0000ff;">1</span>;<br />
_highlighted ? [[<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">whiteColor</span>] <span style="color:#6c0540;">set</span>] : [[<span style="color:#400080;">UIColor</span> <span style="color:#6c0540;">blackColor</span>] <span style="color:#6c0540;">set</span>];<br />
[_cell.name <span style="color:#6c0540;">drawAtPoint:</span>point <span style="color:#6c0540;">withFont:</span>[<span style="color:#400080;">UIFont</span> <span style="color:#6c0540;">boldSystemFontOfSize:</span><span style="color:#0000ff;">17.0</span>]];</div>
<p>There are a couple of things to note in the above code. Firstly, I made a CGPoint from the original code and made the Y location one pixel lower. This is because we&#8217;re drawing the shadow first, underneath the original text. After the shadow has been drawn, we just tell the point to move up one pixel and the text will be drawn in the original location from the original code.</p>
<p>Second, you&#8217;ll need to set the text colours twice. Note that for the shadow, we need to use [UIColor clearColor] so it doesn&#8217;t look weird when highlighted. Also, set the alpha low (you need to check with your cell&#8217;s background colour), but make sure it&#8217;s not too white. It&#8217;ll be really subtle, yet noticeable to anyone who appreciate nice UI design.</p>
<p>Of course it doesn&#8217;t work with white cells, but if you&#8217;re doing any kind of custom UITableViewCell drawing it&#8217;s a nice touch. Here&#8217;s how I use it in my app:</p>
<p><a href="http://runmad.com/blog/wp-content/uploads/2009/11/Screen-shot-2009-11-16-at-11.29.31-AM1.png"><img class="aligncenter size-full wp-image-140" title="Axel.app with nice shadow offset in custom drawn cells" src="http://runmad.com/blog/wp-content/uploads/2009/11/Screen-shot-2009-11-16-at-11.29.31-AM1.png" alt="" width="414" height="770" /></a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2009/11/shadow-offset-in-custom-uitableviewcells/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Translucent UINavigationBar</title>
		<link>http://runmad.com/blog/2009/09/translucent-uinavigationbar/</link>
		<comments>http://runmad.com/blog/2009/09/translucent-uinavigationbar/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 19:22:26 +0000</pubDate>
		<dc:creator>Rune Madsen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[tintColor]]></category>
		<category><![CDATA[uinavigationbar]]></category>

		<guid isPermaLink="false">http://www.davesenior.com/rune/?p=62</guid>
		<description><![CDATA[Apparently, making your UINavigationBar requires a (tiny) bit more code than just: self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent; After trying hard to change my UINavigationBar colour, and mostly giving up, I found out you have to set its tintColor to nil. self.navigationController.navigationBar.tintColor = nil; self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;]]></description>
			<content:encoded><![CDATA[<p>Apparently, making your UINavigationBar requires a (tiny) bit more code than just:</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;">self.navigationController.navigationBar.barStyle <span class="sy0">=</span> UIBarStyleBlackTranslucent;</div>
</div>
<p>After trying hard to change my UINavigationBar colour, and mostly giving up, I found out you have to set its <em>tintColor</em> to <em>nil</em>.</p>
<div style="margin:0px 0px 20px;text-align:left;color:#000000; background-color:#F1EFE6; border: 1px solid rgb(211, 209, 199); padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#881350;">self</span>.navigationController.navigationBar.tintColor = <span style="color:#881350;">nil</span>;<br />
<span style="color:#881350;">self</span>.navigationController.navigationBar.barStyle = <span style="color:#400080;">UIBarStyleBlackTranslucent</span>;</div>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://runmad.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://runmad.com/blog/2009/09/translucent-uinavigationbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
