Lecture 11 Slides (May 6, 2009)
-
Upload
avneesh-minocha -
Category
Documents
-
view
216 -
download
0
Transcript of Lecture 11 Slides (May 6, 2009)
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
1/63
CS193P - Lecture 11
iPhone Application Development
Text InputPresenting Content Modally
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
2/63
Announcements
Presence 3 assignment has been posted, due Tuesday 5/12
Final project proposals due on Monday 5/11
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
3/63
Announcements
This weeks bonus section with Steve Marmon! Discussing interface design for iPhone apps
! Will be available on iTunes U
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
4/63
Todays Topics
Using the Clang Static Analyzer to find bugs
iPhone Keyboards
Customizing Text Input
Presenting Content Modally
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
5/63
Finding Bugs with Clang Static Analyzer
Tool for static analysis of C/Objective-C code
Identifies potential bugs! Leaks
! Using uninitalized or released variables
! Missing dealloc method
! More...
Early in development, watch out for false positives
100% open source!
More info at http://clang.llvm.org/StaticAnalysis.html
http://clang.llvm.org/StaticAnalysis.htmlhttp://clang.llvm.org/StaticAnalysis.html -
8/8/2019 Lecture 11 Slides (May 6, 2009)
6/63
Running the Clang Static Analyzer
Clean build in Xcode first! Ensure that nothing gets left out
From the command line in your project directory:! scan-build -k -V xcodebuild -configuration Debug
-sdk iphonesimulator2.2
! (Customize as needed)
Results open up in Safari when completed!
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
7/63
Demo:
Using the Clang Static Analyzer
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
8/63
iPhone Keyboards
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
9/63
Virtual keyboardAppears when needed
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
10/63
Virtual keyboardAppears when needed
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
11/63
Portrait and Landscape
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
12/63
Simple selection modelText loupe/magnifier
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
13/63
Many keyboard typesAdapted to task
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
14/63
Many keyboard typesAdapted to task
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
15/63
Many keyboard typesAdapted to task
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
16/63
Many keyboard typesAdapted to task
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
17/63
Many keyboard typesAdapted to task
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
18/63
Many keyboard typesAdapted to task
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
19/63
Single line editing
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
20/63
Multi-line editing
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
21/63
Languages
Full dictionary support
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
22/63
English
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
23/63
French
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
24/63
Russian
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
25/63
Korean
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
26/63
Japanese Romaji
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
27/63
Japanese Kana
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
28/63
Chinese Pinyin
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
29/63
Chinese Handwriting
Simplified
Traditional
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
30/63
Customizing Text Input
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
31/63
Text Containers
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
32/63
Text Containers
DelegatesNotifications
Methods
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
33/63
Text Containers
Text Input Traits
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
34/63
Text Input Traits
Protocol
UITextField
UITextView
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
35/63
Text Input Traits
Autocapitalization
Autocorrection
Keyboard Type
Keyboard Appearance
Return Key Type
Return Key Autoenabling
Secure Text Entry
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
36/63
URL Keyboard
Go button
Text Input Traits
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
37/63
Default Keyboard
Google button
Text Input Traits
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
38/63
Text Containers
Text Input TraitsDelegates
Notifications
Methods
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
39/63
Design time
URL Keyboard
Go button
UITextField
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
40/63
Run time
URL Keyboard
Go button
UITextField
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
41/63
Keyboard
Become first responder
URL Keyboard
Go button
UITextField
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
42/63
Keyboard
Become first responder
URL Keyboard
Go button
UITextField
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
43/63
Keyboard
Keyboard adopts traits
URL Keyboard
Go button
UITextField
URL Keyboard
Go button
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
44/63
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
45/63
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
46/63
Presenting Content Modally
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
47/63
For adding or picking data
Presenting Content Modally
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
48/63
Presenting a View Controller
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
49/63
Presenting a View Controller// Recipe list view controller
- (void)showAddRecipe {RecipeAddViewController *viewController = ...;
[self presentModalViewController:viewController animated:YES];
}
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
50/63
Dismissing a View Controller
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
51/63
Dismissing a View Controller// Recipe list view controller
- (void)didAddRecipe {[self dismissModalViewControllerAnimated:YES];
}
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
52/63
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
53/63
Separate Navigation Stacks
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
54/63
Separate Navigation Stacks
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
55/63
Dismissing a Modal View Controller
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
ParentController
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
56/63
Dismissing a Modal View Controller
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
ParentController
ChildController
Present
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
57/63
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
58/63
Dismissing a Modal View Controller
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
ParentController
ChildController
Dismiss
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
59/63
Dismissing a Modal View Controller
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
ParentController
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
60/63
Demo:
Presenting Content Modally
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
61/63
Presence - Part 3
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
62/63
-
8/8/2019 Lecture 11 Slides (May 6, 2009)
63/63
Questions?