Creating a Document-Based Mac Application Using Swift and Storyboards

August 7th, 2017

Filed under: Cocoa, Mac Development | 29 comments

I continue my writing on crafting modern Cocoa applications with Swift and storyboards. In this article you’ll learn about building document-based Cocoa applications by developing a simple text editor. I hope this article and project provide a gentle introduction to building document-based Cocoa applications in Swift. If you haven’t read it already, I recommend reading […]

Instantiating Views from Mac Storyboards

May 30th, 2017

Filed under: Cocoa, Mac Development | Be the first to comment!

This is another post I’m writing as a reference to myself in case I need to deal with this subject in the future. There may be better ways to instantiate views than what I describe here. I’m sharing this information because there’s not much information available on Mac storyboards. Reading the following articles may help […]

Creating a Simple Mac Application Using Cocoa, Swift, and Storyboards

March 31st, 2017

Filed under: Cocoa, Mac Development | 3 comments

I’ve noticed there aren’t many articles or tutorials online about writing Mac apps in Swift. To help fill the void I’m writing this tutorial that guides you through the creation of a simple Cocoa app in Swift. The app converts temperatures from Celsius to Fahrenheit. Enter a temperature in Celsius, click a Convert button, and […]

Mac Storyboard Show Segues Involve Window Controllers

October 11th, 2015

Filed under: Cocoa, Mac Development | Be the first to comment!

I struggled with how to pass data between view controllers in a Mac storyboard show segue so I’m detailing how I solved the problem here. I hope it helps others who have a similar problem. Short version: a show segue involves window controllers, not view controllers. Implement prepareForSegue in a NSWindowController subclass. Background I’m writing […]

Connecting Menu Items to IBActions in a Mac Storyboard

February 23rd, 2015

Filed under: Cocoa, Interface Builder, Mac Development | 6 comments

A common pattern in Mac application development is to create a menu item, create an IBAction for that item in one of your classes, and connect the menu item to the IBAction. When the person running your application chooses that menu item, your application performs the IBAction. If you’re using storyboards to develop your Mac […]