iOS training (intermediate)
-
Upload
gurpreet-singh-sachdeva -
Category
Education
-
view
192 -
download
4
description
Transcript of iOS training (intermediate)
![Page 1: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/1.jpg)
Yahoo! Confidential 1
iOS Training (Intermediate)
Yahoo! Confidential
Gurpreet SinghSriram Viswanathan
![Page 2: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/2.jpg)
Yahoo! Confidential
Topics
Protocols and Delegates Categories and Selectors Views and View Controllers
Introduction to View Controllers Types of View Controllers
Hands on example for Creating a View Controller Manipulating Views Adding Content to Application
Working with Images Adding Simple Animation
2
![Page 3: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/3.jpg)
Yahoo! Confidential
Protocols and Delegates
Protocol Protocols declare methods that others are expected to implement Similar to interfaces in other languages Protocol does not require .m file. Protocol can have @optional methods
Delegate It allows one object to delegate part of its behavior to be handled by
another object.
3
![Page 4: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/4.jpg)
Yahoo! Confidential
Topics
Protocols and Delegates Categories and Selectors Views and View Controllers
Introduction to View Controllers Types of View Controllers
Hands on example for Creating a View Controller Manipulating Views Adding Content to Application
Working with Images Adding Simple Animation
4
![Page 5: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/5.jpg)
Yahoo! Confidential
Categories and Selectors
Categories: Lets you add methods to class without having access original code Access instance variable but can't add new ones
@implementation NSString (NumericComparison)
- (NSComparisonResult) compareNumerically:(NSString *) compareWithString {
// ADD NUMERIC SORTING LOGIC HERE
}
@end
Selectors: Selector is a way of specifying a method to call
@selector(methodName)
5
![Page 6: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/6.jpg)
Yahoo! Confidential
Topics
Protocols and Delegates Categories and Selectors Views and View Controllers
Introduction to View Controllers Types of View Controllers
Hands on example for Creating a View Controller Manipulating Views Adding Content to Application
Working with Images Adding Simple Animation
6
![Page 7: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/7.jpg)
Yahoo! Confidential
Introduction to View Controllers
Link between application’s data and user interface View controllers are traditional controller objects in the MVC design
pattern Responsible for fetching/initializing models Every view controller that Apple provides extends from the
UIViewController class You Manage Your Content Using Content View Controllers
A content view controller presents content on the screen using a view or a group of views organized into a view hierarchy.
Container View Controllers Manage Other View Controllers A container view controller contains content owned by other view controllers.
7
![Page 8: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/8.jpg)
Yahoo! Confidential
Introduction to View Controllers
8
Every view is controlled by only one view controller. Each view controller interacts with a subset of your app’s data.
For example, the Photo controller needs to know only the photo to be displayed.
![Page 9: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/9.jpg)
Yahoo! Confidential
Topics
Protocols and Delegates Categories and Selectors Views and View Controllers
Introduction to View Controllers Types of View Controllers
Hands on example for Creating a View Controller Manipulating Views Adding Content to Application
Working with Images Adding Simple Animation
9
![Page 10: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/10.jpg)
Yahoo! Confidential 10
Types of View Controllers
Most commonly used UI View Controllers
UINavigationController
Navigation Controllers Manage Stacks of Other View Controllers
![Page 11: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/11.jpg)
Yahoo! Confidential 11
Types of View Controllers
UITableViewController
Interesting features:• Lazy loading• Grouping
![Page 12: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/12.jpg)
Yahoo! Confidential 12
Types of View Controllers
UITabBarController
Tab Bar Controllers Manage Independent Sets of View Controllers
![Page 13: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/13.jpg)
Yahoo! Confidential 13
Types of View Controllers
UIPageViewController
Page View Controllers Manage Paged Display of View Controllers Apps can use a page view controller to present a paged view of content The page view controller itself manages the display of one or more content
view controllers, each of which provides a single page of content.
UISplitViewController
Split View Controllers Manage Two Panes of Information Apps can use a split view controller to manage two panes of information,
where both portions of the interface are themselves managed by view controllers.
This is interface is similar to a navigation controller, but it takes advantage of the larger screen size of iPad to present more content at a time.
![Page 14: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/14.jpg)
Yahoo! Confidential 14
Types of View Controllers
View Controllers at a glance
![Page 15: iOS training (intermediate)](https://reader036.fdocuments.us/reader036/viewer/2022081602/553888774a7959f66c8b4755/html5/thumbnails/15.jpg)
Yahoo! Confidential
Topics
Protocols and Delegates Categories and Selectors Views and View Controllers
Introduction to View Controllers Types of View Controllers
Hands on example for Creating a View Controller Manipulating Views Adding Content to Application
Working with Images Adding Simple Animation
15