Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public class childA : Parent{
  2.  
  3. //written in swift
  4. }
  5. public class childB : Parent{
  6. //written in swift
  7. }
  8.  
  9. @interface Parent @end
  10. @implementation Parent
  11. //written objective c
  12. - (instancetype)initWithFrame:(CGRect)frame
  13. {
  14. self = [super initWithFrame:frame];
  15. if (self) {
  16. [self initialize];
  17. }
  18. return self;
  19. }
  20.  
  21. - (instancetype)initWithCoder:(NSCoder *)coder
  22. {
  23. self = [super initWithCoder:coder];
  24. if (self) {
  25. [self initialize];
  26. }
  27. return self;
  28. }
  29.  
  30. @end
  31.  
  32. let cA = childA.Type
  33. cA.init() // here default initWithCoder the Parent class
  34.  
  35. let cB = childB.Type
  36. cB.init() // here for some reason it calls initWithFrame
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement