last day (14 days later) » 

08:14
0
Q: 2 view controllers, each has its own xib, one of them is a subclass of another?

Vyachaslav GerchicovI have a custom class inherited from UIViewController. Let I call it "VC1". I need to subclass it (create "VC2" with its own xib). Then I try to create and use VC2. The problem is VC2 used but with xib from VC1. How to solve this issue? May it happen because of VC1 is written in Obj-C and VC2 in...

You need to override the code of VC1 which choose the nib.
tried to override, tried to create a file and specify a concrete xib file - doesn't work while VC2 is subclassing VC1
can you please show how you attach nib in your VC1?
it is a simple view - nothing special which has influence on this behaviour
Do you explicitly tell VC1 to pick a nib in your code?
08:14
Again - I tried 2 ways: 1)override nibName method; 2)via constructor with specifying a concrete nib name
I would have assumed that this should've worked >> 2)via constructor with specifying a concrete nib name
Now I try the pure project to implement the same thing
super.init(nibName: nil, bundle: Bundle(for: MyViewController.self))
something like this.. should've worked
08:17
let vc = ViewController2(nibName: "ViewController2", bundle: nil)
very strange - in pure Obj-C test project it works
:P
are you setting the nib owner correctly
08:35
found the reason. It worth a separate answer
what was the reason?
answered. Doesn't know how it has such influence but It really has

last day (14 days later) »