ios-template
ios-template copied to clipboard
Make default coordinators less opinionated
This is not an official change - it's just the opinion of @ZevEisenberg, @heyltsjay, @KingOfBrian, @nbonatsakis. Here's the version of Coordinator.swift from my latest project, but even this may be more than we need:
import Foundation
/// Coordinators inherit from `NSObject` because they often need to be made
/// delegates or message receivers.
protocol Coordinator: class, NSObjectProtocol { }
I may be missing something here, but what's the point of this protocol?
It's really just for expressing intent. Coordinators are usually delegates, and it's going to have to be a class so it can be weak
, and an NSObjectProtocol
so it can be various kinds of UIKit delegates. This just establishes all that up front, so you don't have to keep rediscovering it through compiler errors as you work. I like it in my project, but you can just not use it in yours. Totally fine if we just delete the file entirely, rather than changing it to something like this.
Pull Request in #75