Professional Documents
Culture Documents
Text Input
Presenting Content Modally
Announcements
• Presence 3 assignment out today, due Wednesday 11/5
• Enrolled students can (still) pick up an iPod Touch after class
• Final project proposals due on Monday 1/1
Today’s Topics
• Notes & Errata
• Drawing Optimizations (continued from Tuesday)
• iPhone Keyboards
• Customizing Text Input
• Presenting Content Modally
Notes & Errata
Using UINavigationController
• Don’t add a child view controller’s view manually
UIViewController *viewController = ...;
[navigationController.view addSubview:viewController.view];
return cell;
}
More on Optimizing Drawing
• “iPhone Application Programming Guide - Drawing Tips”
https://developer.apple.com/iphone/library/documentation/
iPhone/Conceptual/iPhoneOSProgrammingGuide/
GraphicsandDrawing/chapter_6_section_3.html
Performance Recap
• Performance is both an art and a science
! Combine tools & concrete data with intuition & best practices
• Be frugal with memory
• Concurrency is tricky, abstract it if possible
• Drawing is expensive, avoid unnecessary work
iPhone Keyboards
Virtual keyboard
Appears when needed
Virtual keyboard
Appears when needed
Portrait and Landscape
Simple selection model
Text loupe/magnifier
Many keyboard types
Adapted to task
Many keyboard types
Adapted to task
Many keyboard types
Adapted to task
Many keyboard types
Adapted to task
Many keyboard types
Adapted to task
Many keyboard types
Adapted to task
Single line editing
Multi-line editing
20
Languages
URL Keyboard
Go button
Text Input Traits
Default Keyboard
Google button
Text Containers
Text Input Traits
Delegates
Notifications
Methods
Text Containers
UITextField
Design time
UITextField
URL Keyboard
Go button
Design time
UITextField
URL Keyboard
Go button
Run time
UITextField
URL Keyboard
Go button
Present
Parent Child
Controller Controller
Dismissing Modally
• Who should do it?
• Best practice is for the same object to call present and dismiss
• Define delegate methods for the presented controller
! Tell the delegate when the presented controller is done
! The delegate makes the call to dismiss
Parent Child
Controller Controller
I’m done!
Dismissing Modally
• Who should do it?
• Best practice is for the same object to call present and dismiss
• Define delegate methods for the presented controller
! Tell the delegate when the presented controller is done
! The delegate makes the call to dismiss
Dismiss
Parent Child
Controller Controller
Presence - Part 3
Goals for Presence 3
• Avoid expensive work on the main thread
! Use background threads to keep interface responsive
! Abstract thread lifecycle with NSOperation & NSOperationQueue