Avoiding a macOS Tahoe window corner in objective-c

I watched the video Build an AppKit app with the new design and followed the discussion about how to have a button avoid a window corner. However, the code is in Swift and my codebase is still heavily written in objective-c. I've searched NSView.h but can't find anything new related to safe areas and corners. How are we supposed to avoid corners using objective-c?

I can't help you specifically with this, sorry.

I know it's a pain to migrate from ObjC to Swift/SwiftUI - I've been there - but there are two options:

  • Migrate from ObjC one file at a time;
  • Rewrite the app from scratch.

I completely rewrote one of my ObjC apps within a couple of weeks in my spare time, and it has far less code in it. Things like filter, map and compactMap reduced my code so much.

You could do this as a separate project while trying to update the original app. So, make the necessary updates to the original and also start writing the new version from scratch. You'll probably enjoy it. And if you need any help at all, just ask.

Oof, as much as I'd like to, migration to Swift/SwiftUI is just not practical at this time. Our application is very big with a lot of distinct parts (think Xcode but with more parts) so this is not trivial to do even if it's one file at a time. I've got a team working on porting the Windows MFC version of our application to .NET and they've been working on it for 3 years and still aren't done! Our application is available for Windows, Mac, and Linux and one of the nice things about ObjC is that it can be mixed in with C/C++ code which makes writing multiplatform code very easy.

I did look at perhaps writing all new GUI code in Swift a few years ago when it first came out but had problems with the ObjC and Swift bridging and gave up as I had more pressing things to work on.

Avoiding a macOS Tahoe window corner in objective-c
 
 
Q