Swift 3 Load xib. NSBundle.mainBundle().loadNibNamed return Bool
问题 I was trying to figure out how to create a custom view using xib files. In this question the next method is used. NSBundle.mainBundle().loadNibNamed("CardView", owner: nil, options: nil)[0] as! UIView Cocoa has the same method,however, this method has changed in swift 3 to loadNibNamed(_:owner:topLevelObjects:), which returns Bool , and previous code generates "Type Bool has no subscript members" error, which is obvious, since the return type is Bool. So, my question is how to a load view