How do I get all the views in a Nib file?
I'm trying to get all the views within a Nib
with:
let objects = Bundle.main.loadNibNamed("ViewName", owner: self, options: nil)?[0] as! NSArray
let mainView : UIView = objects[0] as! UIView
Though I'm getting this error:
Could not cast value of type 'UIView' (0x108080b40) to 'NSArray' (0x105173c58).
Thanks in advance for your help.