Friday, November 22, 2013

The Skinny on Lean UX

By Brian
Car Assembly LineWaterfall. Agile. User Experience. Lean. In a field of buzzwords, the one you’ve probably heard most lately is Lean UX. But Lean UX is more than just the latest fad. An emerging methodology for designing digital products, Lean UX shortens the feedback loop between design and development by removing anything that’s unnecessary to provide value for the customer.
While it’s gaining traction now, Lean isn’t a new concept. Toyota first introduced it as the Toyota Production System (TPS) back in the 1990s as a process improvement. Since then, the Lean concept has been applied to Six Sigma in manufacturing; IT products and services; and business startup culture (with the publication of Eric Ries’s bestselling The Lean Startup). When applied to UX, Lean focuses on quickly delivering the experience of the design, putting less emphasis on process-oriented deliverables (which are often the source of unnecessary waste). Instead, Lean UX shifts the focus of the design and development process toward 3 key principles: expanded ownership, externalized communications, and emphasizing outcomes.

Expanded Ownership

In both Waterfall and Agile methods, a product manager is assigned as the owner of the product or feature. This person is the “single wringable neck” (thus often labeled a “chicken”), solely responsible for the success or failure of a project. Lean UX, on the other hand, expands the ownership of success and failure to all members of the team.
In the Lean setup, product managers are still responsible, but only for determining what will ultimately serve the business. Beyond the product manager, developers are now responsible for understanding and communicating what’s technically possible. They are expected to provide a feasibility check on the design process, giving feedback and input at every step. Designers, in turn, are responsible for understanding the customers’ motivations and behaviors – and designing solutions that appropriately map to those aspects. Each team member now owns the facet of the project that matches her role. Teams that share accountability and ownership in this way tend to invent better solutions faster, with less friction.

Externalized Communication

Another component of Lean UX involves broadening the culture of communication within an organization. Rather than a design team generating ideas and making decisions in a vacuum, or developers building functionality in a silo apart from the design team, Lean makes the team’s work external and public, by putting it on a wall for everyone to see. Whether physical or virtual, the “wall” creates a transparency that allows more frequent and organic feedback.
This simple activity tends to trigger a cultural shift. While most product teams aren’t exactly black boxes, it’s rare for a team to make all the product details available, not just internally, but to the whole organization at all times. This, however, is exactly what Lean UX advocates. Setting up the “wall” isn’t hard – Jeff Gothelf, author of Lean UX, recommends setting aside an actual wall in your office for posting the team’s progress, but it’s just as easy to use a software tool like Pivotal Tracker for remote teams. Whatever you choose, this communication will allow everyone to stay on the same page, at any time.

Emphasizing Outcomes

The last key tenet of Lean UX is its focus on outcomes rather than deliverables. Historically, in a typical project, designers are asked to create and deliver mockups (usually Photoshop files), and developers are asked to deliver code. In a Lean UX project, however, the emphasis is on outcomes – the answers to the question, “What are the tangible results of the work we did?” Each cycle is tested to determine what is and is not working, so that the final design and functionality are guaranteed to work well for users. The overall result is a better, more focused product that people can easily use.
Lean UX is gaining traction because it embraces the reality that designing useful, usable products is partly a numbers game. There is a need for developers and designers to try many different solutions and evaluate them with users, to see what works and what doesn’t – committing to “our best guess” without testing alternatives is simply not as effective. The more design iterations you can do (and test!), the faster you can figure out what truly works. Lean also acknowledges that no one person (or role) has all the design answers – all ideas are hypotheses that need to be respected, but also validated as quickly as possible. These core premises, and the methodology emerging to support them, hold great promise not just for the creation of successful products, but also for a vast improvement of the collaborative culture within creative teams.

via Above the Fold http://blog.abovethefolddesign.com/2013/11/21/the-skinny-on-lean-ux/

Karen McGrane on Content: Responsive Design Won’t Fix Your Content Problem

I spoke to a digital team at a large corporation a while back, and outlined some of the many challenges they were likely to face in creating, revising, and publishing their content so it would work well on smartphone, tablet, and desktop interfaces.

These included:


  • Evaluating whether content is useful, valuable, actually worthy of being on mobile (or the desktop, for that matter)

  • Assessing the amount of content that can appear on a “page” on different devices, and striking a balance for different form factors

  • Creating multiple forms of headlines, teasers, or body text, so valuable information doesn’t get truncated randomly

  • Planning to develop alternate versions of some assets—such as different image sizes and crops, alternatives to large infographics or tables, new demo videos showing both desktop and mobile versions of the interface

  • Separating content from presentation in the CMS, so content and markup aren’t all dumped into the same blob of a field

An attendee raised her hand and said “I’ve been wondering when you would mention responsive web design. We’re going to use responsive design.” I responded “Well, responsive design won’t fix your content problem.”

Who thinks that, anyway?


I recently posted a link to an article that called responsive design a “poor man’s content strategy.” Then my Twitter feed exploded with people heavily sighing and rolling their eyes, insisting no one would ever conflate the two. Why, everyone knows that the container and what you put in the container aren’t the same thing. Everyone knows that just rearranging modules from the desktop to make them squishy is not a content strategy for mobile. Everyone knows if organizations discover problems that go beyond the specific layout solutions offered by responsive design, that’s not the fault of the technique.

Except not everyone knows that. These are just a few of the anecdotes I’ve heard recently from people working on mobile websites for major corporations—projects with large budgets, committed teams, and executive buy-in:


  • We recently finished a massive CMS replatforming which necessitated a redesign of the desktop website. There is zero enthusiasm for going back through the content structuring, editing, and approval process with our business stakeholders and our legal review team. Whatever we wind up doing on mobile, we must use the exact same content we have on our brand-new desktop site.

  • We just spent [insert unfathomably large number here] trying to take our existing desktop website and make it responsive. We genuinely believed this process would be faster and easier if we based it on what we already have. It’s not going well, and we’ll probably need to throw it all out and start over. We would have been better off if we’d started from scratch six months ago.

  • I was hired as a developer to build a new responsive website, but I’m being asked to make all kinds of decisions about how to edit and restructure the content—decisions I don’t feel entirely qualified to make. I keep telling my client they need to bring someone in to deal with the content questions, but they think responsive design is just a front-end design and development problem.

  • Our executives assume that since they made the decision to go responsive, every other decision would just be tactical details. In fact, implementing responsive web design raises issues that strike right at the heart of our business and the way we work. We need to fix our review and approval processes, our content management system, our asset management system, our design standards and governance. We need to clean up our outdated, useless content. But it’s hard to get people to step up to solve these bigger problems, because they don’t think they’re part of “responsive design.”

Seems like a lot of people are laboring under the mistaken impression that using responsive design means they can make a mobile website without dealing with their content problem.

Where’d they get that dumb idea?


We told them so. And, okay, yes, they’re using some magical thinking. But straight up, we told them that the mobile website should be the same as the desktop, and that’s why they should use responsive web design. We sold them on the value of responsive design by promising that they could manage and maintain one set of content and it would work across all devices.

We also insisted there’s no good reason to serve different content by platform. We got twitchy whenever anyone started talking about sending different content or less content to mobile devices (rightly so). We pointed out that you can’t discern user context or intent just from knowing screen size or device type. We told them content parity was the first and most important goal when developing a responsive website.

Is it any wonder they assume (hope?) they can just take what they already have, wave a responsive magic wand over it, and have their existing content automagically work on mobile? Why should it be different? We said it shouldn’t be.

Even companies that want to take a “mobile first” approach can’t just throw off the shackles of their desktop content. For some, suggesting the organization “start fresh” with new content would be organizational suicide, touching the political third rail of stakeholders and competing interests. Others acknowledge it’s time for a new approach, but need processes that will enable them to clean up and restructure existing content to make it appropriate for a responsive design. Responsive design won’t fix their content problem—but content strategy will.

Responsive design + content strategy = BFF 4 EVAH


It’s time we acknowledged that every responsive web design project is also a content strategy project. For designers and developers who might not know what to emphasize, here are a few talking points:

Your content must be revised


