Created
November 17, 2019 11:15
-
-
Save kingnight/bd22fc50798f5c5eafc313dd8f191d7a to your computer and use it in GitHub Desktop.
sil protocol demo
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
protocol ListDataProtocol { | |
func testFunc() | |
} | |
class TestClass:ListDataProtocol { | |
func testFunc() { | |
print("ahaha") | |
} | |
} | |
extension ListDataProtocol{ | |
func testFunc() { | |
print("bhbhb") | |
} | |
} | |
let obj:TestClass = TestClass() | |
obj.testFunc() | |
let obj2:ListDataProtocol = TestClass() | |
obj2.testFunc() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment