Created
October 8, 2019 09:39
-
-
Save OlexandrStepanov/852cd62344dab498b1baec28bbc59145 to your computer and use it in GitHub Desktop.
Swift protocol extension example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
protocol AppNavigationProtocol { | |
var appDelegate: AppDelegate { get } | |
} | |
extension AppNavigationProtocol { | |
var appDelegate: AppDelegate { | |
return UIApplication.shared.delegate as! AppDelegate | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment