Created
July 16, 2016 07:15
-
-
Save patchthecode/86360eae735136fadfde6e5c622f138d to your computer and use it in GitHub Desktop.
generics
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
class class1 { | |
var view: viewSubclass1! | |
func printName() { | |
print("This is the view: \(view)") | |
} | |
} | |
class class2 { | |
var view: viewSubclass2! | |
func printName() { | |
print("This is the view: \(view)") | |
} | |
} | |
protocol myProtocol { | |
var view: UIView {get set} | |
func printName() | |
} | |
extension myProtocol { | |
func printName() { | |
print("This is the view: \(view)") | |
} | |
} | |
class viewSubclass1: UIView { | |
} | |
class viewSubclass2: UIView { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment