Thursday, September 19

SwiftUI for Mac 2024

Throughout the years, I have actually composed posts and sample apps to show the brand-new functions of each year’s SwiftUI updates with specific focus on macOS app advancement. In 2015, the significant upgrade to SwiftUI was the brand-new information circulation system utilizing the Observation structure. I covered that in my post SwiftUI Data Flow 2023 however I didn’t feel there sufficed UI modifications to call for an upgrade to my normal sample app.

This year, the HTTP Cats app is back! And I’ll cover brand-new functions from both WWDC 2023 and WWDC 2024.

It’s presently August 2024 and I am running macOS Sequoia 15.1 Beta (24B5024e) with Xcode 16.1 beta (16B5001e).

Download the job from GitHub and, if you’re running the appropriate variations of macOS and Xcode, you can run the app and follow along. If not, you can still take a look at the code, however it will not construct.

Caution: there’s a bug today that crashes the app in macOS 15.1. If you scroll down the list in the sidebar and after that pick a status that is more than 8 or 9 rows listed below the previous choice, the app crashes with this mistake: Row index -1 out of row variety (numberOfRows: 60). I’ve evaluated this with Xcode 16.0 beta 6 and Xcode 16.1 and they both act the exact same. On a computer system running macOS 15.0 beta 7 and Xcode 16.0 beta 6, it works completely. This is a bug in macOS 15.1.

Here are the locations that I’m going to talk about:

  • Xcode
  • Sneak peeks
  • Windows
  • Tabs
  • Charts
  • Colors and gradients
  • SF Symbols

Xcode

When you develop a brand-new job in Xcode 16.1, the 2nd product in the task navigator is now a folder rather of a group. This sounds insignificant, given that it actually is a folder in Finder however I discover it truly irritating due to the fact that it does not enable me to organize my other files and folders as I desire them. To repair this, right-click on the folder and choose Convert to Group. The icon changes from blue to gray and you can when again drag files and folders to re-order them.

The benefit to the folder alternative is that your job reads straight from the file system, so you can utilize Finder to move files around and Xcode will show the modifications. To import a file into the task, you can drag it into the task’s Finder window and Xcode will see it. To erase a file, you can utilize Finder straight. With the group alternative, you need to import files into the Xcode Project navigator, and when you do, source control marks the.xcodeproj submit as customized, making source control messier. Utilizing the folder alternative, just the brand-new file itself gets significant as a modification. Usage which choice works for you, however I much choose the clearness of being able to arrange my files in the Project navigator.

ยป …
Learn more