Questions tagged [loadnibnamed]
62 questions
-2
votes
1 answer
Could not cast value of type 'UIView' to 'NSArray'
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…

uplearned.com
- 3,393
- 5
- 44
- 59
-2
votes
2 answers
iOS 6 loadNibNamed loads nib of iphone5 in 3.5 inch phones
I have a UIView subclass ( PopupView ) and two xbis for it: PopupView.xib and PopupView~iphone5.xib .
When I call the xib:
if ( screenHeight >= 568 ) {
subviewArray = [[NSBundle mainBundle] loadNibNamed:@"PopupView~iphone5" owner:self…

Panos
- 7,227
- 13
- 60
- 95