Before I get too far into my project, I want to clear up what’s the best way to handle things for a sustainable app.
While working on the first part of my (MacOS) project, I noticed that my view controller file was getting hugely unwieldy because I had so many interface elements I needed to work into it. It’s a single-view app (for now) but there are at least four, possibly five “sections” of radio buttons and check-box options and all the methods and arrays and switch statements and whatnot behind them.
And that’s before I get to work on the windows that will open up when certain buttons are clicked.
I was using
// MARK: comments to make navigating it all a little easier, but it was still a lot of code for a single file.
Then somewhere in my research into how to do something else, I stumbled upon a couple sites making arguments for using multiple view controllers to keep your code neater. But when I dug deeper, it seems like most of the tutorials are talking about multiple view controllers for multiple views, not for a single-view app that just happens to have a lot going on in that single view.
When I tried to experiment and follow some tutorials on how to add additional view controllers, I couldn’t link my interface elements to them as
@IBAction methods. Which I take to mean they’re not actually meant to manage elements that are located on a single interface view.
So now I’m not sure what the best practice for handling this sort of situation is, and I really would like to know before I get much further into my project and it becomes impossible to fix a bad situation.