MOBILE

iPhone Application Development : User Input and Output

1/30/2011 9:46:05 AM
Although application logic is always the most important part of an application, the way the interface works plays a big part in how well it will be received. For Apple and the iPhone, providing a fun, smooth, and beautiful user experience has been key to its success; it’s up to you to bring this experience into your own development. The iPhone SDK’s interface options give you the tools to express your application’s functionality in fun and unique ways.

This hour introduces two very visual interface features: sliders for input and image views for output.

Sliders

The first new interface component that we’ll be using this hour is a slider (UISlider). Sliders are a convenient touch control that is used to visually set a point within a range of values. Huh? What?

Suppose that you want your user to be able to speed something up or slow it down. Asking users to input timing values is unreasonable. Instead, you can present a slider, as seen in Figure 1, where they can touch and drag an indicator back and forth on a line. Behind the scenes, a value property is being set that your application can access and use to set the speed. No need for users to understand the behind-the-scene details or do anything more than drag with their fingers.

Figure 1. Use a slider to collect a value from a range of numbers without requiring users to type.


Sliders, like buttons, can react to events or can be read passively like a text field. If you want the user’s changes to a slider to immediately have an effect on your application, you must have it trigger an action.

Image Views

Image views (UIImageView) do precisely what you’d think: They display images! They can be added to your application views and used to present information to the user. An instance of UIImageView can even be used to create a simple frame-based animation with controls for starting, stopping, and even setting the speed at which the animation is shown.

With iOS 4, your image views can even take advantage of the high-resolution display of the iPhone 4 (and any other upcoming iOS high-resolution devices). Even better, you need no special coding! Instead of checking for a specific device, you can just add multiple images to your project, and the image view will load the right one at the right time.

Other  
  •  Windows Phone 7 : Using Accelerometer Data to Move a Ball
  •  Server-Side Browser Detection and Content Delivery : Mobile Detection (part 4) - Device Libraries
  •  Server-Side Browser Detection and Content Delivery : Mobile Detection (part 3) - Transcoders
  •  Server-Side Browser Detection and Content Delivery : Mobile Detection (part 2) - Detecting the Context
  •  Server-Side Browser Detection and Content Delivery : Mobile Detection (part 1) - HTTP
  •  Using Windows Phone 7 Technologies : Retrieving Accelerometer Data (part 2)
  •  Using Windows Phone 7 Technologies : Retrieving Accelerometer Data (part 1)
  •  Using Windows Phone 7 Technologies : Understanding Orientation and Movement
  •  Programming the Mobile Web : HTML 5 (part 4) - Client Storage
  •  Programming the Mobile Web : HTML 5 (part 3) - Offline Operation
  •  Programming the Mobile Web : HTML 5 (part 2) - The canvas Element
  •  Programming the Mobile Web : HTML 5 (part 1)
  •  Windows Phone 7 : Submitting Your First Windows Phone Application to the Windows Phone Marketplace
  •  Windows Phone 7 : Packaging, Publishing, and Managing Applications
  •  Mobile Application Security : Windows Mobile Security - Development and Security Testing (part 3)
  •  Mobile Application Security : Windows Mobile Security - Development and Security Testing (part 2)
  •  Mobile Application Security : Windows Mobile Security - Development and Security Testing (part 1)
  •  Programming the Mobile Web : Mobile Rich Internet Applications (part 2) - JavaScript Mobile UI Patterns
  •  Programming the Mobile Web : Mobile Rich Internet Applications (part 1) - JavaScript UI Libraries
  •  Windows Mobile Security - Kernel Architecture
  •  
    Top 10
    Arbico Elite 7768 OCX - Great-Value Gaming Rig
    Chillblast Fusion Firebird - Offers The Fastest Framerates
    Crucial Ballistix Tactical LP 16GB Kit
    Dino PC Dark Claw GTX 670 - A Dark Horse
    Advanced Streaming For Your Phone or Tablet (Part 3)
    Advanced Streaming For Your Phone or Tablet (Part 2)
    Advanced Streaming For Your Phone or Tablet (Part 1)
    Samsung Premium Series 9 Review (Part 2)
    Samsung Premium Series 9 Review (Part 1)
    Samsung Galaxy Camera Review – Part2
    Most View
    Windows 8’s Anatomy (Part 5)
    Windows 7: Getting into Your Multimedia (part 2) - Navigating Windows Media Player Menus and Toolbars
    Audio-Technica ANC9 : Noise-cancelling headphones
    Intel vs AMD - The Choice Is Harder Than Ever (Part 4)
    Managing Exchange Server 2010 : The Exchange Management Shell (part 3) - Reporting with the Exchange Management Shell
    Understanding the Architecture of SharePoint 2010 : Capabilities
    Ipad Lion (Part 2) - What to expect from the upcoming mountain lion
    Registering a Windows Phone Device for Debugging
    Advice Centre by Photography Experts (Part 1) - Nikon D300
    Exchange Server 2010 : Deploying a Database Availability Group (part 1) - Creating the File Share Witness
    Processor Group Test (Part 3) - Intel Core i3-2100
    Ouya – Android-Based Video Game Console Project
    SQL Server 2008 : Retrieving and Transforming XML Data
    Plantronics Gamecom 780
    Web Blocking
    SilverStone ST85F-G Evolution
    Plot Thickens As Us Sues Apple To Protect Amazon's Monopod Y In Ebooks
    Windows Vista : Trim the Fat (part 2) - Start Windows in Less Time
    Media Pc Hardware Round-Up (Part 3) - Memory,Video Cards, Sound Cards, PSU And Cooling
    Open Pandora - Open source gaming handled