Skip to content

Jumpstart your next iOS project with this starter XCode project template showcasing Coordinators.

License

Notifications You must be signed in to change notification settings

tw-studio/CoordinatorStarter-XCodeProjectTemplate

Repository files navigation


Logo

Coordinator Starter, an XCode Project Template for iOS

Jumpstart your next iOS project with this starter XCode project template showcasing Coordinators.
Based on Andrey Panov's ApplicationCoordinator tutorial.
Includes full test coverage using Quick & Nimble, and swift-snapshot-testing.

Contents

  1. tl;dr
  2. About Coordinators
  3. Getting Started
  4. Usage
  5. Screenshots

tl;dr

This is a ready-to-go XCode project template based on AndreyPanov's ApplicationCoordinator tutorial, and adds:

  1. Code-based views
  2. Persistence
  3. Quick & Nimble specs with 87%+ code coverage
  4. Swift-snapshot-testing

Just clone the repo, run make install, then start a new XCode project with the newly available Coordinator Starter Application template.

About Coordinators

A lot has been written about Coordinators since the idea was introduced by Khanlou in 2015. They're a piece of the ongoing puzzle of structuring iOS app code in a way that, for one, fixes the otherwise hard to escape problem of massive view controllers. Coordinators refactor out a major responsibility, navigation between view controllers, into its own files.

AndreyPanov's ApplicationCoordinator example, the basis for this template and written for his tutorial write-ups Coordinators Essential Part I and Part II, also includes a Router, which further refactors out the responsibility of pushing, popping, presenting, dismissing, etc., view controllers on a nav stack.

To learn more about Coordinators, and especially the ideas behind this template, consider reading the README and above tutorial posts from the ApplicationCoordinator project, as well as:

  1. Khanlou's original The Coordinator and Coordinators Redux posts, and his later series on Advanced Coordinators.
  2. Paul Hudson's (hackingwithswift.com articles How to use the coordinator pattern in iOS apps and Advanced coordinators in iOS.

Getting Started

Prerequisites

  • XCode (tested with 12.5)

Installation

  1. Clone the repo
    git clone https://github.com/tw-space/CoordinatorStarter-XCodeProjectTemplate
  2. Run the Makefile
    make install
  3. Open XCode, create a new project, and choose the Coordinator Starter, newly listed under Application templates.

XCode New Project Template screenshot with Coordinator Starter in focus

  1. Optionally choose to:

    • Include Quick & Nimble specs
    • Include Snapshot Tests
  2. (Optional) Set up Quick and Nimble:

    1. File > Swift Packages > Add Package Dependency...
    2. Enter in https://github.com/Quick/Quick, then click Next
    3. Wait, then choose Version: Up to Next Major, then click Next
    4. Wait, then for the Target, make sure to choose PROJECTNAME-Specs, then click Finish
    5. Repeat step 1
    6. Enter in https://github.com/Quick/Nimble, then click Next
    7. Repeat step 3
    8. Repeat step 4
  3. (Optional) Set up swift-snapshot-testing

    1. File > Swift Packages > Add Package Dependency...
    2. Enter in either:
      1. https://github.com/tw-space/swift-snapshot-testing , which adds missing screen sizes
      2. https://github.com/pointfreeco/swift-snapshot-testing , the original, which will be better maintained
    3. Wait, then depending on step 2:
      1. For the first URL, make sure to choose Branch: Main, then click Next
      2. For the second URL, choose Version: Up to Next Major, then click Next
    4. Wait, then for the Target, make sure to choose PROJECTNAME-SnapshotTests, then click Finish

Uninstallation

Run make uninstall in the cloned directory.

Usage

Run the app, explore the project files, run the tests, run the snapshots (twice), and start coding!

Screenshots

Coordinator Starter Project Navigator screenshot Coordinator Starter Project Navigator screenshot Authentication screenshot

Items Tab screenshot Settings Tab screenshot

About

Jumpstart your next iOS project with this starter XCode project template showcasing Coordinators.

Resources

License

Stars

Watchers

Forks

Packages

No packages published