Calling Bundle.main.loadNibNamed
to load a .xib file which contains (n) multiple variants of one UI defined with multiple UIView
s instantiates n instances of my subclass.
I then apply a filter expression to choose the correct variant with .first(where: { $0.restorationIdentifier == <correct restoration ID>
.
In this instance my filter expression correctly returns the 5th UIView
inside of my .xib but the @IBOutlet
s in my custom class are connected to the 1st UIView
that was instantiated but which is immediately deprecated by what I assume is ARC.
This leads me to having unexpectedly nil IBOutlet
s. What can be done to connect the IBOutlet
s to the correct (5th in this case) UIView returned by Bundle.main.loadNibBaned