Chapter 11: Factory Pattern. Typo in the playground example's code

In the example’s code:

// 2
public let senderEmail: String

In the description:

Here's what you're doing above:
2. Create a private property fo senderEmail. You set this property within the EmailFactory initializer.

I suppose, it should be private in the code. Also, we should implement init(senderEmail:) initializer.
Or we can just leave it public.

"Default Memberwise Initializers for Structure Types The default memberwise initializer for a structure type is considered private if any of the structure’s stored properties are private. Otherwise, the initializer has an access level of internal.

As with the default initializer above, if you want a public structure type to be initializable with a memberwise initializer when used in another module, you must provide a public memberwise initializer yourself as part of the type’s definition."

— from Access Control, The Swift Programming Language

Thanks for catching that! I’ll bookmark this for a fix in the next version :slight_smile: