Can I Include a Non-Class File in a Class File?

My data-modeling Swift class is getting large. Can I put some functions for that class into a separate, plain Swift file and somehow include that file in my class, so that those functions are in the model class's namespace? Or do I have to put those extra functions into a class of their own and instantiate it within my model class?

Answered by NotMyName in 70838022

"I want to define some methods for my class in a seperate file" is what class extensions are for.

https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Extensions.html

Accepted Answer

"I want to define some methods for my class in a seperate file" is what class extensions are for.

https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Extensions.html

Can I Include a Non-Class File in a Class File?
 
 
Q