Update
You can modularize a swift project using frameworks.
We modularize by creating separate framework projects for each module and link them via Xcode workspace. It looks more natural when we separate the components into different projects & it also makes sure that there is only a one-way communication between modules. Developers can work/test on isolation without thinking much about other modules.
By default classes/structs/etc created within a framework will have an internal
access control type so it is only visible within the modules. In order to make it visible outside the module, you can make it public
.
More info on access controll level here
The latest Xcode 6 beta update (beta 4) bring access control to swift
Swift Enables Access Control
Swift access control has three access levels:
- private entities can only be accessed from within the source file where they are defined.
- internal entities can be accessed anywhere within the target where they are defined.!
- public entities can be accessed from anywhere within the target and from any other context that imports the current target’s module.