User Interface

iOS Developer Tips - Visitor Stats:
276,807 Pageviews and 214,652 visitors in the past 30 days.

For advertising information and rates, click here.

iOS 5 : Customize UINavigationBar and UIBarButtonItem with the Appearance API

In a previous post, UIImage and resizableImageWithCapInsets, I explained how to use the method resizableImageWithCapInsets in a UIImage object to set cap insets, which specify areas of an image that are not to be changed when resizing or scaling an image. That post was a segue to this post, which will use images (and cap [...]

User Interface

iOS 5 : UIImage and resizableImageWithCapInsets

I recently began writing a short example to learn more about the iOS 5 Appearance API and customizing UINavigationBar objects. The goal was to add a custom background, title and text to the navbar. Once I had this working, to keep a consist look across my application, I began tweaking the buttons on the navbar [...]

User Interface

iOS 5 : UIStepper Control

There is a new pre-built control in iOS 5 for incrementing or decrementing a value, UIStepper. The control has two buttons aligned horizontally, one labeled with a plus (+) the other a minus (-). One nice feature is a continuous option, wherein if the user presses and holds down either +/- button, the stepper value [...]

User Interface

Simple Menus and Messages with UIActionSheet

If you need to create a quick menu or present a user with a short message, you may want to consider a UIActionSheet as an option. This control will slide up from the bottom of the screen, and offers a number of easily configurable options. The code in the interface definition below creates an actionsheet [...]

User Interface

Load and Access Custom Fonts

It’s surprisingly easy to add custom fonts to your iOS apps. Begin by adding the font(s) to your project, (drag/drag into the resources folder in the Project Window).

User Interface

Using Font Macros for Consistency

In most applications, keeping with one or two fonts is a good design choice. To this end, I often include a few simple macros to keep fonts consistent, easily change font size as well as emphasis (bold). Below are a few macros that give you an idea how I might go about specifying two primary [...]

User Interface

Deselect Table Row with Animation

Here is a quick little trick to automatically deselect a table row once tapped by a user. With the approach below you can also adjust the length of the delay (in seconds) before the deselection occurs. When working with a table, when a row is selected didSelectRowAtIndexPath is called, inside this method after you take [...]

User Interface

Creating Clickable Hyperlinks from a URL, Phone Number or Address

The following tips shows a quick way to create clickable hyperlinks using a UITextView. The trick is to set the dataDetectorTypes property to specify the data type you are after, from there, upon a tap the link will launch the appropriate application, namely Safari, Phone Dialer or Maps.

User Interface

Creating Circular and Infinite UIScrollViews

Editor’s Note: This post was written by Jacob Haskins, Director of Mobile Development at Accella. Thanks to Jon Stroz of Accella for reaching out to me to share this idea. When creating paging functionality for iPhone apps, there may be times that an infinite page loop would be desired. For example, if you have a [...]

User Interface

Screen Capture using UIGetScreenImage

Editor’s Note: I read today (7/22/2010) that Apple is no longer approving applications using UIGetScreenImage. I haven’t been able to find an official Apple announcement on this – however, please give this consideration before using this method in your apps. As talked about on TUAW, among other popular blogs, Apple has opened up the API [...]

User Interface

Showing Activity Indicator (spinner) in Table Cells

Following are two ways to display UIActivityIndicatorViews in a cell of a table view (UITableView). The first will add a spinner as an accessory view, which will display the spinner on the right of the cell. The second approach will add a spinner as a subview in the cell. The primary advantage of using a [...]

User Interface

Adding an Activity Indicator (Spinner) to Navigation Bar

In addition to the standard buttons that you can place on a navigation bar (UINavigationBar), adding an activity indicator (UIActivityIndicator) can be helpful when you need a standard location to indicate some type of action is underway, for example downloading a file, performing a search… You add an activity indicator through a custom view as [...]

User Interface

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 not [...]

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 [...]

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
All Content Copyright © 2008-2012 • iOS Developer Tips, All Rights Reserved.