Академический Документы
Профессиональный Документы
Культура Документы
2
Protocol
protocol ProtocolName {
func firstFunctionName(parameters)->returnType
func secondFunction …. etc.
}
3
Protocol
4
Example
OBJAttributeProtocol
UIImage
6
ExampleUsage
7
Delegate and DataSource
8
DataSource
function call
Object of Type X
UITableView
UITableViewDataSource
9
UITableViewDataSource
10
Setting TableView dataSource
11
Setting TableView dataSource
✤ Go to connections
inspector
✤ drag a connection
from the data source
outlet to the view
controller
12
Setting TableView dataSource
UITableViewDataSource
UIViewController
Data Source
ViewController
TableView
13
Implement functions
14
Watch and Learn
✤ https://youtu.be/DThwGAp0BSI
15