Even though the long-term goal is to serve the same content to every platform, organizations can’t just use what they already have. Smart companies will seize this opportunity to do what they should have done years ago: clean up and pare down their desktop content. You’ll never get a better chance to fix your content and publishing processes.

You may need to deal with legacy systems


The tantalizing prospect of responsive web design is being able to solve the problem of “mobile” completely on the front end. The front end is so much more malleable than the back end, so of course we want to start there. But many responsive projects require changes to the way content and data are structured and published from the CMS or other legacy systems. For some, an approach to APIs will be needed; for many others, it will be an overhaul of content management and asset management systems.

Design your editorial workflow first


The chicken-and-egg problem of content informing design (and vice versa) just got bigger—call it an ostrich-and-egg problem. While smart people have talked about the responsive design workflow and how design deliverables and processes must change, the editorial workflow also needs attention. Planning for how and when the content team will migrate, edit, and restructure content will help everyone ensure that the content and the design work together. Design deliverables like wireframes and comps are evolving—content teams must also evolve away from reliance on Excel spreadsheets and Word documents to manage this process.

You won’t have time to edit everything


Even the most dedicated and ambitious teams won’t have the capacity to revise and restructure every page of their existing desktop website. Making informed and realistic decisions about what to focus on (and what to punt on) will help with overall planning, migration processes, and design decisions. Acknowledging this early will help get teams and stakeholders on board with the fact that not everything will be perfect.

Plan for long-term governance


Responsive design also won’t fix your design standards and governance model, but we still need to include long-term maintenance in our objectives. I heard a story from one group who said they convinced their company that it wasn’t possible to do responsive design properly unless they also created and enforced a design system. The same argument could be made for developing and encouraging adherence to content standards.

Responsive design itself won’t fix your content—no one ever said it would. But the opportunity to implement a responsive redesign is also the opportunity to fix your content and its underlying strategy. It may seem more complicated to edit your content and fix your processes and systems at the same time you’re designing a new site—but in fact, pretending you don’t have to solve these problems just makes the job harder. Smart organizations will see this as a benefit, not a drawback, and will use this chance to make a better website, not just a squishy one.





via A List Apart: The Full Feed http://alistapart.com/column/responsive-design-wont-fix-your-content-problem

Thanksgiving Day and Black Friday weekend trends to watch

Be the first to comment | This entry was posted in HolidaysMarketingMerchandising,Research
2013Holiday_Blog_ShoporgRetailers and consumers are geared up for the first of several big holiday shopping weeks. According the latest research conducted by Prosper Insights and Analytics for NRF, 140 million U.S. consumers plan shop over Thanksgiving and Black Friday weekend. For retailers, there are a few trends going into this key period:
The word will go out early. Over half of retailers surveyed plan to get the word out about holiday weekend specials at least five or six days in advance – if not earlier – via email and search.
Thanksgiving Day shopping is poised to grow. Nearly one-quarter of U.S. consumers (33 million) plan to shop on Thanksgiving Day this year. Retailers are ready: 53 percent of retailers Shop.org surveyed are planning special online promotions specifically for Thanksgiving Day.
Looking back to last year, nearly three out of 10 holiday shoppers were at stores by midnight on Thanksgiving, up from 24 percent in 2011 and just 10 percent in 2010. Additionally, millennials were out in force – more than one-third shopped on Thanksgiving Day in 2012.
Online shopping saw a similar surge. In 2012, comScore found that Thanksgiving Day sales topped $633 million, a 32 percent increase from 2011. Across its retail clients, Akamai saw an early peak in page views from North American online consumers at 10:40 a.m. Eastern time on Thanksgiving Day, with later peaks hitting at approximately 6 p.m. and 9 p.m. that evening as well. It’s becoming a new-found tradition for millions of Americans, no matter the channel.
Retailers are ready for Black Friday in-store… According to the same NRF survey, approximately 97 million U.S. shoppers plan to shop on Black Friday this year. Knowing that many consumers shop across touch points, retailers are tapping the full range of online vehicles to promote their in-store specials and events for that day. Two-thirds of retailers plan to use email to get the word out, over half will use Facebook, and 45 percent will use home page messaging and search marketing, according to Shop.org research. Twitter, mobile alerts, blogs, Pinterest, Instagram and other tactics round out the picture.
… and will continue promotions to buy online throughout the weekend. Holiday shoppers also will find reasons to shop online over Black Friday weekend. For example, 44 percent of retailers surveyed will offer specific deals and promotions while the same number will use a special email campaign and 41 percent will offer a one-day sale. And for online shoppers looking for a break on shipping costs, 27 percent will offer free shipping at a lower-than-usual minimum purchase level, while 20 percent will offer free shipping on all purchases.
The complete Black Friday weekend shopping picture. Trends for Black Friday weekend are similar to the increases in online and in-store shopping seen on Thanksgiving Day. Customized charts in the Retail Insight Center show average spending over the weekend has grown steadily over time — from $360 in 2006 to $423 in 2012. Looking at online-only, the portion of spending over these days has grown significantly from an average of just 23 percent in 2006 to 40 percent in 2012. This means we’re getting very close to a world where Black Friday weekend spending will be half online, half in-store.

