Voices That Matter

User Interface

iPhone Developer Tips Stats:
Past 30 days - Pageviews: 88,766 Visitors: 61,679
Thank you everyone! Let's shoot for 100,000 by May. Pass it on...



Validate User Input in UITextField, with Smarts to Properly Manage Copy and Paste

I’ve written a short character validation method that you can use as a starting point for validating characters against a character set. For devices running iPhone OS 3.x and thus support copy/paste, this code will also validate characters pasted into a textfield, and if invalid characters are found in the buffer, the input is [...]

User Interface

UIAlertView without Buttons – Please Wait Dialog

If you’ve ever wanted to show a simple “please wait” dialog without resorting to a custom view, UIAlertView is a good option, and is even more appropriate if you customize the alert such that no buttons are shown.
In the figure below you can see how a simple alert can be shown (sans buttons) while you [...]

User Interface

Rotate an Image or Button with Animation – Part 2

In a previous post Rotate an Image with Animation – Part 1 I wrote a short code block using CGAffineTransform to rotate an image. Problem is, if you want to rotate an image 360 degrees, or repeat a rotation a specified number of times, you’ll need to take a different approach, which is the focus [...]

User Interface

Detect Taps on UITabBarController and Determining Class Type

I’ve been working on an application which uses a UITabBarController as the primary means of navigation. One of the tabs leads one to a UIViewController that displays a UIWebview as the main user interface.
The browser based navigation in the webview is based on a legacy (read WAP) website that has a great deal of content, [...]

User Interface

Fade Transition – Fade Images In and Out

Although the iPhone includes a number of effects designed for transitioning between views, sometimes a simple fading effect of one image to another, within the same view, is all you need.
For example, in a recent application during the application startup, I wanted the splash image to fade away, and another image of the primary user [...]

User Interface

UIAlertView and Landscape Mode

I bumped into a rather odd UI issue early last week – I was working on an application which runs entirely in landscape mode. However, when I displayed an alert view, it came up as follows:

Setting Landscape Mode
In my application, I had the following interface orientation setting inside the info.plist file:

User Interface

Adjust TextField Hidden by Keyboard

Welcome to the first in a series of tips that are based on content from one of O’Reilly’s latest iPhone books, Head First iPhone Development, written by Dan and Tracey Pilone. Each Monday in November I’ll write a tip that is based on ideas and code in the book.
Book Giveaway – Every Friday in November
O’Reilly [...]

User Interface

Sliding Views On and Off Screen – Part 2 – Reader Contributions

One of the more popular posts in the last few months has been Sliding Views On and Off Screen – Part 1 – Creating a Reusable Sliding Message Widget. The post inspired two developers to use the code example as a starting point to come up with a few different approaches to working with sliding [...]

User Interface

Creating Unique Looking Tables with Custom Cells

A reader of this post How to Add “More Content” Indicators asked about how the user interface was constructed for the Bikini.com application, the UI in question is shown below:

Creating a Custom Table
It’s quite simple to pull this together, it’s nothing more than a UITableView that is transparent so the background shows through. Each cell [...]

User Interface

Fix for Troublesome User Interface (UI) Updates

Here’s a quick tip if run into the problem of requesting a UI update (changing label text, starting/stopping spinner) that just don’t seem to take place. This is a simple workaround and isn’t replacement if you need multiple threads given an unresponsive UI due to other time intensive tasks (such as network requests).
As an example, [...]

User Interface

Rotate an Image with Animation – Part 1

Editor’s Note: Part 2 of this post shows how rotate an images, buttons and other UI objects up to 360 degrees as well as rotating objects clockwise or counter-clockwise.
Last week I wrote a tip to demonstrate how to move an image on screen using animation. In this post I’ll show how to rotate an image [...]

User Interface

Move an Image with Animation

I was recently working on an application where I needed to animate an image moving on the screen. It surprisingly easy to do accomplish this effect. Let’s me show you the method that I came up with.
The moveImage method takes five parameters – the image to move, duration of the animation in seconds, the animation [...]

User Interface

Accelerometer 101

What follows is the 30,000 foot introduction to working with the accelerometer on the iPhone.
There is one instance of the UIAccelerometer object that is shared throughout your application. To start receiving input from the accelerometer, set the update interval for the frequency of updates and set the delegate to receive the callbacks. If often [...]

User Interface

Detect Single Tap in UIScrollView

If you’ve ever been using a UIScrollView and had a need to detect a single tap, I hear you. In the Savini Rims and Rides iPhone application, I had a horizontal scrollview of six cars as one element of the user interface. Selecting on a car (tapping once) was to launch a video. Trouble is, [...]

User Interface

How to Add “More Content” Indicators / Arrows

In my original post about the Bikini.com Supermodel Party iPhone app, I mentioned I would follow up with a few posts on how I implemented various features in the app.
I previously wrote about Sliding View On/Off Screen. In this post I will show how I added directional arrows indicating more content in a scrollable area, [...]

User Interface