macOS Programming Tutorial: Working with Custom Views and Cocoa Controls

Great apps have great user interfaces, and chances to build a great interface entirely inside the views of the view controllers in the storyboard file(s) are small. Usually, complex views are being designed in separate Xib (Interface Builder) files, and knowing how to load content from custom views is a mandatory skill that each macOS developer must have. This kind of separation also helps in maintenance, extendibility and testing of the app. In the previous macOS tutorial, we didn’t create any custom views as the focus was on other topics, but now it’s about time to discuss about that.

The solution we will implement today so we can load custom views is going to be reusable code that can apply to any macOS project. That means that by leaving today you’ll get a small tool that will automate and speed up your work when building your own apps.

Besides that, in this tutorial we are going to walk through some common Cocoa controls that are met on macOS, and we’ll talk about their properties, how they can be configured, and how we can get or set values to them both graphically and in code. I bet that you’ll find a few interesting things among them.

Without any additional delay, let’s get started by having a look at our demo app.

→ Keep Reading at AppCoda