15
Yahoo! Confidential 1 iOS Training (Intermediate) Yahoo! Confidential Gurpreet Singh Sriram Viswanathan

iOS training (intermediate)

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: iOS training (intermediate)

Yahoo! Confidential 1

iOS Training (Intermediate)

Yahoo! Confidential

Gurpreet SinghSriram Viswanathan

Page 2: iOS training (intermediate)

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)

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)

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)

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)

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)

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)

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)

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)

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)

Yahoo! Confidential 11

Types of View Controllers

UITableViewController

Interesting features:• Lazy loading• Grouping

Page 12: iOS training (intermediate)

Yahoo! Confidential 12

Types of View Controllers

UITabBarController

Tab Bar Controllers Manage Independent Sets of View Controllers

Page 13: iOS training (intermediate)

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)

Yahoo! Confidential 14

Types of View Controllers

View Controllers at a glance

Page 15: iOS training (intermediate)

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