My Swift Xcode project has as main class a `NSViewController` subclass (thereafter the "main controller") which grew to be about 4k lines tall. Most of the logic tied to the main window and main actions of the app are inside this file, as methods of the class.

This results in Xcode being super slow when it comes to autocompletion and typing in general. I want to split the logic into several smaller files which will hopefully speed up my workflow. How can I proceed to do this?

If I have to be more specific, I would guess that what I want to achieve is: moving methods from this main controller to a separate file/class, and then call from the main controller any of these methods that I moved (ideally, this function in a separate file would be able to call other methods inside the main controller as well).

Are `extension`s something that could help in this matter?

Thanks