Skip to content

Instantly share code, notes, and snippets.

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 XuYanci/f7ec48354da22436a6461706e50c3818 to your computer and use it in GitHub Desktop.
Save XuYanci/f7ec48354da22436a6461706e50c3818 to your computer and use it in GitHub Desktop.
Init in protocol extension.swift
protocol P {
init()
}
extension P {
init(something: AnyObject) {
self.init()
print("P")
}
}
struct A: P {
init() {
print("A")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment