Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ***** objc
- @interface ChildInObjc : ParentInObjc
- - (nullable NSString *)text;
- @end
- @implementation ChildInObjc
- - (nullable NSString *)text { return [super text]; }
- @end
- // *****
- // ***** swift
- #if swift(>=3.0)
- let parent = ParentInObjc()
- // func text() -> String!
- let parentText = parent.text() // String? 😇
- let child = ChildInObjc().text() // String?
- #else
- let parent = ParentInObjc()
- // func text() -> String!
- let parentText = parent.text() // String! 😣
- let child = ChildInObjc().text() // String? 😇
- #endif
- // *****
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement