3

Does anyone sucessfully replicate this objc method in swift? I still can't make it successful in init method.

self=[[[NSBundle mainBundle] loadNibNamed:@"DGNodeView" owner:nil options:nil] firstObject]

I still can't find a good answer that is clearly working with xcode 6.0.1

eNeF
  • 3,241
  • 2
  • 18
  • 41
  • You cannot replicate that in Swift. `self` is immutable. You're going to have to refactor your code and the xib file. – Abhi Beckert Oct 10 '14 at 04:14
  • Yes, self in swift can't be modified or initialize with custom xib. But I want to init my uiview class with xib, how can I refactor my xib and swift class? thanks – eNeF Oct 10 '14 at 04:30
  • http://stackoverflow.com/questions/24370061/assign-xib-to-the-uiview-in-swift – Steve Rosenberg Oct 10 '14 at 05:34
  • I already tried using extension class function. but the inititialization are by passed. so it will only inherit what's in the nib but not the class itself which is supposed to be the owner of the nib. I'm saying that the class that the nib was supposed to be using was ignored. only the view itself was use from that loadnib. – eNeF Oct 11 '14 at 10:37

0 Answers0