<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:series="http://unfoldingneurons.com/" version="2.0">

<channel>
	<title>Mobiletuts+</title>
	
	<link>http://mobile.tutsplus.com</link>
	<description>iPhone, Android, Windows and BlackBerry mobile development tutorials.</description>
	<lastBuildDate>Thu, 31 May 2012 14:49:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MobileTuts" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="mobiletuts" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">MobileTuts</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Mobile App Development Options: Which Way To Go?</title>
		<link>http://mobile.tutsplus.com/tutorials/mobile-web-apps/mobile-app-development-options-which-way-to-go/</link>
		<comments>http://mobile.tutsplus.com/tutorials/mobile-web-apps/mobile-app-development-options-which-way-to-go/#comments</comments>
		<pubDate>Thu, 31 May 2012 14:48:01 +0000</pubDate>
		<dc:creator>Mark Hammonds</dc:creator>
				<category><![CDATA[Mobile Web Apps]]></category>
		<category><![CDATA[Theory]]></category>
		<category><![CDATA[Android SDK]]></category>
		<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[mobile web]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10905</guid>
		<description>&lt;p&gt;When starting a new mobile project, the decision to build a native, hybrid, or mobile web application can be daunting. In this talk from the &lt;a href="http://windycitygo.org/"&gt;WindyCityGo conference&lt;/a&gt;, J Schwan of &lt;a href="http://www.solstice-consulting.com/"&gt;Solstice Consulting&lt;/a&gt; presents a comprehensive analysis of the pros and cons of each mobile development option.&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
&lt;iframe src="http://player.vimeo.com/video/41826120" width="500" height="375" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Key Slides &amp;amp; Quotations:&lt;/h2&gt;
&lt;blockquote&gt;&lt;p&gt;
The biggest pro of the mobile web is that it&amp;#8217;s cross-platform. You&amp;#8217;ve only gotta build it once, so that investment is much smaller.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;h4&gt;Mobile Web Pros:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Cross-platform&lt;/li&gt;
&lt;li&gt;Open standards&lt;/li&gt;
&lt;li&gt;No proprietary programming languages&lt;/li&gt;
&lt;li&gt;Easier reuse of existing enterprise tech&lt;/li&gt;
&lt;li&gt;No dependency on app stores&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Mobile Web Cons:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;No disconnected state&lt;/li&gt;
&lt;li&gt;No access to (most of) the phone&amp;#8217;s senses&lt;/li&gt;
&lt;li&gt;Device testing a challenge&lt;/li&gt;
&lt;li&gt;Writing multiple implementations&lt;/li&gt;
&lt;li&gt;No marketing/distribution through app store&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;&lt;p&gt;
Native apps are great when you need access to the phone&amp;#8217;s senses, you need a rich uncompromised user-experience. . .and the majority of your functions require disconnected access. . .
&lt;/p&gt;&lt;/blockquote&gt;
&lt;h4&gt;Native App Pros:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Native access to the phone&amp;#8217;s senses&lt;/li&gt;
&lt;li&gt;Native access to the phone&amp;#8217;s data&lt;/li&gt;
&lt;li&gt;Offline storage&lt;/li&gt;
&lt;li&gt;Richer GUI options&lt;/li&gt;
&lt;li&gt;App Store monetization/In-App Purchases&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Native App Cons:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Different Development Technologies&lt;/li&gt;
&lt;li&gt;Different IDEs&lt;/li&gt;
&lt;li&gt;Duplicate development efforts&lt;/li&gt;
&lt;li&gt;Increased support costs&lt;/li&gt;
&lt;li&gt;App Store approval queues&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;&lt;p&gt;
Hybrid apps are great when you are mobilizing an existing web app, but you need app store exposure, you want native app coverage across all platforms, your mobile web functions do not require disconnected state, and you require access to the phone&amp;#8217;s hardware for some features.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;h4&gt;Hybrid App Pros:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Majority of content portable (developed on mobile web)&lt;/li&gt;
&lt;li&gt;Disconnected state possible&lt;/li&gt;
&lt;li&gt;Some screens can be developed natively&lt;/li&gt;
&lt;li&gt;Notifications can be supported&lt;/li&gt;
&lt;li&gt;App Store exposure/monitization&lt;/li&gt;
&lt;li&gt;Decreased costs for multi-platform&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Hybrid App Cons:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Decreased user experience for mobile web delivered content&lt;/li&gt;
&lt;li&gt;Offline access not trivial for mobile web screens&lt;/li&gt;
&lt;li&gt;Multi-platform wrapper requires native and mobile web technology know-how&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;&lt;p&gt;
Ultimately, we&amp;#8217;re moving towards a mobile-based operating system and we&amp;#8217;re going to have workstations that are going to be the exception scenarios versus workstation-based systems with mobile use cases being the exception scenarios. So this is all going to flip-flop. . .As we design new products, we better be thinking about mobile.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2&gt;About the Speaker&lt;/h2&gt;
&lt;blockquote&gt;&lt;p&gt;
J Schwan is the Founder and President of Solstice Consulting as well as Solstice&amp;#8217;s product development studio, Bottega Sol. Under his leadership, Solstice has lead the industry in helping enterprises understand, embrace and adapt to emerging technologies. In addition to helping his teams build great products for Solstice&amp;#8217;s customers, J enjoys speaking about emerging technology topics at many educational institutions, technology conferences and focus groups. J enjoys playing tennis and golf, but gets most of his exercise chasing around his 3 year old daughter and 2 year old son.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;-&lt;a href="http://www.solstice-consulting.com/people.html"&gt;Solstice Consulting&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;About the Venue&lt;/h2&gt;
&lt;blockquote&gt;&lt;p&gt;
WindyCityGo is a two-day conference focused on Android, iOS, Windows Phone, and HTML5 application development. Learn how to create better mobile apps and how to sell them effectively. Meet others who are just as passionate as you. Developers, designers, entrepreneurs, &amp;#038; investors all find value in WindyCityGo.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;-&lt;a href="http://windycitygo.org/"&gt;WindyCityGo.org&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GHOl27BzRxeWJt5WsGAW03MaVuY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GHOl27BzRxeWJt5WsGAW03MaVuY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GHOl27BzRxeWJt5WsGAW03MaVuY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GHOl27BzRxeWJt5WsGAW03MaVuY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/mobile-web-apps/mobile-app-development-options-which-way-to-go/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobiletuts+ Quiz: Android User Interface Essentials</title>
		<link>http://mobile.tutsplus.com/tutorials/android/mobiletuts-quiz-android-user-interface-essentials/</link>
		<comments>http://mobile.tutsplus.com/tutorials/android/mobiletuts-quiz-android-user-interface-essentials/#comments</comments>
		<pubDate>Tue, 29 May 2012 11:30:40 +0000</pubDate>
		<dc:creator>Sue Smith</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Quizzes]]></category>
		<category><![CDATA[Android SDK]]></category>
		<category><![CDATA[Quiz]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10888</guid>
		<description>&lt;p&gt;Learning Android development can be quite a task. If you&amp;#8217;re wondering whether you have a good grasp of the essential features of Android user interfaces, test your knowledge with this quiz!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;div id="quiz-container" style="margin-bottom: 30px;"&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oKrKpZKkvPxTkZjObDXhrRrbdjQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oKrKpZKkvPxTkZjObDXhrRrbdjQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oKrKpZKkvPxTkZjObDXhrRrbdjQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oKrKpZKkvPxTkZjObDXhrRrbdjQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/android/mobiletuts-quiz-android-user-interface-essentials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reader’s Pulse: What Mobile Topics Should We Teach?</title>
		<link>http://mobile.tutsplus.com/articles/news/readers-pulse-what-mobile-topics-should-we-teach/</link>
		<comments>http://mobile.tutsplus.com/articles/news/readers-pulse-what-mobile-topics-should-we-teach/#comments</comments>
		<pubDate>Mon, 28 May 2012 11:30:02 +0000</pubDate>
		<dc:creator>Mark Hammonds</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Poll]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10882</guid>
		<description>&lt;p&gt;At Mobiletuts+, we strive to publish tutorials on as many development platforms as possible. We also frequently publish on design and marketing related material as well. This leaves us with &lt;strong&gt;&lt;em&gt;a lot&lt;/em&gt;&lt;/strong&gt; of options when planning the site&amp;#8217;s content. Help make sure we choose the best tutorials by voting in this poll!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;p&gt;&lt;script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/4720782.js"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;noscript&gt;&lt;a href="http://polldaddy.com/poll/4720782/"&gt;What topics are you interested in learning about?&lt;/a&gt;&lt;/noscript&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AC-Mk0CfzJrt2rRjm1WrxzQM2eQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AC-Mk0CfzJrt2rRjm1WrxzQM2eQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AC-Mk0CfzJrt2rRjm1WrxzQM2eQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AC-Mk0CfzJrt2rRjm1WrxzQM2eQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/articles/news/readers-pulse-what-mobile-topics-should-we-teach/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Working with CorePlot – Tuts+ Premium</title>
		<link>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-5/</link>
		<comments>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-5/#comments</comments>
		<pubDate>Sat, 26 May 2012 17:54:27 +0000</pubDate>
		<dc:creator>Aron Bury</dc:creator>
				<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[Premium]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10871</guid>
		<description>&lt;p&gt;When working with data intensive applications, a developer must often do more than just show lists of data records in a table view. The CorePlot library will allow you to add stunning data visualizations to your applications. Find out how in this Tuts+ Premium series!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Tutorial Teaser&lt;/h2&gt;
