Skip to content

Instantly share code, notes, and snippets.

@kingnight
Created November 17, 2019 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingnight/bd22fc50798f5c5eafc313dd8f191d7a to your computer and use it in GitHub Desktop.
Save kingnight/bd22fc50798f5c5eafc313dd8f191d7a to your computer and use it in GitHub Desktop.
sil protocol demo
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