Quote from The Swift Programming Language (Swift 3.1):
Custom initializers can be assigned an access level less than or equal to the type that they initialize. The only exception is for required initializers (as defined in Required Initializers). A required initializer must have the same access level as the class it belongs to.
If so, why does this code compile and work?
private class GoofyClass {
public init(mood: String) {}
public required init(isCrazy: Bool) {}
}
private let shock = GoofyClass(mood: "shocked")
private let crazy = GoofyClass(isCrazy: true)