Who is this for?
Swift developers who have written code for more than one project, and want to set themselves up for success as they continue working on multiple different products.
- Setting up a Framework in Xcode
- Setting up a Package with Swift Package Manager
- Access control in Swift
- API-driven design
- Test-driven development
- Dependency Injection
Part 1: Introduce Your User
Understand The Issue
This episode will present the main issue of the course: you have three apps to write and you'll need code to use across all of them. How do you solve this?
Learn about the difference between static and dynamic libraries, and how Swift Packages provide an elegant solution.
Create a git repository and set up Xcode to develop your reusable framework.
Part 2: Consider Your User
Write Your First API
Write a unit test, then write your first reusable API and learn about what goes into it.
Understand how semantic versioning works and how to define and uphold an API contract to prospective developers.
Ship Your First API
Push your API to your git repository, and test it in a sample project, only to discover a fatal flaw.
Dive into the world of access control while considering a different methodology entirely.
Start thinking about how accessible and open your API is, and consider Murphy's and Hyrum's Law.
Rewrite your first API thinking about how open it truly is, and reuse your own code.
Tag another interation of your framework, and think about changes to the semantic version of your framework.
Part 3: Empower Your User
Handle Multiple APIs
Add encapsulation and namespacing to your framework to ensure that APIs never cross wires.
Build the beginning of your networking APIs, and come to the realization that you'll need to do some special testing.
Learn how to make your code more testable and resilient to multiple situations.
Learn how to inject a simulated mock network into your API tests.
Update your API's interface to handle this new methodology and make your tests pass while maintaining a developer-friendly interface.
Understand how generics help diversify your APIs to handle multiple scenarios.
Add a unit test to design your final API with a generic signature to handle a multitude of use cases.
Write code to make your final unit test pass with a generic function signature and a solid interface for other developers to use.