I noticed that UINib:instantiate(withOwner:options:)
returns an array. Does this mean that one nib file can contain more than one view? In every example I saw there was only one view, which was the first object in the array. What are the other (possible) elements in the array?
I'm asking because I'm trying to understand how this whole mechanism work, not so much because I want to work this way, so any theoretical background info will be welcome.
Thanks!
EDIT: if I can have more than one view in a nib file, how do I connect the second to a UIView subclass? There's only one File's Owner
.
Yes, You can have multiple views in nib file. For example.
A
Test.nib
with two root views.Load it
views
will be an array of two. First element of array will beUIView
and second will beUITableViewCell