Created
November 16, 2016 13:59
-
-
Save SiarheiFedartsou/5bfb381d6f175090b1eb90fe5b9678c4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
protocol Foo1 { | |
func foo1() -> String | |
} | |
protocol Foo2 { | |
func foo2() -> String | |
} | |
extension Foo1 where Self : Foo2 { | |
func foo1() -> String { | |
return "foo" + self.foo2() | |
} | |
} | |
struct Foo : Foo1, Foo2 { | |
func foo2() -> String { | |
return "test" | |
} | |
func test() { | |
print(self.foo1()) | |
} | |
} | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
print(Foo().test()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment