I cannot understand what Delegates are used for in swift
I tried to search in any possible site what a delegate is and for what it is used for but I cannot completely grasp the meaning of them.
f.e. in this code
extension SignUpViewController : UIImagePickerControllerDelegate, UINavigationControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
}
}
what are the delegates assigned to the ViewController supposed to do? and how can I understand how to use them?