Episode #506

Module Resources and Dependencies

Series: Modular Project Architecture

22 minutes
Published on October 1, 2021

This video is only available to subscribers. Get access to this video and 510 others.

Now that we've seen how to setup a feature module, we'll also need to decide how best to share a feature's resources and deal with dependencies.

One things we'll likely have to do is support having images and other resources that can be used outside of the module that contains it. We will expose these resources to other modules by providing a public type that returns these resources.

We'll also implement a lightweight Dependencies struct that will hold a module's dependencies so the main app can pass along just what it needs and prevent it from requiring everything that the entire app depends on.

Further Reading

For much more information bout how resources are handled in Swift Package Manager, check out this excellent post by Keith Harrison.

icons in this episode were made by casscapello

This episode uses Swift 5.4, Xcode 12.5.