via Shop.org Blog http://blog.shop.org/2013/11/22/thanksgiving-day-and-black-friday-weekend-trends-to-watch/

Four Ways To Build A Mobile Application, Part 1: Native iOS

By 

Advertisement
The mobile application development landscape is filled with many ways to build a mobile app. Among the most popular are:
  • native iOS,
  • native Android,
  • PhoneGap,
  • Appcelerator Titanium.
This article marks the start of a series of four articles covering the technologies above. The series will provide an overview of how to build a simple mobile application using each of these four approaches. Because few developers have had the opportunity to develop for mobile using a variety of tools, this series is intended to broaden your scope.
Hopefully, armed with this knowledge, you will be in a better position to choose the right development tools for your mobile application’s needs. In this first article in the series, we’ll start with some background and then dig into iOS.
I’ve built the same simple application with each technology to demonstrate the basic concepts of development and the differences between the platforms and development tools. The purpose of this series is not to convert you to a particular technology, but rather to provide some insight into how applications are created with these various tools, highlighting some of the common terms and concepts in each environment.
FasTip is a simple application to calculate tips. Because this is a simple example, it uses the standard UI controls of each platform:
fastip-app-screens-500
The screenshots above show the application running as native iOS,PhoneGap and native Android applications. Appcelerator Titanium uses native controls, so it looks the same as the native iOS and Android applications. Our application has two screens: a main screen where the tips are calculated, and a settings screen that enables the user to set a tip percentage. To keep things simple and straightforward, we’ll use the default styles of each environment.
The source code for each app is available on GitHub.

Native iOS Development

Most applications in Apple’s App Store are written in the Objective-C programming language, and developers typically use Xcode to develop their applications.
xcode-screen-500

OBTAINING THE TOOLS

To build an iOS app, you must use Mac OS X; other operating systems are not supported. The development tools that you’ll need, iOS 7 SDK and Xcode 5, are free of charge, and you can run the app that you build in the iOS simulator, which is part of the iOS SDK. To run your app on a real device and make it available in Apple’s App Store, you must pay $99 per year.

CREATING A NEW PROJECT

Once you have installed Xcode, you’ll want to create a new project. Choose “Create a new Xcode project” from the welcome screen or viaFile → New Project in the menu.
xcode-new-project-500
For a simple application such as this one, “Single View” is appropriate. Upon clicking “Next,” you will be presented with a dialog to enter some basic information about your application:
new-project-options-500
The value that you enter in the “Class Prefix” option tells Xcode to attach that unique prefix to every class that you generate with Xcode. Because Objective-C does not support “namespacing,” as found in Java, attaching a unique prefix to your classes will avoid naming conflicts. The “Devices” setting lets you restrict your application to run only on an iPhone or an iPad; the “universal” option will enable the application to run on both.

NAVIGATION CONTROLLERS AND VIEW CONTROLLERS

The screen functionality of iOS applications is grouped into what are known as view controllers. Our application will have two view controllers: one for the main screen and one for the settings screen. A view controller contains the logic needed to interact with the controls on a screen. It also interacts with another component called the navigation controller, which in turn provides the mechanism for moving between view controllers. A navigation controller provides the navigation bar, which appears at the top of each screen. The view controllers are pushed onto a stack of views that are managed by the navigation controller as the user moves from screen to screen.

STORYBOARDS: BUILDING THE USER EXPERIENCE VISUALLY

Starting with iOS 5, Xcode has had storyboards, which enable developers to quickly lay out a series of view controllers and define the content for each. Here’s our sample application in a storyboard:
storyboard-overview-500
The container on the left represents the navigation controller, which enables the user to move from screen to screen. The two objects on the right represent the two screens, or view controllers, that make up our app. The arrow leading from the main screen to the settings screen is referred to as a segue, and it indicates the transition from screen to screen. A new segue is created by selecting the button in the originating view and then, while the Control key is pressed, dragging the mouse to the destination view controller. Apple’s documentation provides more detail about this process.
storyboard-properties-500
In the example above, we can see that a text field has been selected, and the property panel is used to adjust the various attributes of the controls. When this application was created, the “universal” app option was selected, enabling the app to run on both an iPhone and iPad. As a result, two versions of the storyboard file have been created. When the app is running on an iPhone or iPod Touch, the _iPhone version of the file will be used, and the _iPad version will be used for iPads. This allows a different layout to be used for the iPad’s larger display. The view controller will automatically load the appropriate layout. Keep in mind that if your storyboards expose different sets of controls for the iPad and the iPhone, then you must account for this in the code for your view controller.
In addition to directly positioning items at particular coordinates on the screen, you can also use the Auto Layout system that was introduced in iOS 6. This enables you to define constraints in the relationships between controls in the view. The storyboard editor enables you to create and edit these constraints.
storyboard-constraints-500
The constraints can also be manipulated programmatically. The Auto Layout mechanism is quite sophisticated and a bit daunting to use at first. Apple has an extensive guide on Auto Layout in its documentation.

Associating Storyboards With Your Code

To access the storyboard objects from the code, you must define the relationships between them. Connecting items from the storyboard to your code via Xcode is not obvious if you’re used to other development environments. Before you can do this, you must first create a view controller to hold these associations. This can be done with the following steps:
  1. Choose File → New File.
  2. In the dialog that appears, choose “Objective-C class”:
  3. In the next dialog, give your class a name and ensure that it inherits from UIViewController:
    file-new-options-500
  4. Upon clicking “Next,” you’ll be asked to confirm where in the project the file should be saved. For a simple project, picking the main directory of the app is fine.
  5. Upon clicking “Next,” you’ll see that a new set of files has been created for your view controller. Now, associate that newly created view controller with the view controller in your storyboard.
  6. With the storyboard open, click on the view controller. In the “Identity Inspector” panel, pick the “Class” that this view controller is to be associated with:
    class-picker
  7. Once this process is completed, the code for your view controller will be properly referenced by the storyboard entry.
To reference the controls that you’ve dragged onto a storyboard from your Objective-C code, you’ll need to define these relationships. The storyboard editor has an “assistant editor” view to help with this. Basically, it’s a split-pane view that shows both the storyboard and your code. In this example, we’ll reference a button that’s already been placed on the storyboard:
  1. First, ensure that you’ve completed the steps above to associate the view controller class with the corresponding view controller in the storyboard.
  2. Choose the assistant editor by clicking the icon that looks like this:
    assistant-editor-icon
  3. A split-pane view will open, with the storyboard on the left and your view controller class on the right.
  4. Select the button in your storyboard and, while holding down theControl key, drag from the button to the interface area of your code.
    create-outlet-500
  5. The resulting dialog will enable you to create an “outlet” for the button in your code. Simply give the button a name, and click the “Connect” button in the dialog. You may now reference the button in the view controller from your code.
  6. Let’s hook up a method to be invoked when a person taps on the button. Select the button again, and use the same Control-and-drag maneuver to drop a reference into the interface section of your view controller.
  7. This time, in the dialog box that appears, we’ll associate an “action,” rather than an outlet. Choose “Action” from the “Connection” drop-down menu, and enter a name like this:
    create-action-500
    For the “Event,” use the default of “Touch Up Inside,” and press the “Connect” button.
  8. Note that your class now has an interface with two entries in it:
