[Swift] This is the solution! Illustration of Delegate implementation

Introduction

Anyone who started Swift would have thought first Teaching materials / articles "Delegate is an agent .." Reader "What is an agent?"

In this article, I will introduce Delegate graphically and explain how to use it. By the time you finish reading "I see, Delegate is an agent." You're probably thinking.

Understand Delegate

スクリーンショット 2020-09-29 21.32.32.png Below, the protocol PopViewDelegate: UIView part is incorrect class PopupView: It will be UIView.

スクリーンショット 2020-09-29 21.36.38.png

At the end

What did you think? I think you thought, "Delegate is an agent." If anyone around you is having trouble understanding Delegate, please do Please introduce this article.

Recommended Posts

[Swift] This is the solution! Illustration of Delegate implementation
[Swift] This is the solution! Illustration of Delegate implementation
Comparison memo for those who touch Kotlin (Android) from Swift (iOS) 1
[Swift] Vaguely grasp the flow of Delegate
[Swift] Simple implementation of UIImageView
[Swift] Implementation of ultra-simple billing
This is the first post.
[Swift] Get the timing when the value of textField is changed
[Swift] Change the textColor of UIDatePicker
[Ruby] This is the solution. When should I use instance variables?
The basic basis of Swift dialogs
The basic basis of Swift's Delegate
This and that of the JDK
[Swift] The color of the Navigation Bar is different (lighter) from the specified color.
This and that of the implementation of date judgment within the period in Java
What is testing? ・ About the importance of testing
[Swift 5] Implementation of membership registration with Firebase
[Swift] Termination of the program by assertion
[Swift] Get the height of Safe Area
What is the data structure of ActionText?
[Swift] Change the color of SCN Node
[Implementation] Eliminate the ominous smell of code
The basic basis of Swift custom cells
[swift] How to control the behavior when the back button of NavigationBar is pressed
[Java] Where is the implementation class of annotation that exists in Bean Validation?
[Java] Is it unnecessary to check "identity" in the implementation of the equals () method?
[Swift, a must-see for fledgling! ] Let's understand the implementation of communication processing of WebAPI
What is JSP? ~ Let's know the basics of JSP !! ~
ActiveSupport underscore is not the inverse of camelize
The order of Java method modifiers is fixed
SKStoreReviewController implementation memo in Swift UI of iOS14
The official name of Spring MVC is Spring Web MVC
[Swift] Termination of the program by the fatalError function