Right, but you can’t have a single package containing both ObjC and Swift. It’s a limitation of SwiftPM that has prevented me from using it for a few projects (I am using it in several others, though).
Oh gotcha, yeah they’re absolutely usable as any maintainer mixing the languages and providing SPM support will handle the binary release part. If anything it’s nicer for the consumer (binary releases in general) as it cuts down on full app rebuild times.
I kept hitting my head against the wall, and getting a million stupid errors trying to resolve header files. But in the end I got it working, and I will no longer be one of the guys pestering the old Cocoapods servers :)
For whoever comes after me... When ChatGPT suggests changing your Objective-C from this:
#import package.h
To this:
#import <package/package.h>
Just skip that rabbithole of inifiny-nested failure, and just do this instead:
Whether anyone at Apple cares about documentation any more is another matter. A really sad state of affairs, because once upon a time, Apple had some of the best documentation out there. Of course, that was when they actively needed to court a developer community, and couldn't just announce something half-baked at WWDC and get mass adoption from enthusiastic developers.
I don't know, maybe some of the die hards are in denial. I really enjoy the language and the platforms but I'd readily admit it's pretty far behind in terms of DX. I think at this point Apple is going to have to make this a really big priority if they want to remain relevant and it's going to take a lot of effort on their part.
While I certainly can't speak for all diehards, I hear a lot of complaints about the state of Apple's documentation from long-time developers these days. (In my experience, the true Apple diehards are often very critical of the company, but they tend to have specific trenchant critiques.)
Even iOS programming communities will admit you're brave for using SwiftUI right now. It's brand new, has a lot of issues like being completely unable to show you a coherent type-error message (like if you have an error inside a ForEach view).
Two examples: The application has two main components, a controller and a struct containing the ui implementation. Callbacks in the cursive library are called with a reference to Cursive, but I had a hard time figuring out how to pass the controller to the callback. In the end I decided to use a message channel (mpsc::Receiver and mpsc::Sender) to let the two components communicate. After some struggling I saw that cursive has a function to set user data which is accessible inside the callbacks. So I pass the channels through userdats. Not sure if this is the best architecture.
I never managed to pass a reference to the controller to the ui callbacks. The Compiler complained about undefined lifetime of the reference, though I knew that both outlive the application runtime.
A similar situation occurred in the asynchronous communication with gopher servers. I use a thread to fetch a resource from another server while keeping the ui responsive. Passing the result from the thread back did not work out in the beginning.
I don’t think the idioms are so different in Rust, but when passing data between components, threads and the like, you have to be very specific in your code, using Arcs, RwLocks, Mutexes, etc.
On the bright sight, when the code compiles, it usually worked as intended. Using C or C++, there would be more race conditions, null pointer exceptions and more.
You are dealing with a lot, in a compressed period of time.
Try to remember that your first priority and responsibility is looking after your own mental, physical and spiritual (I don't mean this in a religious sense) well being.
In your situation, work really should be the lowest priority that you can afford to make it. If you can afford to take extended time off to deal with everything you need to, I would highly recommend that you give it serious consideration.
I wouldn’t just take time off without a plan for doing something. It’s really easy to spend months or years at home without improvements. Go to a psychologist or something. I once spent a month at a yoga ashram which was a turnaround for me.