SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 133 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protocol SampleProtocol {}
  2.  
  3. class SampleClass:SampleProtocol {}
  4.  
  5. extension SampleProtocol {
  6.     func extMethod() {
  7.         print("I am here in Protocol")
  8.     }
  9. }
  10. extension SampleClass {
  11.     func extMethod() {
  12.         print("I am here in Class")
  13.     }
  14. }
  15.  
  16. let obj = SampleClass()
  17. let prt : SampleProtocol = SampleClass()
  18. obj.extMethod()
  19. prt.extMethod()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top