@interface FTSettingsViewController ()
@property (weak, nonatomic) IBOutlet UIButton *myButton;
- (IBAction)tappedMyButton:(id)sender;
@end
The IBOutlet item is used to identify anything that you’re referencing from the storyboard, and the IBAction is used to identify actions that come from the storyboard. Notice also that Xcode has an empty method where you can place the code to be run when the user taps on the control:
- (IBAction)tappedMyButton:(id)sender {
}
The process above does take some getting used to and could certainly be made more intuitive. After some practice, it will get less awkward. You might find it useful to bookmark the section of the Xcode documentation that describes how to “Connect User Interface Objects to Your Code.”
As we’ll see later, you can also add objects to the view and manipulate their properties programmatically. In fact, applications of even moderate complexity typically perform a lot of manipulation in code. For complex apps, some developers eschew the storyboard and use the code-based alternative almost entirely.

GETTING INTO THE CODE

For even the most basic of applications to function, some code must be written. So far in the storyboard, we’ve laid out our user interface and the interactions between the view controllers. But no code has been written to perform the calculations, to persist the settings of the tip percentage and so on. That is all done by you, the developer, in Objective-C.
When an application is running, its overall lifecycle is handled by something called an “application delegate.” Various methods in this delegate are called when key events in the application’s lifecycle occur. These events could be any of the following:
  • the application is started,
  • the application is moved to the background,
  • the application is brought to the foreground,
  • the application is about to be terminated,
  • a push notification arrives.
The events above are handled in a file called AppDelegate. For our sample application, the default handling of these events is just fine; we don’t need to take any special action. The documentation has an overview of the application’s lifecycle and of responding to changes in an app’s state.
The next area of attention is the view controller. Just as with the application delegate, the view controller has its own lifecycle. The view controller’s lifecycle includes methods that are invoked when the following happens:
  • the view controller has been loaded;
  • the view controller is about to appear or has appeared on the screen;
  • the view controller is about to disappear or has disappeared from the screen;
  • the bounds of the view have changed (for example, because the device has been rotated) and the view will be laid out again.
The main code for our application is in the FTViewController.m file. Here isthe first bit of code that initializes our screen:
- (void)viewWillAppear:(BOOL)animated
{
    // Restore any default tip percentage if available
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    float tipPercentage = [defaults floatForKey:@"tipPercentage"];
    if (tipPercentage > 0) {
        _tipPercentage = tipPercentage;
    } else {
        _tipPercentage = 15.0;
    }
    self.tipAmountLabel.text = [NSString stringWithFormat:@"%0.2f%%", _tipPercentage];
}
In this application, we want to use whatever tip percentage value was stored in the past. To do this, we can use NSUserDefaults, which is a persistent data store to hold settings and preferences for an application. Keep in mind that these values are not encrypted in any way, so this is not the best place to store sensitive data, such as passwords. A KeyChain API is provided in the iOS SDK to store such data. In the code above, we’re attempting to retrieve the tipPercentage setting. If that’s not found, we’ll just default to 15%.
When the user taps the “Calculate Tip” button, the following code is run:
- (IBAction)didTapCalculate:(id)sender {
    float checkAmount, tipAmount, totalAmount;

    if (self.checkAmountTextField.text.length > 0) {

        checkAmount = [self.checkAmountTextField.text floatValue];
        tipAmount = checkAmount * (_tipPercentage / 100);
        totalAmount = checkAmount + tipAmount;

        self.tipAmountLabel.text = [NSString stringWithFormat:@"$%0.2f", tipAmount];
        self.totalAmountLabel.text = [NSString stringWithFormat:@"$%0.2f", totalAmount];

    }

    [self.checkAmountTextField resignFirstResponder];

}
We’re simply reading the value that the user has inputted in the “Amount” field and then calculating the tip’s value. Note how the stringWithFormatmethod is used to display the tipAmount value as a currency value.
When the user taps the “Settings” button in the navigation controller, the segue that we established in the storyboard will push the settings’ view controller onto the stack. A separate view controller file,FTSettingsViewController, will now handle the interactions on this screen. Pressing the “Done” button on this screen will run the following code:
- (IBAction)didTapDone:(id)sender {

    float tipPercentage;
    tipPercentage = [self.tipPercentageTextField.text floatValue];

    if (tipPercentage > 0) {

        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        [defaults setFloat:tipPercentage forKey:@"tipPercentage"];
        [defaults synchronize];

        [[self navigationController] popViewControllerAnimated:YES];

    } else {

        [[[UIAlertView alloc] initWithTitle:@"Invalid input"
                                    message:@"Percentage must be a decimal value"
                                   delegate:nil
                          cancelButtonTitle:@"ok"
                          otherButtonTitles:nil] show];

    }

}
Here we’re retrieving the value from the text field and making sure that the inputted value is greater than 0. If it is, then we use NSUserDefaults to persist the setting. Calling the synchronize method is what will actually save the values to storage. After we’ve saved the value, we use thepopViewControllerAnimated method on the navigation controller to remove the settings view and return to the prior screen. Note that if the user does not fill in the percentage correctly, then they will be shown the standard iOS UIAlertView dialog and will remain on the settings screen.
In the section above on view controllers and storyboards, I mentioned that the controls in a view can be manipulated programmatically. While that was not necessary for our application, the following is a snippet of code that creates a button and adds it to a particular location on the screen:
CGRect buttonRect = CGRectMake(100, 75, 150, 80);
UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
myButton.frame = buttonRect;
[myButton setTitle:@"Click me!" forState:UIControlStateNormal];
[self.view addSubview:myButton];
Generally speaking, all of the controls that you place in a view extend from an ancestor class named UIView. As such, buttons, labels, text-input fields and so on are all UIViews. One instance of a UIView is in the view controller. This can be referenced in your view controller’s code asself.viewThe iOS SDK positions items in a view based on a frame, also referred to as CGRect, which is a structure that contains the x and y coordinates of the item, as well as the width and height of the object. Note in the code above that the button is instantiated and assigned a frame (location and size) and then added to the view controller’s view.

RUNNING AND DEBUGGING AN IOS APPLICATION

When Xcode and the iOS SDK are installed, so is the iOS simulator, which simulates an iOS device directly on your machine. Xcode has a drop-down menu that allows you to select different device configurations. Pressing the “Run” button in the upper-left corner will build the app and then run it in the chosen simulator.
device-chooser-500
Using the menu above, you can switch between iPhones and iPads of different sizes, as well as between Retina and non-Retina versions of each device.
Debugging is done simply by clicking in the left margin of the code editor, where the line numbers appear. When the execution of your app reaches the breakpoint, the app will stop and the variable values in effect at that moment in time will appear below the code editor:
breakpoint-variables-500-opt
Some things, such as push notifications, cannot readily be tested in the simulator. For these things, you will need to test on a device, which requires you to register as an Apple developer for $99 a year. Once you have joined, you can plug in your device with a USB cable. Xcode will prompt you for your credentials and will offer to “provision” the device for you. Once the device is recognized, it will be shown in the same menu that allows you to switch between device simulators.
In Xcode, by going to Window → Organizer in the menu, you can display a tool that enables you to manage all of the devices visible in Xcode and to examine crash logs and more. The Organizer window also lets you take and export screenshots of your application.

Summary

Thus far, we’ve seen the basics of developing a simple native iOS application. Most applications are more complex than this, but these are the basic building blocks:
  • Xcode
    The development environment
  • Storyboards
    For laying out and configuring the user interface
  • View controllers
    Provide the basic logic for interacting with each of the views defined in the storyboards
  • Navigation controllers
    Enable the user to navigate between the different views

LEARNING RESOURCES

To get started with iOS development, you might want to consult these useful resources:
This concludes the first segment of our tour of app development. I hope it has given you some insight into the basic concepts behind native app development on iOS. The next article in this series will cover how to build the same application using native Android development tools.
(al, ea)



via Smashing Magazine Feed http://www.smashingmagazine.com/2013/11/22/4-ways-to-build-a-mobile-application-part-1-native-ios/