&lt;h3&gt;Where We Left Off&lt;/h3&gt;
&lt;p&gt;Last time we got into how to create a bar chart, how to customize the bar colors and how to add custom labels to our axis if we want to display custom text instead of just numbers.&lt;/p&gt;
&lt;h3&gt;What We&amp;#8217;ll Cover Today&lt;/h3&gt;
&lt;p&gt;This time we&amp;#8217;ll cover how to abstract the logic out of our controller into a more reusable data source object. Once we&amp;#8217;ve mastered this, we&amp;#8217;ll go over how to display the same data as the bar chart, except this time displaying it as a pie chart!&lt;/p&gt;
&lt;h3&gt;Step 1: Setting Up&lt;/h3&gt;
&lt;p&gt;Before we get into abstracting the data logic we&amp;#8217;re going to create our base classes for the pie chart. Just like last time, we&amp;#8217;re going to need to create a new view controller for the graph. Let&amp;#8217;s call it &amp;#8216;STPieGraphViewController&amp;#8217;.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://tutsplus.s3.amazonaws.com/tutspremium/mobile-dev/iOS-SDK_CorePlot/5/classess.png" title="Classess" /&gt;
&lt;/div&gt;
&lt;p&gt;Notice that we don&amp;#8217;t need to create a view this time because we will be able to use &amp;#8216;STGraphView&amp;#8217;. Before we start setting things up let&amp;#8217;s jump into STStudentListViewController.h and import STPieGraphViewController.h. We also need to conform to the protocol STPieGraphViewControllerDelegate (which we will create later):&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@interface STStudentListViewController : UIViewController &amp;lt;UITableViewDelegate, UITableViewDataSource, AddStudentViewControllerDelegate, UIActionSheetDelegate, STLineGraphViewControllerDelegate, STBarGraphViewControllerDelegate, STPieGraphViewControllerDelegate&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Switch over to the .m file. We need to add a button to the action sheet. Locate the graphButtonWasSelected: method. We&amp;#8217;re going to edit the second button text and add a third one:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (void)graphButtonWasSelected:(id)sender
{
    UIActionSheet *graphSelectionActionSheet = [[[UIActionSheet alloc] initWithTitle:@&amp;quot;Choose a graph&amp;quot; delegate:self cancelButtonTitle:@&amp;quot;Cancel&amp;quot; destructiveButtonTitle:nil otherButtonTitles:@&amp;quot;Enrolment over time&amp;quot;, @&amp;quot;Subject totals - Bar&amp;quot;, @&amp;quot;Subject totals - Pie&amp;quot;, nil] autorelease];

    [graphSelectionActionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
}
&lt;/pre&gt;
&lt;p&gt;Now jump into the actionSheet:clickedButtonAtIndex: method and add a clause for buttonIndex == 2:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
else if (buttonIndex == 2)
{
    STPieGraphViewController *graphVC = [[STPieGraphViewController alloc] init];
    [graphVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [graphVC setModalPresentationStyle:UIModalPresentationFullScreen];
    [graphVC setDelegate:self];
    [graphVC setManagedObjectContext:[self managedObjectContext]];

    [self presentModalViewController:graphVC animated:YES];

    [graphVC release];
}
&lt;/pre&gt;
&lt;p&gt;Just like last time, it will show some warnings because STPieGraphViewController doesn&amp;#8217;t have a delegate or managedObjectContext property.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Get the Full Series!&lt;/h2&gt;
&lt;p&gt;This tutorial series is available to &lt;a href="http://tutsplus.com/"&gt;Tuts+ Premium members only&lt;/a&gt;. Read a &lt;a href="http://tutsplus.com/tutorial/working-with-coreplot-creating-a-pie-chart"&gt;preview of this tutorial&lt;/a&gt; on the Tuts+ Premium web site or &lt;a href="http://tutsplus.com/amember/login.php"&gt;login&lt;/a&gt; to Tuts+ Premium to access the full content.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Joining Tuts+ Premium. . .&lt;/h2&gt;
&lt;p&gt;For those unfamiliar, the family of &lt;a href="http://tutsplus.com"&gt;Tuts+&lt;/a&gt; sites runs a premium membership service called Tuts+ Premium. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from &lt;a href="http://mobile.tutsplus.com"&gt;Mobiletuts+&lt;/a&gt;, &lt;a href="http://net.tutsplus.com"&gt;Nettuts+&lt;/a&gt;, &lt;a href="http://ae.tutsplus.com"&gt;Aetuts+&lt;/a&gt;, &lt;a href="http://audio.tutsplus.com"&gt;Audiotuts+&lt;/a&gt;, &lt;a href="http://vector.tutsplus.com"&gt;Vectortuts+&lt;/a&gt;, and &lt;a href="http://cg.tutsplus.com"&gt;CgTuts+&lt;/a&gt;. You&amp;#8217;ll learn from some of the best minds in the business. &lt;a href="http://tutsplus.com/mobile-premium/"&gt;Become a premium member&lt;/a&gt; to access this tutorial, as well as hundreds of other advanced tutorials and screencasts.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/N7MeHdeGqLMzeU6G9kXwc6sQdNY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N7MeHdeGqLMzeU6G9kXwc6sQdNY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/N7MeHdeGqLMzeU6G9kXwc6sQdNY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N7MeHdeGqLMzeU6G9kXwc6sQdNY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Corona SDK: Create a Balloon Game – Final Steps</title>
		<link>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-balloon-game-final-steps/</link>
		<comments>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-balloon-game-final-steps/#comments</comments>
		<pubDate>Thu, 24 May 2012 11:30:28 +0000</pubDate>
		<dc:creator>Carlos Yanez</dc:creator>
				<category><![CDATA[Corona SDK]]></category>
		<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[games]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10732</guid>
		<description>&lt;p&gt;Welcome to the final tutorial in our Bloons inspired game series! In this tutorial, we&amp;#8217;ll handle the acorn shooting, level restart and the steps to build the final app.&lt;/p&gt;
&lt;p&gt;&lt;!--more--&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Where We Left Off. . .&lt;/h2&gt;
&lt;p&gt;Please be sure to check &lt;a href="http://mobile.tutsplus.com/?p=10722"&gt;&lt;em&gt;part 1&lt;/em&gt;&lt;/a&gt; and &lt;a href="http://mobile.tutsplus.com/?p=10726"&gt;&lt;em&gt;part2&lt;/em&gt;&lt;/a&gt; of the series to fully understand this tutorial.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Hide Direction Graphic&lt;/h2&gt;
&lt;p&gt;This is the shoot function, it handles the aim and acorn creation. We&amp;#8217;ll start by showing the direction indicator.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function shot:touch(e)
	if(e.phase == 'ended') then
		-- Hide gCircle 

		Runtime:removeEventListener('enterFrame', charge)
		gCircle.isVisible = false
		gCircle.rotation = 0
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Create And Shoot Acorn&lt;/h2&gt;
&lt;p&gt;Next we create a new acorn physics object and apply the calculated impulse to shoot it.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
-- Create new Acorn 

local acorn = display.newImage('acorn.png', 84, 220)
physics.addBody(acorn, {density = 1, friction = 0, bounce = 0})
acorns:insert(acorn)

-- Shoot acorn 

acorn:applyLinearImpulse(dir, impulse, acorn.x, acorn.y )
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; Listener and Counter&lt;/h2&gt;
&lt;p&gt;A collision listener is added to the acorn to detect when it pops a balloon. The acorn counter is decreased in this part of the code.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
-- Collision Listener

		acorn:addEventListener('collision', onCollision)

		-- Update Acorn counter 

		acornsTF.text = acornsTF.text - 1
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 4:&lt;/span&gt; Update&lt;/h2&gt;
&lt;p&gt;The update function will perform a series of EnterFrame operations such as removing offstage acorns and checking for game over.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function update()
	-- Check if acorn is offstage

	for i = 1, acorns.numChildren do
		if(acorns[i].y &amp;gt; display.contentHeight) then
			display.remove(acorns[i])
			acorns[i] = nil

			-- Check for out of acorns

			if(tonumber(acornsTF.text) &amp;lt;= 0) then
				alert('lose')
			end
		end
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 5:&lt;/span&gt; Restart Level&lt;/h2&gt;
&lt;p&gt;This code runs when the Restart button is clicked. It will reset the necessary variables and listeners to restart the level.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function restartLvl()

	-- Destroy Balloons, reset score and acorns

	for i = 1, #balloons do
		display.remove(balloons[i])
	end

	scoreTF.text = '0'
	acornsTF.text = '5'

	balloons = {}

	createBalloons(5, 3)
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 6:&lt;/span&gt; Alert&lt;/h2&gt;
&lt;p&gt;The alert function stops the game, removes the listeners, and displays a game status message.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function alert(state)
	gameListeners('rmv')

	local alert

	if(state == 'win') then
		alert = display.newImage('win.png')
	else
		alert = display.newImage('lose.png')
	end

	alert:setReferencePoint(display.CenterReferencePoint)
	alert.x = display.contentCenterX
	alert.y = display.contentCenterY
	transition.from(alert, {time = 300, xScale = 0.3, yScale = 0.3})

	local score = display.newText(scoreTF.text, 220, 190, native.systemFontBold, 20)
	score:setTextColor(135, 75, 44)
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 7:&lt;/span&gt; Call Main Function&lt;/h2&gt;
&lt;p&gt;In order to initially start the game, the &lt;em&gt;Main&lt;/em&gt; function needs to be called. With the above code in place, we&amp;#8217;ll do that here:&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
Main()
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 8:&lt;/span&gt; Loading Screen&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
&lt;p&gt;&lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/3/1.png" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The Default.png file is an image that will be displayed right when you start the application while iOS loads the basic data to show the Main Screen. Add this image to your project source folder, it will be automatically added by the Corona compliler.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 9:&lt;/span&gt; Icon&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
&lt;p&gt;&lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/3/2.png" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Using the graphics you created before, you can now create a nice and good looking icon. The icon size for the non-retina iPhone icon is 57x57px, but the retina version is 114x114px and the iTunes store requires a 512x512px version. I suggest creating the 512&amp;#215;512 version first and then scaling down for the other sizes.&lt;/p&gt;
&lt;p&gt;It doesn&amp;#8217;t need to have the rounded corners or the transparent glare, iTunes and the iPhone will do that for you.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 10:&lt;/span&gt; Testing in Simulator&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
&lt;p&gt;&lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/3/3.png" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;It&amp;#8217;s time to do the final test. Open the Corona Simulator, browse to your project folder, and then click open. If everything works as expected, you are ready for the final step!&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 11:&lt;/span&gt; Build&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
&lt;p&gt;&lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/3/4.png" alt="" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;In the Corona Simulator go to &lt;em&gt;File &amp;gt; Build&lt;/em&gt; and select your target device. Fill the required data and click &lt;em&gt;build&lt;/em&gt;. Wait a few seconds and your app will be ready for device testing and/or submission for distribution!&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Experiment with the final result and try to make your custom version of the game!&lt;/p&gt;
&lt;p&gt;I hope you liked this tutorial series and find it helpful. Thank you for reading!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BL_33aQuCDtKWedbY5NFmSfw5mc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BL_33aQuCDtKWedbY5NFmSfw5mc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BL_33aQuCDtKWedbY5NFmSfw5mc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BL_33aQuCDtKWedbY5NFmSfw5mc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-balloon-game-final-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS SDK: Custom Delegates</title>
		<link>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-custom-delegates/</link>
		<comments>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-custom-delegates/#comments</comments>
		<pubDate>Wed, 23 May 2012 11:30:49 +0000</pubDate>
		<dc:creator>Aaron Crabtree</dc:creator>
				<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[Delegate]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10848</guid>
		<description>&lt;p&gt;Delegates are a useful tool in communicating between objects. In this tutorial we will create and implement a custom delegate to allow three &lt;code&gt;UISliders&lt;/code&gt; to adjust the background color of a &lt;code&gt;ViewController&lt;/code&gt;.&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;About Delegates&lt;/h2&gt;
&lt;p&gt;Messages in Objective-C are a one-way street. A parent class can send a message to its child, but the child cannot, on its own, send a message to its parent. However, with the help of a delegate, two-way communication can be achieved. &lt;code&gt;UIScrollView&lt;/code&gt; and &lt;code&gt;UITableView&lt;/code&gt; use delegates routinely to communicate between the model, view, and controller. There are many reasons why the delegate pattern is useful. A delegate might be used to make an object reusable, to provide a flexible way to send messages, or to implement customization.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Create a New Project&lt;/h2&gt;
&lt;p&gt;Launch Xcode and click File &amp;gt; New &amp;gt; Project. Select an iOS Single View Application and click &amp;quot;Next.&amp;quot; Name your product &amp;quot;Delegates&amp;quot; and enter a name for your Company Identifier, such as &amp;quot;com.companyName.delegates.&amp;quot; Choose the iPhone device family and click &amp;quot;Next.&amp;quot; Choose a location to store your project and click &amp;quot;Create.&amp;quot;&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/iOS-SDK_Delegates/Delegate_01.jpg" alt="Delegates - project setup" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Subclassing &lt;code&gt;UISlider&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Click File &amp;gt; New &amp;gt; File and choose a Cocoa Touch Objective-C class. Name your class &amp;quot;MTSlider&amp;quot; and choose &lt;code&gt;UISlider&lt;/code&gt; from the &amp;quot;Subclass of&amp;quot; drop down menu. Click &amp;quot;Next,&amp;quot; then click &amp;quot;Create.&amp;quot;&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/iOS-SDK_Delegates/Delegate_02.jpg" alt="Delegates - sublassing UISlider" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; Adding the Delegate Protocol Methods&lt;/h2&gt;
&lt;p&gt;First we need to declare the methods for the delegate. Click on &amp;quot;MTSlider.h.&amp;quot; Type the following code above the interface. &lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@class MTSlider;
@protocol MTSliderDelegate &amp;lt;NSObject&amp;gt;
@optional
- (void)MTSliderDidChange:(MTSlider *)MTSlider withValue:(CGFloat)value;
@required
- (CGFloat)startPositionForMTSlider:(MTSlider *)MTSlider;
@end
&lt;/pre&gt;
&lt;h3&gt;Compiler Directive&lt;/h3&gt;
&lt;p&gt;Notice the line &lt;code&gt;@class MTSlider&lt;/code&gt;. By placing this code above everything else, the compiler is informed that at some point down the line, &lt;code&gt;MTSlider&lt;/code&gt; will be declared. Without this compiler directive, the compiler will give you a warning because it is expecting to find the interface for &lt;code&gt;MTSlider&lt;/code&gt; right away. &lt;/p&gt;
&lt;h3&gt;Declaring the Delegate Methods&lt;/h3&gt;
&lt;p&gt;The delegate&amp;#39;s methods are declared starting with &lt;code&gt;@protocol&lt;/code&gt;. The protocol &lt;code&gt;MTSliderDelegate&lt;/code&gt; conforms to the &lt;code&gt;NSObject&lt;/code&gt; protocol for a specific reason. The &lt;code&gt;NSObject&lt;/code&gt; protocol contains a method, &lt;code&gt;respondsToSelector:&lt;/code&gt;, that can be used to ensure the delegate object actually implements an optional method before the method is called. Calling a method that isn&amp;#39;t implemented by the delegate object will cause an application to crash. &lt;/p&gt;
&lt;h3&gt;Optional Method&lt;/h3&gt;
&lt;p&gt;Plainly speaking, an optional method is a method that does not have to be implemented by the delegate object; in this case the delegate object will be the &lt;code&gt;ViewController&lt;/code&gt;, however it could be any object. The optional method &lt;code&gt;MTSliderDidChange:withValue:&lt;/code&gt; is messaged in the delegate object when the slider&amp;#39;s value changes. &lt;/p&gt;
&lt;h3&gt;Required Method&lt;/h3&gt;
&lt;p&gt;On the other hand, a required method is a method that must be implemented by the delegate object or else you will get a compiler warning. The required method &lt;code&gt;startPositionForMTSlider:&lt;/code&gt; asks the delegate object where the sliders should start and gets its starting position value in return from the delegate.&lt;/p&gt;
&lt;h3&gt;Creating an Instance Variable for the Delegate&lt;/h3&gt;
&lt;p&gt;Still in &amp;quot;MTSlider.h,&amp;quot; type the following code directly below &lt;code&gt;@interface&lt;/code&gt; to declare an instance variable, or ivar, for the delegate. &lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
id &amp;lt;MTSliderDelegate&amp;gt; sliderDelegate;
&lt;/pre&gt;
&lt;p&gt;If you &lt;strong&gt;are using ARC,&lt;/strong&gt; type the following code instead:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
__weak id &amp;lt;MTSliderDelegate&amp;gt; sliderDelegate;
&lt;/pre&gt;
&lt;p&gt;The ivar is of type &lt;code&gt;id&lt;/code&gt; so it is flexible and can accept any object type. The next part, &lt;code&gt;MTSliderDelegate&lt;/code&gt; says that whatever object ends up being assigned to &lt;code&gt;sliderDelegate&lt;/code&gt; will contain the protocol methods of &lt;code&gt;MTSliderDelegate&lt;/code&gt; as part of its own implementation. &lt;/p&gt;
&lt;h3&gt;Creating the Setters and Getters&lt;/h3&gt;
&lt;p&gt;Finish by synthesizing the setter and getter methods. Type the following code just below the instance variable closing brace. &lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@property (nonatomic, assign) id &amp;lt;MTSliderDelegate&amp;gt; sliderDelegate;
&lt;/pre&gt;
&lt;p&gt;If you &lt;strong&gt;are using ARC,&lt;/strong&gt; type the following code instead:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@property (nonatomic, weak) id &amp;lt;MTSliderDelegate&amp;gt; sliderDelegate;
&lt;/pre&gt;
&lt;p&gt;Click on &amp;quot;MTSlider.m&amp;quot; and type the following code just below &lt;code&gt;@implementation&lt;/code&gt; to complete the property.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@synthesize sliderDelegate;
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 4:&lt;/span&gt; Conforming to the Delegate Protocol Methods&lt;/h2&gt;
&lt;p&gt;Click on the &amp;quot;ViewController.h&amp;quot; file. Type the following code to conform to the &lt;code&gt;MTSliderDelegate&lt;/code&gt; protocol and import &amp;quot;MTSlider.h.&amp;quot; &lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
#import &amp;quot;MTSlider.h&amp;quot;
@interface ViewController : UIViewController &amp;lt;MTSliderDelegate&amp;gt;
&lt;/pre&gt;
&lt;h3&gt;Implementing the Delegate Protocol Methods&lt;/h3&gt;
&lt;p&gt;Click on the &amp;quot;ViewController.m&amp;quot; file and type the following code to implement the &lt;code&gt;MTSliderDelegate&lt;/code&gt; protocol methods.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (CGFloat)startPositionForMTSlider:(MTSlider *)MTSlider{

}

- (void)MTSliderDidChange:(MTSlider *)MTSlider withValue:(CGFloat)value{

}
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 5:&lt;/span&gt; Setting the Delegate&lt;/h2&gt;
&lt;h3&gt;Custom Initializer&lt;/h3&gt;
&lt;p&gt;Creating a custom initializer is key to getting the starting position for the sliders. In &amp;quot;MTSlider.h,&amp;quot; add the following code to declare the new initializer. &lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (id)initWithFrame:(CGRect)frame andDelegate:(id&amp;lt;MTSliderDelegate&amp;gt;)delegateObject;
&lt;/pre&gt;
&lt;p&gt;Click on &amp;quot;MTSlider.m&amp;quot; and look for the&lt;code&gt; initWithFrame:&lt;/code&gt; method. Delete the existing method and replace it with the following code. &lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (id)initWithFrame:(CGRect)frame andDelegate:(id&amp;lt;MTSliderDelegate&amp;gt;)delegateObject{
    self = [super initWithFrame:frame];
    if (self) {
        self.sliderDelegate = delegateObject;
        self.value = [sliderDelegate startPositionForMTSlider:self];
    }
    return self;
}
&lt;/pre&gt;
&lt;p&gt;Setting the delegate during initialization allows the delegate method to be called immediately. The method &lt;code&gt;startPositionForMTSlider:&lt;/code&gt; gets the starting location for the sliders. Because it is called in the initializer, the sliders&amp;#39; positions are set before they are drawn on the screen. &lt;/p&gt;
&lt;h3&gt;Overriding &lt;code&gt;UISlider&lt;/code&gt; Method&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;UISlider&lt;/code&gt; method &lt;code&gt;setValue:animated:&lt;/code&gt; is called automatically each time a slider peg is moved. Still in the &amp;quot;MTSlider.m&amp;quot; file, add the following method. &lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (void)setValue:(float)value animated:(BOOL)animated{
    [super setValue:value animated:animated];
    if (sliderDelegate != nil &amp;amp;&amp;amp; [sliderDelegate respondsToSelector:@selector(MTSliderDidChange:withValue:)]){
		[[self sliderDelegate] MTSliderDidChange:self withValue:value];
	}
}
&lt;/pre&gt;
&lt;p&gt;By overriding &lt;code&gt;setValue:animated:&lt;/code&gt; each time a slider peg moves, a message is sent to the delegate object. Notice the call to super, &lt;code&gt;super setValue:animated:&lt;/code&gt;. It is important that we don&amp;#39;t accidentally mess up something the method is doing behind the scenes when overriding an existing method.&lt;/p&gt;
&lt;p&gt;The delegate method &lt;code&gt;MTSliderDidChange:withValue:&lt;/code&gt; is the optional protocol method declared earlier. The delegate object is messaged each time the slider changes. Remember, calling a method that hasn&amp;#39;t been implemented will cause the application to crash. Calling &lt;code&gt;respondsToSelector:&lt;/code&gt; on the delegate object verifies it is okay to go ahead and message the optional delegate method.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 6:&lt;/span&gt; Setting the Background Color and Instantiating the Sliders&lt;/h2&gt;
&lt;p&gt;Click on the &amp;quot;ViewController.m&amp;quot; file and type the following code inside &lt;code&gt;viewDidLoad&lt;/code&gt; to set the view&amp;#39;s background color with four color components and instantiate the red, green, and blue &lt;code&gt;MTSlider&lt;/code&gt; objects. If you &lt;strong&gt;are using ARC,&lt;/strong&gt; be sure to remove the lines &lt;code&gt;[redSlider release];&lt;/code&gt;, &lt;code&gt;[greenSlider release];&lt;/code&gt;, and &lt;code&gt;[blueSlider release];&lt;/code&gt; as these calls are not necessary. &lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
CGFloat sliderColorPosition = 0.3f;
self.view.backgroundColor = [UIColor colorWithRed:sliderColorPosition green:sliderColorPosition blue:sliderColorPosition alpha:1.0f];

CGRect redSliderFrame = CGRectMake(20.0f, 20.0f, 280.0f, 28.0f);
MTSlider *redSlider = [[MTSlider alloc] initWithFrame:redSliderFrame andDelegate:self];
redSlider.tag = 1;
[self.view addSubview:redSlider];
[redSlider release];

CGRect greenSliderFrame = CGRectMake(20.0f, 70.0f, 280.0f, 28.0f);
MTSlider *greenSlider = [[MTSlider alloc] initWithFrame:greenSliderFrame andDelegate:self];
greenSlider.tag = 2;
[self.view addSubview:greenSlider];
[greenSlider release];

CGRect blueSliderFrame = CGRectMake(20.0f, 120.0f, 280.0f, 28.0f);
MTSlider *blueSlider = [[MTSlider alloc] initWithFrame:blueSliderFrame andDelegate:self];
blueSlider.tag = 3;
[self.view addSubview:blueSlider];
[blueSlider release];
&lt;/pre&gt;
&lt;p&gt;By using the custom &lt;code&gt;MTSlider&lt;/code&gt; initializer, &lt;code&gt;initWithFrame:andDelegate:&lt;/code&gt;, the delegate is set and the &lt;code&gt;ViewController&lt;/code&gt; object becomes the delegate object of each slider. Normally you might expect to see a delegate set using the following code: &lt;code&gt; redSlider.sliderDelegate=self;&lt;/code&gt;. However, in this case, the delegate assignment is passed in during the initialization. &lt;/p&gt;
&lt;p&gt;Notice each slider&amp;#39;s tag property has been set. Initially, the background color of the &lt;code&gt;ViewController&lt;/code&gt; is set to dark gray. As each slider is adjusted, the background color will change accordingly because the tag identifies which slider is active.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 7:&lt;/span&gt; Changing the Background Color&lt;/h2&gt;
&lt;p&gt;Find the implementation of &lt;code&gt;startPositionForMTSlider:&lt;/code&gt;, and type the following code inside the braces to set the initial value of the sliders to 0.3.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
CGFloat sliderStartPosition = 0.3f;
return sliderStartPosition;
&lt;/pre&gt;
&lt;h3&gt;Adjusting the Background Color&lt;/h3&gt;
&lt;p&gt;Find the implementation of &lt;code&gt;MTSliderDidChange:withValue:&lt;/code&gt;, and add the following code to adjust the background color.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
if (MTSlider.tag == 1) { //Red Slider
	CGColorRef bgColor = self.view.backgroundColor.CGColor;
	const CGFloat *colorsPointer = CGColorGetComponents(bgColor);
	CGFloat currentGreen = colorsPointer[1];
	CGFloat currentBlue = colorsPointer[2];
	self.view.backgroundColor = [UIColor colorWithRed:value green:currentGreen blue:currentBlue alpha:1.0f];

}
if (MTSlider.tag == 2) { //Green Slider
	CGColorRef bgColor = self.view.backgroundColor.CGColor;
	const CGFloat *colorsPointer = CGColorGetComponents(bgColor);
	CGFloat currentRed = colorsPointer[0];
	CGFloat currentBlue = colorsPointer[2];
	self.view.backgroundColor = [UIColor colorWithRed:currentRed green:value blue:currentBlue alpha:1.0f];

}
if (MTSlider.tag == 3) { //Blue Slider
	CGColorRef bgColor = self.view.backgroundColor.CGColor;
	const CGFloat *colorsPointer = CGColorGetComponents(bgColor);
	CGFloat currentRed = colorsPointer[0];
	CGFloat currentGreen = colorsPointer[1];
	self.view.backgroundColor = [UIColor colorWithRed:currentRed green:currentGreen blue:value alpha:1.0f];
}
&lt;/pre&gt;
&lt;p&gt;Each time the slider changes, a message is sent to the delegate method. The message contains the current &lt;code&gt;MTSlider&lt;/code&gt; and its value. The current slider&amp;#39;s tag property is accessed to determine which slider sent the message, and the background color is updated accordingly.  &lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 8:&lt;/span&gt; Testing the Delegate&lt;/h2&gt;
&lt;p&gt;Click Product &amp;gt; Run, or click the &amp;quot;Run&amp;quot; arrow in the upper left corner, to view the sliders in action. Adjust the sliders to see how the child elements are able to control the parent element&amp;#39;s background color. &lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;There are many other ways to control the background color of a &lt;code&gt;UIViewController&lt;/code&gt;, including targets or notifications. Apple designed &lt;code&gt;UISlider&lt;/code&gt; to use a target pattern to pass data. However, if you want to add more functionality, the best way to communcate from a child to its parent is by creating a custom delegate.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/m_AIBTr_uguTE_FyhYipgdln0ws/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/m_AIBTr_uguTE_FyhYipgdln0ws/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/m_AIBTr_uguTE_FyhYipgdln0ws/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/m_AIBTr_uguTE_FyhYipgdln0ws/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-custom-delegates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iOS SDK: UIKit Theme Customization</title>
		<link>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-uikit-theme-customization/</link>
		<comments>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-uikit-theme-customization/#comments</comments>
		<pubDate>Tue, 22 May 2012 11:30:42 +0000</pubDate>
		<dc:creator>C.A. Beninati</dc:creator>
				<category><![CDATA[iOS SDK]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10777</guid>
		<description>&lt;p&gt;Theme customization is a great way to stand out in the App Store, but it isn&amp;#8217;t always easy to achieve. This tutorial will teach you several basic UIKit customization tricks that will help distinguish your applications and create more memorable user experiences.&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Overview&lt;/h2&gt;
&lt;p&gt;If you&amp;#8217;ve spent any time poking around Apple&amp;#8217;s online documentation in their &lt;a href="http://developer.apple.com/devcenter/ios/index.action"&gt;iOS Dev Center&lt;/a&gt;, then you&amp;#8217;ve surely become familiar with the infamous &lt;a href="http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.html"&gt;Human Interface Guidelines&lt;/a&gt; (more casually referred to as the &amp;#8220;HIG&amp;#8221;). This document provides developers and designers of iOS applications with guidelines for how users expect to interact with Apps on the iOS platform, common usage examples, and general UI/UX principles to follow.&lt;/p&gt;
&lt;p&gt;While there are many ways to customize the appearance of your own iOS App -from changing colors and sizes to rolling your own UI elements- it is considered best practice to follow the HIG and its suggestions for providing a concise, usable interface.&lt;/p&gt;
&lt;p&gt;With that in mind, let&amp;#8217;s take a look at some ways that we can do just that while customizing our interface to suit a more unique visual theme.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;A Photo Viewer&lt;/h2&gt;
&lt;p&gt;Most iOS developers are familiar with the common attributes of the UIView class that are easy to change, such as background color, font size, or opacity. But sometimes, tweaking these properties just doesn&amp;#8217;t get us the result we need.&lt;/p&gt;
&lt;p&gt;So, to demonstrate more hands-on customization techniques, we&amp;#8217;ll work on a simple photo viewer app. This is what the app will look like without any customizations, and then with the changes that we&amp;#8217;ll perform: &lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/0-before-after.png" alt="Before/After Demo" /&gt;
&lt;/div&gt;
&lt;p&gt;Before we get started, you’ll need a few images which you can download &lt;a href="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/image-resources.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Also, I’ve set up the basic application that we’ll be using, which you can download &lt;a href="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/UIKitDemo_starter.zip"&gt;here&lt;/a&gt;. You don’t have to worry about all of the prep work; let’s just get started customizing!&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;UIViews and Their Visual Properties&lt;/h2&gt;
&lt;p&gt;With our prep app, we have a few basic components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;UINavigationBar (variable: aNavigationBar)&lt;/li&gt;
&lt;li&gt;UIImageView (variable: anImageView)&lt;/li&gt;
&lt;li&gt;UILabel (variable: aLabel)&lt;/li&gt;
&lt;li&gt;UISegmentedControl (variable: aSegmentControl)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We’ll start by making our background look a little classier by setting a background image.  To do this, let&amp;#8217;s add a method in our &amp;#8220;MTViewController&amp;#8221; class called &amp;#8220;-setupUI&amp;#8221;.&lt;/p&gt;
&lt;p&gt;We’ll add this method just below our @synthesize declarations.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (void)setupUI {
}
&lt;/pre&gt;
&lt;p&gt;Now, we need to add our background image file to our project, so get the &amp;#8220;BG-pattern.png&amp;#8221; file from the resources that you downloaded just a minute ago, and drag it into our App. I&amp;#8217;ve created a new group for our UI images called &amp;#8220;UI Graphics&amp;#8221;.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/1-add-bg.png" alt="Custom Background" /&gt;
&lt;/div&gt;
&lt;p&gt;With the image in place, we can go inside this &amp;#8220;setupUI&amp;#8221; method, and we only need to add one line:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@&amp;quot;BG-pattern.png&amp;quot;]]];
&lt;/pre&gt;
&lt;p&gt;In order to make this change live in our App, we’ll need to call our &amp;#8220;setupUI&amp;#8221; method from the &amp;#8220;viewDidLoad&amp;#8221; method of our ViewController. I&amp;#8217;ve already added a few calls to the &amp;#8220;viewDidLoad&amp;#8221; method, so we can just add this one at the beginning:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (void)viewDidLoad
{
    // set up the custom UI elements
    [self setupUI];

    // build arrays for images and titles
    [self setupData];

    // start app with first segment selected
    [self didChangeSegmentControl:aSegmentControl];

    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}
&lt;/pre&gt;
&lt;p&gt;Now, let&amp;#8217;s make our image stand out a little bit by adding a white border around it. To do this, we&amp;#8217;ll be working with CALayers, which means that we need to first include the QuartzCore framework into our project.&lt;/p&gt;
&lt;p&gt;So go to our UIKitDemo project and we’ll select our target (UIKitDemo). Then we’ll go over to the tab titled &amp;#8220;Build Phases&amp;#8221;, and show the &amp;#8220;Link Binary With Libraries&amp;#8221; section.  &lt;/p&gt;
&lt;p&gt;At the bottom, we click the &amp;#8220;+&amp;#8221; button and choose &amp;#8220;QuartzCore.framework&amp;#8221;. &lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/2-add-quartz.png" alt="Adding QuartzCore Framework" /&gt;
&lt;/div&gt;
&lt;p&gt;Finally, we have to &lt;code&gt;#import&lt;/code&gt; Quartz into our ViewController (MTViewController.m).&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
#import &amp;lt;QuartzCore/QuartzCore.h&amp;gt;
&lt;/pre&gt;
&lt;p&gt;With Quartz in place, we can start fiddling around with the anImageView sublayers. We’ll add the following to our &amp;#8220;setupUI&amp;#8221; method to add the border around our ImageView:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [anImageView.layer setBorderWidth:5.0f];
    [anImageView.layer setBorderColor:[[UIColor whiteColor] CGColor]];
&lt;/pre&gt;
&lt;p&gt;If we build and run our App now, we can see a neat, white border around our ImageView.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/3-image-border.png" alt="Image Border" /&gt;
&lt;/div&gt;
&lt;p&gt;Now, to make our image stick out even more, we can put a subtle shadow behind it using similar methods:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [anImageView.layer setShadowRadius:5.0f];
    [anImageView.layer setShadowOpacity:.85f];
    [anImageView.layer setShadowOffset:CGSizeMake(1.0f, 2.0f)];
    [anImageView.layer setShadowColor:[[UIColor blackColor] CGColor]];
    [anImageView.layer setShouldRasterize:YES];
    [anImageView.layer setMasksToBounds:NO];
&lt;/pre&gt;
&lt;p&gt;A few of these commands aren’t immediately obvious as to their function, so we’ll look at those line-by-line:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [anImageView.layer setShadowRadius:5.0f];
&lt;/pre&gt;
&lt;p&gt;We’re starting out by setting the amount of &amp;#8220;blur&amp;#8221; our shadow will have.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [anImageView.layer setShadowOffset:CGSizeMake(1.0f, 2.0f)];
&lt;/pre&gt;
&lt;p&gt;Next, we create an offset for our shadow, so that it’s not just directly behind our image.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [anImageView.layer setShouldRasterize:YES];
&lt;/pre&gt;
&lt;p&gt;This command will help with performance, as it makes sure the shadow is only drawn once and then saved as a bitmap, avoiding the need for the App to re-draw the processor intensive transparent layer.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [anImageView.layer setMasksToBounds:NO];
&lt;/pre&gt;
&lt;p&gt;Finally, we want to make sure that we&amp;#8217;re not cutting off our shadow, since it spreads out beyond our original view&amp;#8217;s bounds.&lt;/p&gt;
&lt;p&gt;Try running the App again, and you&amp;#8217;ll see a nice shadow behind our image.&lt;/p&gt;
&lt;p&gt;We have a lot of hard edges, so let&amp;#8217;s soften up our interface by making our UILabel (aLabel) have rounded corners.&lt;/p&gt;
&lt;p&gt;We can do this in the same &amp;#8220;setupUI&amp;#8221; method beneath the UIImageView customizations. All we need is one simple line to make this work:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [aLabel.layer setCornerRadius:15.0f];
&lt;/pre&gt;
&lt;p&gt;Now, the final change to our &amp;#8220;setupUI&amp;#8221; method will rotate our UIImageView slightly, which will break up the &amp;#8220;square&amp;#8221; feeling of the rest of the layout.&lt;/p&gt;
&lt;p&gt;We can do this with two more lines at the bottom of our &amp;#8220;setupUI&amp;#8221; method:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    CGAffineTransform transform = CGAffineTransformMakeRotation(.03f);
    anImageView.transform = transform;
&lt;/pre&gt;
&lt;p&gt;And that&amp;#8217;s it for our &amp;#8220;setupUI&amp;#8221;.  Not too bad for only a few lines of code, right?&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/4-image-and-label.png" alt="Image and Label Figure" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;UIKit Customization&lt;/h2&gt;
&lt;p&gt;With the release of iOS 5 came a new protocol for subclasses of UIViews called &amp;#8220;appearance&amp;#8221;.  This protocol allows us to modify certain aspects of our standard UIKit components as we like- such as setting custom background images, shadows, color effects and more.&lt;/p&gt;
&lt;p&gt;A simple example of this is the UINavigationBar.  We can now set custom images to change our UINavigationBars to suit our App’s themes without any hassle:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault];
&lt;/pre&gt;
&lt;p&gt;In this case, we have a UIImage named &amp;#8220;navBarImage&amp;#8221;, which we are setting as the default image for our UINavigationBar. The &amp;#8220;appearance&amp;#8221; call is going to affect our UINavigationBar class, not just a single instance. This means that our changes will be applied to all UINavigationBars that we use in this App.  &lt;/p&gt;
&lt;p&gt;To implement this change in our current Photo Viewer project, we need to go to our AppDelegate class (MTAppDelegate). We&amp;#8217;re going to the AppDelegate because we want our change to affect all of the instances of UINavigationBars in our App, so in order to ensure that our changes are made, we&amp;#8217;ll implement them immediately after the App is opened.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s start by adding the method to our &amp;#8220;MTAppDelegate&amp;#8221; class right after our &lt;code&gt;@synthesize&lt;/code&gt; declarations, just like we did in our &amp;#8220;MTViewController&amp;#8221; class:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (void)setupUI {
}
&lt;/pre&gt;
&lt;p&gt;Now, we&amp;#8217;ll import our &amp;#8220;navBar.png&amp;#8221; image (from the image resources folder you downloaded earlier).&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/5-import-navbar.png" alt="Import NavBar" /&gt;
&lt;/div&gt;
&lt;p&gt;We can then create the UIImage instance that we’ll be using for our background:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    UIImage *navBarImage = [UIImage imageNamed:@&amp;quot;navBar.png&amp;quot;];
&lt;/pre&gt;
&lt;p&gt;And right after that, we can make our &amp;#8220;appearance&amp;#8221; call:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault];
&lt;/pre&gt;
&lt;p&gt;Before this change is active though, we need to call our &amp;#8220;setupUI&amp;#8221; method from the &lt;code&gt;application:didFinishLaunchingWithOptions:&lt;/code&gt; method.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self setupUI];

	...
}
&lt;/pre&gt;
&lt;p&gt;You can run your App now -notice the dark background in our &lt;code&gt;UINavigationBar&lt;/code&gt; at the top.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/6-UINav-dark.png" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;For our next trick, things get a little bit more complicated. We&amp;#8217;re going to set custom images for our UISegmentedControl. The tricky part here is that we&amp;#8217;re not just dealing with one or two background images, but instead we have to work with specific sections of images; such as the rounded ends, selected or unselected middle sections, the dividing line between two segments, etc&amp;#8230;&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/7-UISegment-sections.png" alt="UISegment Sections" /&gt;
&lt;/div&gt;
&lt;p&gt;First off, if you haven’t already, import the remaining images in the image resource folder you downloaded.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="http://d339vfjsz5zott.cloudfront.net/iOS-SDK_UIKit-Theme-Customization/8-UISegment-import.png" alt="UISegment Import" /&gt;
&lt;/div&gt;
&lt;p&gt;Just like the UINavigationBar that we modified a minute ago, we need to do two things to get our UISegmentedControl changed.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create the UIImages for our backgrounds&lt;/li&gt;
&lt;li&gt;Apply the UIImages for their respective states&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I don&amp;#8217;t have enough time here to break down each of these actions step-by-step, but I’ll address some of the main ones in a minute. For now, append the following code to your &amp;#8220;setupUI&amp;#8221; method:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    UIImage *segmentSelected =
    [[UIImage imageNamed:@&amp;quot;segcontrol_sel.png&amp;quot;]
     resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)];
    UIImage *segmentUnselected =
    [[UIImage imageNamed:@&amp;quot;segcontrol_uns.png&amp;quot;]
     resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)];
    UIImage *segmentSelectedUnselected =
    [UIImage imageNamed:@&amp;quot;segcontrol_sel-uns.png&amp;quot;];
    UIImage *segUnselectedSelected =
    [UIImage imageNamed:@&amp;quot;segcontrol_uns-sel.png&amp;quot;];
    UIImage *segmentUnselectedUnselected =
    [UIImage imageNamed:@&amp;quot;segcontrol_uns-uns.png&amp;quot;];
