Saturday 10 July 2010

More User Interface Fun (iPhone Dev)

Breaking the process of building a complex application into smaller chunks makes it less intimidating. User interface controls come in 3 basic forms: active, static (or inactive) and passive. 

Active Controls involves user participation and something happens (i.e push a button and it fires a method).
Static Control like a text label, user does not interact with it.
Passive Control is something that holds onto a value until a user needs it. Controls don't trigger action methods but the user can interact with them and change their values.

All iPhone controls are subclasses of UI Control. 

Because of multitouch interface, all iPhone controls can trigger multiple actions depending on how they are touched. User may trigger different actions with finger swipe then a touch.

Images to be used need to be added to the resources folder.
If images and label views have no user interactions then no need to declare actions.
Choosing any options that causes images to scale can add processing overhead.
Alpha slider any value <1 causes processing overhead as the image is transparent.
Text fields are one of the most complex controls on iPhone dev.

Keyboard is software based. To make it 'go away' need to add code to the controller class.
First responder is the control that the user is currently interacting with.

Changing UIView to UIControl gives the view the ability to trigger action methods.

Fairly common to bounce around xcode and interface builder.
Action sheets  and alerts are used to provide the user with feedback. They are used to force the user to make a choice between 2 or more items. They are displayed from the bottom of the screen and display a series of buttons for the user to select from. The user cannot continue until they have made a choice.

Alerts also enforce a response from the user before they can continue.

Delegation is a very common design pattern in cocoa touch. 

Action sheets always have a parent, which must be a view that is currently visible to the user.

viewDidUnload() method used for memory management, important to set all controller outlets to nil when the controller has been notified that the view has been unloaded.  

No comments:

Post a Comment

Search This Blog