Not A Blog
Not a Blog

A place to save useful development notes.

One of the problems with developing something new for a new platform is knowing just what to do. As a long time Windows developer, I know what I want to achieve, but don't know how to achieve it. It's very frustrating.

I started out fixing this with a Mac app template project, which proved very instructional but didn't really reflect a real world application. So I created a second in Mac application, based on a more realistic app. Doing this gave more insight into what it was that I didn't know.

My first app is now at a stage where I have built a working application with the majority of the functionality it needs to operate. Along the way, I had many challenges to overcome. Some relatively simple and some rather complex. This section is intended to document some of these challenges and the solutions I came up with.

Along the way, I may well come up with other stuff that I need to document be it Macos, iOS or anything else. I'll add those in as and when.

When your view contains data that has to be manually saved (to a file for example), it is critical to know if your app is terminated or the window is closed. I found that out the hard way by making multiple edits to a file and promptly losing them all when I closed the window without saving!

As a rule, changes in the data should be sufficient to trigger changes in our views. However, there are times when this mechanism does not work as smoothly as we need it to and it is useful to be able to notify our application that something has happened.

There is a lot available to us in SwiftUI. If, however, you want to deal with files and folders, you’re going to have to resort to appKit as your API of choice. Not all Mac applications are going to need to interact with files selected by the user, so it may not be a problem. However, if you want to open a file, save (as) a file or select a folder, you’re out of luck with SwiftUI.

There is a lot available to us in SwiftUI. If, however, you want to deal with files and folders, you’re going to have to resort to appKit as your API of choice. Not all Mac applications are going to need to interact with files selected by the user, so it may not be a problem. However, if you want to open a file, save (as) a file or select a folder, you’re out of luck with SwiftUI.

Mac desktop applications have menus, many of which are generated for us automatically when we create a new application from the template. Sadly, they’re often overlooked and rarely documented in the courses I have looked at for Mac and SwiftUI.

Testimonials
Testimonials

Am I really any good?

Don't take my word for my abilities, take a look at other peoples opinions about me.