//
//  UINib+Extension.swift
//  SwiftUtilities
//
//  Created by Rodrigo Ruiz on 6/29/17.
//  Copyright © 2017 Rodrigo Ruiz. All rights reserved.
//

extension UINib {
    
    public static func instantiateView<T: UIView>() -> T {
        let nib = UINib(nibName: String(describing: T.self), bundle: nil)
        guard let view = nib.instantiate(withOwner: nil, options: nil)[0] as? T else {
            fatalError()
        }
        return view
    }
    
    public static func instantiateView(_ nibName: String) -> UIView {
        let nib = UINib(nibName: nibName, bundle: nil)
        guard let view = nib.instantiate(withOwner: nil, options: nil)[0] as? UIView else {
            fatalError()
        }
        return view
    }
    
}

//
//  UINib+Extension.swift
//  SwiftUtilities
//
//  Created by Rodrigo Ruiz on 6/29/17.
//  Copyright © 2017 Rodrigo Ruiz. All rights reserved.
//

extension UINib {
    
    public static func instantiateView<T: UIView>() -> T {
        let nib = UINib(nibName: String(describing: T.self), bundle: nil)
        guard let view = nib.instantiate(withOwner: nil, options: nil)[0] as? T else {
            fatalError()
        }
        return view
    }
    
}

--- 
+++ 
@@ -16,4 +16,12 @@
         return view
     }
     
+    public static func instantiateView(_ nibName: String) -> UIView {
+        let nib = UINib(nibName: nibName, bundle: nil)
+        guard let view = nib.instantiate(withOwner: nil, options: nil)[0] as? UIView else {
+            fatalError()
+        }
+        return view
+    }
+    
 }
Add instantiateView method to UINib.
