ios delegate
Post on 22-Jan-2018
200 Views
Preview:
TRANSCRIPT
Delegate2015/12/30
Delegate ( )
Delegate ( )
Protocol ( )
Delegate
• A B
• A (what)
• B (how)
4
A Bwhat
•
5
• •
(code)
6
(code)
7
(code)
8
Protocol ( )
Spec ( )
• Hello
• return
10
return
(storyboard)
11
UITextFieldUIButton
UILabel
Hello + name
(code)• ViewController
UITextFieldDelegate textFieldShouldReturn
12
UITextField
(result)
13
return
Protocol ( ) Delegate ( )
Delegate
• A B
• A (protocol, )
• B (class, )
15
A Bprotocol
•
16
• ( ) • ( ) •
(code)
17
(code)
18
(code)
19
• App
•
•
20
21
(storyboard)
22
UIButtonUILabel
(code)
23
protocol
(code)
24
class protocol delegate
!!
?
(code)
25
delegate protocol
(code)
26
Delegate ( )
• delegate ( ) protocol ( )
• protocol ( ) delegate ( )
• protocol ( ) (what)
• class ( ) (how)
28
top related