Monday, January 1, 2024


Tags

SwiftUI Icon

Lovin' SwiftUI

Been enjoying Mac development again, thanks to Swift & SwiftUI.

Monday, January 1, 2024 - Sam Rowlands



One of the final things needed for the Permissions Reset update is to re-build our Update System.

I decided to use a single HTML file, which can be read in a browser, and the program. Once I decided on the structure and format, I needed a program to help me validate the page, and to use to build the update check.

Two days later, I have a fully working validation app, this includes learning and writing the code to process HTML. It is built using a “Document based application” so it not only handles recent items and document re-opening for me, but as a side effect it auto re-loads the data when I save changes made externally.

I could build this UI in Xojo, but it alone would take me more than two days, especially if I wanted it to support native scrolling, alternating backgrounds etc. By using Live data in the SwiftUI preview, I was able to design and tweak the UI, all without having to run the application, this alone saves so much time.

With native support for SF Symbols, adding standard icons is an absolute breeze.

SwiftUI has really helped make Mac development more exciting (for me), and further cements how far outa the race Xojo is. At this point, I don’t think there is anything Xojo can do to catch up, but I believe they know that already.

Sure it’s not without it’s downfalls, adapting some of the work flows to the SwiftUI way, can be a massive paradigm shift, and sometimes feels like hacky spaghetti code. Alerts for instance feel unnatural, but I can see why they’ve done them this way.