&lt;/pre&gt;
&lt;p&gt;This creates our UIImages, and performs resizing as appropriate.  You’ll notice this little bit:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
	resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)
&lt;/pre&gt;
&lt;p&gt;This allows us to essentially &amp;#8220;crop&amp;#8221; our image file by cutting into it by certain margins.  In this case, we’re leaving the top as is, moving 15pts in from the left side, leaving the bottom as it is, and moving 15pts in from the right side. That leaves us with the middle section which will expand to the necessary width, but the rounded ends will stay the same- bookending our stretched middle.&lt;/p&gt;
&lt;p&gt;For more information on &amp;#8220;resizableImageWithCapInsets:&amp;#8221;, check out the &lt;a href="http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006890-CH3-SW50"&gt;official Apple documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With our images sized and ready, we can set the different states of our UISegmentedControl. Each of the five images we just added will have a corresponding state:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
    [[UISegmentedControl appearance] setBackgroundImage:segmentUnselected
                                               forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    [[UISegmentedControl appearance] setBackgroundImage:segmentSelected
                                               forState:UIControlStateSelected barMetrics:UIBarMetricsDefault];

    [[UISegmentedControl appearance] setDividerImage:segmentUnselectedUnselected
                                 forLeftSegmentState:UIControlStateNormal
                                   rightSegmentState:UIControlStateNormal
                                          barMetrics:UIBarMetricsDefault];

    [[UISegmentedControl appearance] setDividerImage:segmentSelectedUnselected
                                 forLeftSegmentState:UIControlStateSelected
                                   rightSegmentState:UIControlStateNormal
                                          barMetrics:UIBarMetricsDefault];

    [[UISegmentedControl appearance] setDividerImage:segUnselectedSelected
                                forLeftSegmentState:UIControlStateNormal
                                   rightSegmentState:UIControlStateSelected
                                          barMetrics:UIBarMetricsDefault];
&lt;/pre&gt;
&lt;p&gt;Unlike a simple UIButton, which is basically either selected or not, our UISegmentedControl can also check what the state is on either side of the current segment, but it’s not too complex once we’ve gotten the hang of it.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;With the new features in iOS 5, and some creative work with Quartz, we can quickly and easily get our Apps to look just as we please. Some challenges that present themselves with UI customization are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Finding good graphics that are easy to manipulate.&lt;/li&gt;
&lt;li&gt;Ensuring that you keep your focus on the user experience.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It can be relatively easy to find good graphics, and there are plenty of good designers out there willing to help. It can be more difficult sometimes to keep the focus on the &amp;#8220;why&amp;#8221; and not just the &amp;#8220;how&amp;#8221; of UI customization. To quote the fictitious Dr. Ian Malcolm in &lt;em&gt;Jurassic Park&lt;/em&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
[They] were so preoccupied with whether they could that they didn&amp;#8217;t stop to think if they should.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;As always, go out, try new things, tweak settings, and explore the many other ways you can customize your iOS interfaces!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pHoKCQfZ5gXGa0eLtylP6cM_eSM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pHoKCQfZ5gXGa0eLtylP6cM_eSM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pHoKCQfZ5gXGa0eLtylP6cM_eSM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pHoKCQfZ5gXGa0eLtylP6cM_eSM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-uikit-theme-customization/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Corona SDK: Create a Balloon Game – Interaction</title>
		<link>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-balloon-game-interaction/</link>
		<comments>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-balloon-game-interaction/#comments</comments>
		<pubDate>Mon, 21 May 2012 14:20:15 +0000</pubDate>
		<dc:creator>Carlos Yanez</dc:creator>
				<category><![CDATA[Corona SDK]]></category>
		<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[games]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10726</guid>
		<description>&lt;p&gt;This is the second installment in our Corona SDK Bloons inspired Game tutorial. In today&amp;#8217;s tutorial, we&amp;#8217;ll add to our interface and start coding the game interaction. Read on!&lt;/p&gt;
&lt;p&gt;&lt;!--more--&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Where We Left Off. . .&lt;/h2&gt;
&lt;p&gt;Please be sure to check &lt;a href="http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-bloons-like-game/"&gt;&lt;em&gt;part 1&lt;/em&gt; of the series&lt;/a&gt; to fully understand and prepare for this tutorial.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Declare Functions&lt;/h2&gt;
&lt;p&gt;Declare all  functions as &lt;em&gt;local&lt;/em&gt; at the start.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
local Main = {}
local startButtonListeners = {}
local showCredits = {}
local hideCredits = {}
local showGameView = {}
local gameListeners = {}
local startCharge = {}
local charge = {}
local shot = {}
local onCollision = {}
local startGame = {}
local createBalloons = {}
local update = {}
local restartLvl = {}
local alert = {}
local restart = {}
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Constructor&lt;/h2&gt;
&lt;p&gt;Next, we&amp;#8217;ll create the function that will initialize all the game logic:&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function Main()
	-- code...
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; Add Title View&lt;/h2&gt;
&lt;p&gt;Now we place the TitleView in the stage and call a function that will add the &lt;em&gt;tap&lt;/em&gt; listeners to the buttons.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
titleBg = display.newImage('titleBg.png')
playBtn = display.newImage('playBtn.png', display.contentCenterX - 25.5, display.contentCenterY + 40)
creditsBtn = display.newImage('creditsBtn.png', display.contentCenterX - 40.5, display.contentCenterY + 85)
titleView = display.newGroup(titleBg, playBtn, creditsBtn)	

startButtonListeners('add')
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 4:&lt;/span&gt; Start Button Listeners&lt;/h2&gt;
&lt;p&gt;This function adds the necesary listeners to the &lt;em&gt;TitleView&lt;/em&gt; buttons.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function startButtonListeners(action)
	if(action == 'add') then
		playBtn:addEventListener('tap', showGameView)
		creditsBtn:addEventListener('tap', showCredits)
	else
		playBtn:removeEventListener('tap', showGameView)
		creditsBtn:removeEventListener('tap', showCredits)
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 5:&lt;/span&gt; Show Credits&lt;/h2&gt;
&lt;p&gt;The credits screen is shown when the user taps the about button. A &lt;em&gt;tap&lt;/em&gt; listener is added to the credits view to remove it.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function showCredits:tap(e)
	playBtn.isVisible = false
	creditsBtn.isVisible = false
	creditsView = display.newImage('credits.png')
	transition.from(creditsView, {time = 300, x = -creditsView.width, onComplete = function() creditsView:addEventListener('tap', hideCredits) creditsView.x = creditsView.x - 0.5 end})
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 6:&lt;/span&gt; Hide Credits&lt;/h2&gt;
&lt;p&gt;When the credits screen is tapped, it&amp;#8217;ll be tweened out of the stage and removed.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function hideCredits:tap(e)
    playBtn.isVisible = true
    creditsBtn.isVisible = true
    transition.to(creditsView, {time = 300, x = -creditsView.width, onComplete = function() creditsView:removeEventListener('tap', hideCredits) display.remove(creditsView) creditsView = nil end})
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 7:&lt;/span&gt; Show Game View&lt;/h2&gt;
&lt;p&gt;When the &lt;em&gt;Start&lt;/em&gt; button is tapped the title view is tweened and removed, revealing the game view.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function showGameView:tap(e)
	transition.to(titleView, {time = 300, x = -titleView.height, onComplete = function() startButtonListeners('rmv') display.remove(titleView) titleView = nil startGame() end})

	-- Add GFX

	infoBar = display.newImage('infoBar.png', 0, 276)
	restartBtn = display.newImage('restartBtn.png', 443, 286)
	squirrel = display.newImage('squirrel.png', 70, 182)
	gCircle = display.newImage('gCircle.png', 83, 216)
	gCircle:setReferencePoint(display.CenterReferencePoint)

	targetTF = display.newText('0', 123, 287, native.systemFontBold, 14)
	targetTF:setTextColor(238, 238, 238)

	scoreTF = display.newText('0', 196, 287, native.systemFontBold, 14)
	scoreTF:setTextColor(238, 238, 238)

	acornsTF = display.newText('5', 49, 287, native.systemFontBold, 13)
	acornsTF:setTextColor(238, 238, 238)
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 8:&lt;/span&gt; Game Listeners&lt;/h2&gt;
&lt;p&gt;This code adds tap listeners to the game background. These will be used to shoot the acorns to the balloons. A &lt;em&gt;tap&lt;/em&gt; listener is also added to the restart button.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function gameListeners(action)
	if(action == 'add') then
		bg:addEventListener('touch', startCharge)
		bg:addEventListener('touch', shot)
		restartBtn:addEventListener('tap', restartLvl)
		Runtime:addEventListener('enterFrame', update)
	else
		bg:removeEventListener('touch', startCharge)
		bg:removeEventListener('touch', shot)
		restartBtn:removeEventListener('tap', restartLvl)
		Runtime:removeEventListener('enterFrame', update)
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 9:&lt;/span&gt; Start Game&lt;/h2&gt;
&lt;p&gt;Here we start the game by hiding the direction indicator, adding the game listeners and calling the function that generates the balloons.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function startGame()
	-- Hide gCircle 

	gCircle.isVisible = false

	-- Create balloon function 

	gameListeners('add')
	createBalloons(5, 3)
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 10:&lt;/span&gt; Create Balloons&lt;/h2&gt;
&lt;p&gt;A double for loop is used to create and place the balloons on the stage. The balloon is then added to a table. This will grant us access to the balloons outside this function.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function createBalloons(h, v)
	for i = 1, h do
		for j = 1, v do
			local balloon = display.newImage('balloon.png', 300 + (i * 20), 120 + (j * 30))
			balloon.name = 'balloon'
			physics.addBody(balloon)
			balloon.bodyType = 'static'
			table.insert(balloons, balloon)
		end
	end

	-- Set balloon counter 

	targetTF.text = #balloons
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 11:&lt;/span&gt; Collisions&lt;/h2&gt;
&lt;p&gt;This function handles the acorn-balloon collisions.&lt;/p&gt;
&lt;p&gt;When this occur, the balloon is removed from the stage and a sound is played. We also update the score and target textfields.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function onCollision(e)
	if(e.other.name == 'balloon') then
		display.remove(e.other)
		e.other = nil
		audio.play(pop)
		scoreTF.text = scoreTF.text + 50
		scoreTF:setReferencePoint(display.TopLeftReferencePoint)
		scoreTF.x = 196
		targetTF.text = targetTF.text - 1
	end

	if(targetTF.text == '0') then
		alert('win')
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 12:&lt;/span&gt; Start Charge&lt;/h2&gt;
&lt;p&gt;This code will reveal the direction indicator, reset the acorn&amp;#8217;s impulse variable, and add a frame listener that will handle the aim and impulse value.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function startCharge:touch(e)
	if(e.phase == 'began') then
		impulse = 0
		gCircle.isVisible = true
		Runtime:addEventListener('enterFrame', charge)
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 13:&lt;/span&gt; Charge&lt;/h2&gt;
&lt;p&gt;The aim rotates accordingly to the direction that will take the acorn, which is set by the impulse variable.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function charge()
	gCircle.rotation = gCircle.rotation - 3
	impulse = impulse - 0.2

	-- Prevent over rotation

	if(gCircle.rotation &amp;lt; -46) then
		gCircle.rotation = -46
		impulse = -3.2
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 14: &lt;/span&gt;Code Review&lt;/h2&gt;
&lt;p&gt;Here is the full code written in this tutorial, alongside with the comments to help you identify each part:&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
-- Balloons Physics Game
-- Developed by Carlos Yanez

-- Hide Status Bar

display.setStatusBar(display.HiddenStatusBar)

-- Physics

local physics = require('physics')
physics.start()

-- Graphics

-- [Background]

local bg = display.newImage('gameBg.png')

-- [Title View]

local titleBg
local playBtn
local creditsBtn
local titleView

-- [Credits]

local creditsView

-- [Game View]

local gCircle
local squirrel
local infoBar
local restartBtn

-- [TextFields]

local scoreTF
local targetTF
local acornsTF

-- Load Sound

local pop = audio.loadSound('pop.mp3')

-- Variables

local titleView
local credits
local acorns = display.newGroup()
local balloons = {}
local impulse = 0
local dir = 3

-- Functions

local Main = {}
local startButtonListeners = {}
local showCredits = {}
local hideCredits = {}
local showGameView = {}
local gameListeners = {}
local startCharge = {}
local charge = {}
local shot = {}
local onCollision = {}
local startGame = {}
local createBalloons = {}
local update = {}
local restartLvl = {}
local alert = {}
local restart = {}

-- Main Function

function Main()
	titleBg = display.newImage('titleBg.png')
	playBtn = display.newImage('playBtn.png', display.contentCenterX - 25.5, display.contentCenterY + 40)
	creditsBtn = display.newImage('creditsBtn.png', display.contentCenterX - 40.5, display.contentCenterY + 85)
	titleView = display.newGroup(titleBg, playBtn, creditsBtn)

	startButtonListeners('add')
end

function startButtonListeners(action)
	if(action == 'add') then
		playBtn:addEventListener('tap', showGameView)
		creditsBtn:addEventListener('tap', showCredits)
	else
		playBtn:removeEventListener('tap', showGameView)
		creditsBtn:removeEventListener('tap', showCredits)
	end
end

function showCredits:tap(e)
	playBtn.isVisible = false
	creditsBtn.isVisible = false
	creditsView = display.newImage('credits.png')
	transition.from(creditsView, {time = 300, x = -creditsView.width, onComplete = function() creditsView:addEventListener('tap', hideCredits) creditsView.x = creditsView.x - 0.5 end})
end

function hideCredits:tap(e)
	playBtn.isVisible = true
	creditsBtn.isVisible = true
	transition.to(creditsView, {time = 300, x = -creditsView.width, onComplete = function() creditsView:removeEventListener('tap', hideCredits) display.remove(creditsView) creditsView = nil end})
end

function showGameView:tap(e)
	transition.to(titleView, {time = 300, x = -titleView.height, onComplete = function() startButtonListeners('rmv') display.remove(titleView) titleView = nil startGame() end})

	-- Add GFX

	infoBar = display.newImage('infoBar.png', 0, 276)
	restartBtn = display.newImage('restartBtn.png', 443, 286)
	squirrel = display.newImage('squirrel.png', 70, 182)
	gCircle = display.newImage('gCircle.png', 83, 216)
	gCircle:setReferencePoint(display.CenterReferencePoint)

	targetTF = display.newText('0', 123, 287, native.systemFontBold, 14)
	targetTF:setTextColor(238, 238, 238)

	scoreTF = display.newText('0', 196, 287, native.systemFontBold, 14)
	scoreTF:setTextColor(238, 238, 238)

	acornsTF = display.newText('5', 49, 287, native.systemFontBold, 13)
	acornsTF:setTextColor(238, 238, 238)
end

function gameListeners(action)
	if(action == 'add') then
		bg:addEventListener('touch', startCharge)
		bg:addEventListener('touch', shot)
		restartBtn:addEventListener('tap', restartLvl)
		Runtime:addEventListener('enterFrame', update)
	else
		bg:removeEventListener('touch', startCharge)
		bg:removeEventListener('touch', shot)
		restartBtn:removeEventListener('tap', restartLvl)
		Runtime:removeEventListener('enterFrame', update)
	end
end

function startGame()
	-- Hide gCircle 

	gCircle.isVisible = false

	-- Create balloon function 

	gameListeners('add')
	createBalloons(5, 3)
end

function createBalloons(h, v)
	for i = 1, h do
		for j = 1, v do
			local balloon = display.newImage('balloon.png', 300 + (i * 20), 120 + (j * 30))
			balloon.name = 'balloon'
			physics.addBody(balloon)
			balloon.bodyType = 'static'
			table.insert(balloons, balloon)
		end
	end

	-- Set balloon counter 

	targetTF.text = #balloons
end

function onCollision(e)
	--if(e.other.name == 'balloon' and e.phase == 'ended') then
	if(e.other.name == 'balloon') then
		display.remove(e.other)
		e.other = nil
		audio.play(pop)
		scoreTF.text = scoreTF.text + 50
		scoreTF:setReferencePoint(display.TopLeftReferencePoint)
		scoreTF.x = 196
		targetTF.text = targetTF.text - 1
	end

	if(targetTF.text == '0') then
		alert('win')
	end
end

function startCharge:touch(e)
	if(e.phase == 'began') then
		impulse = 0
		gCircle.isVisible = true
		Runtime:addEventListener('enterFrame', charge)
	end
end

function charge()
	gCircle.rotation = gCircle.rotation - 3
	impulse = impulse - 0.2

	-- Prevent over rotation

	if(gCircle.rotation &amp;lt; -46) then
		gCircle.rotation = -46
		impulse = -3.2
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Next Time&amp;#8230;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;In the next and final part of the series, we&amp;#8217;ll handle the acorn shooting, level restart, and the final steps to take prior to release like app testing, creating a start screen, adding an icon and, finally, building the app. Stay tuned for the final part!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HO7EkwWTtlpmDLLWTQxnzmpBJP4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HO7EkwWTtlpmDLLWTQxnzmpBJP4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HO7EkwWTtlpmDLLWTQxnzmpBJP4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HO7EkwWTtlpmDLLWTQxnzmpBJP4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-balloon-game-interaction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Working With CorePlot – Tuts+ Premium</title>
		<link>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-4/</link>
		<comments>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-4/#comments</comments>
		<pubDate>Fri, 18 May 2012 07:03:38 +0000</pubDate>
		<dc:creator>Aron Bury</dc:creator>
				<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[Premium]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10749</guid>
		<description>&lt;p&gt;When working with data intensive applications, a developer must often do more than just show lists of data records in a table view. The CorePlot library will allow you to add stunning data visualizations to your applications. Find out how in this Tuts+ Premium series!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Tutorial Teaser&lt;/h2&gt;
&lt;h3&gt;Where We Left Off&lt;/h3&gt;
&lt;p&gt;Last time we went over how to customize the look and style of a line graph (or scatter plot) using classes such as CPTMutableTextStyle and CPTMutableLineStyle. We learned how to customize the X and Y axis increments and number styles using the CPTXYAxisSet and CPTXYAxis classes. We also looked at how to add multiple plots to your graph and modify the data source methods to provide the correct data for the right plots using plot identifiers.&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;What We&amp;#8217;ll Cover Today&lt;/h3&gt;
&lt;p&gt;Today we&amp;#8217;ll be working with a completely new graph. We will be creating a bar chart that shows the total number of students in each subject with each bar representing a subject. We&amp;#8217;ll also look at how to customize the look and feel of the graph. Let&amp;#8217;s get started!&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;Step 1: Setting Up&lt;/h3&gt;
&lt;p&gt;First up we need to add the relevant classes to our project. Let&amp;#8217;s create a ViewController called &amp;#8216;STBarGraphViewController&amp;#8217; and a &amp;#8216;STGraphView&amp;#8217;. (Make sure you put them in the relevant groups)&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://tutsplus.s3.amazonaws.com/tutspremium/mobile-dev/iOS-SDK_CorePlot/4/classess.png" title="classess.png" /&gt;
&lt;/div&gt;
&lt;p&gt;Notice the naming of the view to &amp;#8216;STGraphView&amp;#8217; instead of &amp;#8216;STBarGraphView&amp;#8217;. Going forward we will be using this view to display the bar and pie graphs.&lt;/p&gt;
&lt;p&gt;Before we start working with any code we need to add a button to the Action sheet of our student list view. First open up &amp;#8216;STStudentListViewController.h&amp;#8217; and import STBarGraphViewController. Add STBarGraphViewControllerDelegate to the list of registered protocols (the protocol actually doesn&amp;#8217;t exist yet but we will create it later):&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@interface STStudentListViewController : UIViewController &amp;lt;UITableViewDelegate, UITableViewDataSource, AddStudentViewControllerDelegate, UIActionSheetDelegate, STLineGraphViewControllerDelegate, STBarGraphViewControllerDelegate&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Next, jump into the .m file and locate the &amp;#8216;graphButtonWasSelected:&amp;#8217; method. Add &amp;#8216;Enrolment by subject&amp;#8217; to the list of &amp;#8216;otherButtonTitles:&amp;#8217;:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
UIActionSheet *graphSelectionActionSheet = [[[UIActionSheet alloc] initWithTitle:@&amp;quot;Choose a graph&amp;quot; delegate:self cancelButtonTitle:@&amp;quot;Cancel&amp;quot; destructiveButtonTitle:nil otherButtonTitles:@&amp;quot;Enrolment over time&amp;quot;, @&amp;quot;Enrolment by subject&amp;quot;, nil] autorelease];
&lt;/pre&gt;
&lt;p&gt;Now find the &amp;#8216;actionSheet:clickedButtonAtIndex:&amp;#8217; method and modify it to work with buttonIndex == 1:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
if (buttonIndex == 0)
{
    STLineGraphViewController *graphVC = [[STLineGraphViewController alloc] init];
    [graphVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [graphVC setModalPresentationStyle:UIModalPresentationFullScreen];
    [graphVC setDelegate:self];
    [graphVC setManagedObjectContext:[self managedObjectContext]];

    [self presentModalViewController:graphVC animated:YES];

    [graphVC release];

}
else if (buttonIndex == 1)
{
    STBarGraphViewController *graphVC = [[STBarGraphViewController alloc] init];
    [graphVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [graphVC setModalPresentationStyle:UIModalPresentationFullScreen];
    [graphVC setDelegate:self];
    [graphVC setManagedObjectContext:[self managedObjectContext]];

    [self presentModalViewController:graphVC animated:YES];

    [graphVC release];
}
&lt;/pre&gt;
&lt;p&gt;Again, this will show some warnings because we haven&amp;#8217;t implemented the delegate or managedObjectContext properties on STBarGraphViewController yet.&lt;/p&gt;
&lt;p&gt;Now jump into STBarGraphViewController.h. Import CorePlot-CocoaTouch.h and add the following property declaration:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@protocol STBarGraphViewControllerDelegate
@required
- (void)doneButtonWasTapped:(id)sender;

@end
&lt;/pre&gt;
&lt;p&gt;Now add the following properties:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@property (nonatomic, strong) CPTGraph *graph;
@property (nonatomic, assign) id&amp;lt;STBarGraphViewControllerDelegate&amp;gt; delegate;
@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;
&lt;/pre&gt;
&lt;p&gt;Finally, register that this class will follow these protocols:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@interface STBarGraphViewController : UIViewController &amp;lt;CPTBarPlotDelegate, CPTBarPlotDataSource&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Notice that, aside from conforming to different protocols, this class is the same as STLineViewController. Ideally, you would have a base class that would have these properties that you would subclass to reduce code repetition. This tutorial is focusing on core plot only, so we are only focusing on how best to work with the CorePlot framework. If you&amp;#8217;ve got the knowledge and time, feel free to create the base class and use inheritance, but we&amp;#8217;re going to keep it simple in the sample code here.&lt;/p&gt;
&lt;p&gt;Next, jump into the .m file, synthesize the properties, and release them in the dealloc method.&lt;/p&gt;
&lt;p&gt;Now let&amp;#8217;s link the view class as the controller&amp;#8217;s view. Import &amp;#8216;STBarGraphView.h&amp;#8217;, and add the following method:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (void)loadView
{
    [super loadView];

    [self setTitle:@&amp;quot;Enrolment by subject&amp;quot;];
    [self setView:[[[STGraphView alloc] initWithFrame:self.view.frame] autorelease]];

    CPTTheme *defaultTheme = [CPTTheme themeNamed:kCPTPlainWhiteTheme];

    [self setGraph:(CPTGraph *)[defaultTheme newGraph]];
}
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Get the Full Series!&lt;/h2&gt;
&lt;p&gt;This tutorial series is available to &lt;a href="http://tutsplus.com/"&gt;Tuts+ Premium members only&lt;/a&gt;. Read a &lt;a href="http://tutsplus.com/tutorial/working-with-coreplot-creating-a-bar-chart/"&gt;preview of this tutorial&lt;/a&gt; on the Tuts+ Premium web site or &lt;a href="http://tutsplus.com/amember/login.php"&gt;login&lt;/a&gt; to Tuts+ Premium to access the full content. &lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Joining Tuts+ Premium. . .&lt;/h2&gt;
&lt;p&gt;For those unfamiliar, the family of &lt;a href="http://tutsplus.com"&gt;Tuts+&lt;/a&gt; sites runs a premium membership service called Tuts+ Premium. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from &lt;a href="http://mobile.tutsplus.com"&gt;Mobiletuts+&lt;/a&gt;, &lt;a href="http://net.tutsplus.com"&gt;Nettuts+&lt;/a&gt;, &lt;a href="http://ae.tutsplus.com"&gt;Aetuts+&lt;/a&gt;, &lt;a href="http://audio.tutsplus.com"&gt;Audiotuts+&lt;/a&gt;, &lt;a href="http://vector.tutsplus.com"&gt;Vectortuts+&lt;/a&gt;, and &lt;a href="http://cg.tutsplus.com"&gt;CgTuts+&lt;/a&gt;. You&amp;#8217;ll learn from some of the best minds in the business. &lt;a href="http://tutsplus.com/mobile-premium/"&gt;Become a premium member&lt;/a&gt; to access this tutorial, as well as hundreds of other advanced tutorials and screencasts.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uDtfP0AFevtGlNDhKW3_jMtF6PU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uDtfP0AFevtGlNDhKW3_jMtF6PU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uDtfP0AFevtGlNDhKW3_jMtF6PU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uDtfP0AFevtGlNDhKW3_jMtF6PU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Unity3D</title>
		<link>http://mobile.tutsplus.com/tutorials/android/introduction-to-unity3d/</link>
		<comments>http://mobile.tutsplus.com/tutorials/android/introduction-to-unity3d/#comments</comments>
		<pubDate>Thu, 17 May 2012 11:30:48 +0000</pubDate>
		<dc:creator>Ian Zamojc</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10752</guid>
		<description>&lt;p&gt;Unity3D is a powerful cross-platform 3D engine and a user-friendly development environment. Learn how Unity3D can help you create games in this article!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;What is Unity3D?&lt;/h2&gt;
&lt;p&gt;Unity3D is a powerful cross-platform 3D engine and a user friendly development environment. Easy enough for the beginner and powerful enough for the expert; Unity should interest anybody who wants to easily create 3D games and applications for mobile, desktop, the web, and consoles.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Cost&lt;/h2&gt;
&lt;p&gt;Indie developers rejoice, Unity is free!  Well, almost.  There is a Pro edition that comes with more features and tools, but will set you back $1,500. Considering the feature set and how permissive the Unity publishing license is, this price is actually very reasonable. However, the free version will let you get your feet wet, build complete games, and even publish them to the desktop and the web without paying a cent! The only caveat is that games published under the free edition will have a small Unity watermark.&lt;/p&gt;
&lt;p&gt;Anything built in Unity will work exactly the same way in Unity Pro.  This means you can choose to upgrade at any point if you need the additional features, or want to publish to more platforms such as iOS and Android. There’s also a 30 day Pro trial you can sign up for in order to test drive all the extra features!&lt;/p&gt;
&lt;p&gt;A complete feature comparison between Unity and Unity Pro can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://unity3d.com/unity/licenses"&gt;http://unity3d.com/unity/licenses&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;Installation is a painless two step process.  First, download and run the Unity installer.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/install.png" alt="Unity Installer" /&gt;
&lt;/div&gt;
&lt;p&gt;Second, when you start Unity for the first time, it will open a web browser and prompt you to register using your email address. It will let you choose which version you want to run. You can select either the free version or a Pro trial that will fallback to the free version after 30 days.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;The Application&lt;/h2&gt;
&lt;p&gt;The Unity application is a complete 3D environment, suitable for laying out levels, creating menus, doing animation, writing scripts, and organizing projects. The user interface is well organized and the panels can be fully customized by dragging and dropping.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/application.png" alt="Unity Application" /&gt;
&lt;/div&gt;
&lt;p&gt;The Project panel is where all the assets within a project are stored. When assets are imported, they will first appear here.&lt;/p&gt;
&lt;p&gt;The hierarchy panel is where assets are organized in a scene. Assets from the Project panel can be dragged into the Hierarchy panel to add them to the current scene.&lt;/p&gt;
&lt;p&gt;The Inspector panel lets you inspect and adjust all the attributes of a selected asset. Everything from its position and rotation, to whether it’s affected by gravity or able to cast a shadow.&lt;/p&gt;
&lt;p&gt;The Scene panel is a 3D viewport where you can physically arrange assets by moving them around in 3D space. You can navigate the viewport by panning, rotating, and zooming the view. If you’ve used Maya at all, you should find these hotkeys familiar:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/mouse_buttons2.png" alt="Mouse Button Shortcuts" /&gt;
&lt;/div&gt;
&lt;p&gt;When it comes to running your game, it couldn’t be simpler.  Just press the play button. To stop it, press the play button again.  You can even pause your game during play to inspect your scene.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/play_button.png" alt="Play Button" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Unity Projects&lt;/h2&gt;
&lt;p&gt;A Unity project is an ordinary folder containing every resource that belongs to your game. Creating a new project is a straightforward affair.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click File &gt; New Project&lt;/li&gt;
&lt;li&gt;Click the Create New Project tab&lt;/li&gt;
&lt;li&gt;Browse to a suitable folder&lt;/li&gt;
&lt;li&gt;Click Create&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/create_project.png" alt="Create New Project Window" /&gt;
&lt;/div&gt;
&lt;p&gt;The result is a project folder containing subfolders named Assets, Library, and ProjectSettings.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/project_folder.png" alt="Project Folder" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Assets&lt;/h2&gt;
&lt;p&gt;Assets are any resource your game uses. These include 3D models, materials, textures, audio, scripts, and fonts, to name a few.  Other than a few simple objects such as cubes and spheres, Unity can’t actually create most of these assets. Instead, they must be created externally using 3D modeling applications and painting tools and then imported into Unity.&lt;/p&gt;
&lt;p&gt;Thankfully, Unity’s asset importing is robust and intelligent. Traditionally, 3D game engines have usually been finicky things and are very particular about what files you give them, forcing developers to carefully convert all their files. Not Unity. It will accept all popular 3D file formats including Maya, 3D Studio Max, Blender and FilmBox with all the rigging, materials and textures intact. Unity also supports all common image file formats, including PNG, JPEG, TIFF and even layered PSD files directly from Photoshop. When it comes to audio, Unity supports WAV and AIF, ideal for sound effects, and MP3 and OGG for music.&lt;/p&gt;
&lt;p&gt;A complete list of all the formats Unity can import can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://unity3d.com/unity/editor/importing"&gt;http://unity3d.com/unity/editor/importing&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let’s import an asset so we have something to work with:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download &lt;a href="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/boxboy.zip"&gt;boxboy.zip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Unzip it to your desktop&lt;/li&gt;
&lt;li&gt;Drag the boxboy folder (containing boxboy.fbx and texture.png) from your desktop into the Project panel&lt;/li&gt;
&lt;li&gt;Drag the boxboy asset from the Project panel into the Hierarchy panel&lt;/li&gt;
&lt;li&gt;Select boxboy in the Hierarchy panel&lt;/li&gt;
&lt;li&gt;Press F to focus the Scene panel on the boxboy&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note: Unity has an Asset Store where you can purchase 3D models, characters, textures, sound effects, music, tools, and even scripts.  The Unity Asset Store has quickly become an invaluable resource for game developers and a money making venture for artists and tool developers.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Scenes&lt;/h2&gt;
&lt;p&gt;Scenes are where you can drag in project assets and arrange them to make levels and game screens.  The Hierarchy panel represents the contents of the current scene in a tree-like format.  While the Scene panel is ideal for arranging your scene’s assets in 3D space, the Hierarchy is where you’ll spend most of your time actually organizing your scenes and keeping them tidy.&lt;/p&gt;
&lt;p&gt;When you start a new project, Unity automatically creates a new scene for you. Scenes start out with nothing but a camera.  If you were to run the game now, you won’t see anything but the background color. To give us something to look at:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Drag the boxboy asset we imported from the Project panel into the Hierarchy panel
&lt;div class="tutorial_image"&gt;
            &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/project_to_hierarchy.png" alt="Dragging Asset to Hierarchy" /&gt;
        &lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Select the boxboy asset in the Hierarchy panel&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Inspector, find the Transform component and adjust the position so that X, Y, and Z are all set to 0.  This will ensure your asset is at the exact center of the 3D world.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
            &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/transform_properties.png" alt="Transform Properties" /&gt;
        &lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The default camera position isn’t very good, so let’s give it a better angle.  Select the camera, then reposition it using the move and rotate tools.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
            &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/camera_gimbal.png" alt="Camera Being Moved" /&gt;
        &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Scenes are assets and should be saved in your project just like other assets. To save your scene:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click File &gt; Save Scene&lt;/li&gt;
&lt;li&gt;Navigate to your project’s Assets folder&lt;/li&gt;
&lt;li&gt;Name your scene Main&lt;/li&gt;
&lt;li&gt;Click Save&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/project_with_main.png" alt="Project With Main Scene" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Scripting&lt;/h2&gt;
&lt;p&gt;Scripts, known in Unity as behaviours, let you take assets in your scene and make them interactive.  Multiple scripts can be attached to a single object, allowing for easy code reuse. Unity supports three different programming languages; UnityScript, C#, and Boo.  UnityScript is similar to JavaScript and ActionScript, C# is similar to Java, and Boo is similar to Python.  Depending on your background you may feel more comfortable with one or the other.&lt;/p&gt;
&lt;p&gt;Let’s create a C# script: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click Assets &gt; Create &gt; New C# Script&lt;/li&gt;
&lt;li&gt;Rename the new script in the Project panel to PlayerScript&lt;/li&gt;
&lt;li&gt;Double click the script to open it in MonoDevelop&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The script should look just like this:&lt;/p&gt;
&lt;pre class="brush: jscript; title: ;"&gt;
using UnityEngine;
using System.Collections;

public class PlayerScript : MonoBehaviour {
        // Use this for initialization
        void Start () {
        }

        // Update is called once per frame
        void Update () {
        }
}
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; C# class names must be the same as their file name and are case sensitive. Make sure your class name matches the file name exactly, excluding the file extension.&lt;/p&gt;
&lt;p&gt;All scripts have a &lt;code&gt;start()&lt;/code&gt; method and an &lt;code&gt;update()&lt;/code&gt; method.  The &lt;code&gt;start()&lt;/code&gt; method is run once when the object is first created, while the &lt;code&gt;update()&lt;/code&gt; method run once per frame. Our script needs to be constantly checking for arrow keys being pressed, so we’ll add the following code to the &lt;code&gt;update()&lt;/code&gt; method.&lt;/p&gt;
&lt;pre class="brush: jscript; title: ;"&gt;
void Update () {
    float horizontal = Input.GetAxis(&amp;quot;Horizontal&amp;quot;);
    float vertical = Input.GetAxis(&amp;quot;Vertical&amp;quot;);
    transform.Translate(horizontal, vertical, 0);
}
&lt;/pre&gt;
&lt;p&gt;Now that our script is done, we need to assign it to our asset. Naturally, Unity makes this a simple affair:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Drag the script onto the boxboy asset in your scene&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;With the script assigned to our boxboy asset, we can run the game and move BoxBoy around by pressing the arrow keys.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Publishing&lt;/h2&gt;
&lt;p&gt;Unity is able to publish to Windows, OS X, and the web via the Unity Web Player.  The Web Player is a browser plugin that works in all major browsers and offers the same performance available on the desktop.&lt;br /&gt;
You can download the Unity Web Player here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://unity3d.com/webplayer/"&gt;http://unity3d.com/webplayer/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Not surprisingly, Unity Pro can publish to even more platforms, including iOS, Android, Wii, Xbox 360, Playstation 3 and even a Flash version of the Web Player.&lt;/p&gt;
&lt;p&gt;To publish our game for the Web Player:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click File &gt; Build &amp;#038; Run&lt;/li&gt;
&lt;li&gt;Select Web Player from the list&lt;/li&gt;
&lt;li&gt;Click Build And Run&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/webplayer.png" alt="Unity Web Player" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/introduction_to_unity.zip"&gt;Click here&lt;/a&gt; to download the complete Unity project.&lt;/p&gt;
&lt;p&gt;This article barely scratches the surface of what is possible with Unity. If this introduction has whet your appetite for more 3D game development, be sure to check out the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://answers.unity3d.com/index.html"&gt;Unity Answers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://unity3d.com/support/documentation/ScriptReference/"&gt;Unity Scripting Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Cx8vLaO4XTn_y691HDRBpsplweY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cx8vLaO4XTn_y691HDRBpsplweY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Cx8vLaO4XTn_y691HDRBpsplweY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cx8vLaO4XTn_y691HDRBpsplweY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/android/introduction-to-unity3d/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.513 seconds -->

