example of how to generate a view from a xib prototype, implemented in Swift and Obj-c