Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. // ***** objc
  2. @interface ChildInObjc : ParentInObjc
  3. - (nullable NSString *)text;
  4. @end
  5.  
  6. @implementation ChildInObjc
  7. - (nullable NSString *)text { return [super text]; }
  8. @end
  9. // *****
  10.  
  11. // ***** swift
  12. #if swift(>=3.0)
  13. let parent = ParentInObjc()
  14. // func text() -> String!
  15. let parentText = parent.text() // String? 😇
  16. let child = ChildInObjc().text() // String?
  17. #else
  18. let parent = ParentInObjc()
  19. // func text() -> String!
  20. let parentText = parent.text() // String! 😣
  21. let child = ChildInObjc().text() // String? 😇
  22. #endif
  23. // *****
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement