- Create a subclass of NSView. Then just paste that code in the .m file.
- Click on your Xib window. Open Document Outline drawer and make sure that its View is selected. Then go to the sidebar to the right and click on the identity inspector. Then enter the name of the subclass you've created in the Class field.
That's much it.