Sorry to hear about mental health issues. - It's likely something different but I've had plenty of fights with depression which is seriously demotivating, so yeah that sucks.
With code though it may be nice to know that you don't need to remember very much. You can easily be overwhelmed with all the API calls and such in some tutorials and such, but you don't need to remember all that. You're not a "real programmer" by remembering how to do every kind of API call. It's OK to look things up when you need them, and in fact we (we here being computer scientists and programmers) almost always have API documentation and Stack open along with our code. The APIs you often engage with you'll remember at some point - but even though I've a distributed messaging system in Go; I cannot for the life of me remember how to start listening on a specified TDP socket in Go. - But you don't need to remember. You just need to know what you want to achieve and you look up how to achieve it in small chunks and put it together.
Also remember to actually try and code your own things based on what you learn. Just copying what's shown in a tutorial doesn't help understanding anywhere near as much as taking the general concepts and playing around with them on your own.
Normally I'd also recommend reading through other people's code on GitHub, but I don't actually have any good examples of Swift projects - I'm sure there are many good ones, I don't know any that are approachable though.
I have two up there in Swift, a macOS Manu Bar app and a Linux CLI program (also works on Mac, but intended for Linux) that is meant to interact with cron - But they're not really cleanly coded since I just wanted to quickly push them out there for personal usage and they do what I need even though HexHelper specifically doesn't give the best UX possible.
Studying Computer Science at Aarhus University, writing SpriteKit games and other Apple platform/Linux stuff for fun - casperes1996
GitHub.com
if you want to have a look
Unfortunately most of my repositories are private and I'm not allowed to publish them so I only have those two Swift projects publicly visible.
I also recommended him in the prior post I made about resources, but I really recommend checking out Paul Hudson's work for learning Swift. Along with his app with daily small simple challenges and such.
If you have any small ideas; Things that feel like they should be super simple to make, either GUI programs or command line tools - I think just try working on your own ideas. Throw away guides, tutorials, courses and books for a bit and just jump into it. No sample code, all just your code. Start with one problem at a time; Write a list of what you want to achieve, like
TODO APP:
• A list view with pre-programmed todo items
• Make list dependant on stored data.
• Make user able to add to the list in memory
• Save edits to stored information
• Allow deleting from the list
And figure out how to achieve each part one at a time until you've built your first simple program all on your own. And more importantly, where you made all the decisions about how to structure it.