Let's examine our SecretProductDepartment class to see how the visibility matches our model:
internal class SecretProductDepartment { private var secretCodeWord = "Titan" private var secretProducts = ["iPhone 8", "Apple Car", "Apple Brain Implant", "Apple Spaceship"] func nextProduct(givenCodeWord codeWord: String) -> String? { let codeCorrect = codeWord == secretCodeWord return codeCorrect ? secretProducts.first : nil } }
The SecretProductDepartment class is declared without an access control keyword, and when no access control is specified, the default control of internal is applied. Since we want the secret product department to be visible within Apple, but not from outside Apple, this is the correct access ...