Skip to content

Instantly share code, notes, and snippets.

@Edudjr
Last active February 7, 2022 20:37
Show Gist options
  • Save Edudjr/29595062bc2dd20256ed5569e0eceba9 to your computer and use it in GitHub Desktop.
Save Edudjr/29595062bc2dd20256ed5569e0eceba9 to your computer and use it in GitHub Desktop.
protocol Prototype {
associatedtype CloneType
func clone() -> CloneType
}
extension UILabel: Prototype {
...
// Don't forget to specialise the return type!
func clone() -> UILabel {
UILabel(self)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment