protocol Archives

How to define a Protocol

Protocols are a great way to delegate responsibility from one class to another. Consider a view controller that brings up another view controller via a modal segue. Let’s call them ViewController and DetailViewController. When it comes to dismissing that DetailViewController, he could do it himself via [self dismissViewControllerAnimated:YES completion:nil]; However, the first ViewController wouldn’t be […]