3.0
In Swift 3 there are multiple access-levels. This example uses them all except for open:
public struct Car {
public let make: String
let model: String //Optional keyword: will automatically be "internal"
private let fullName: String
fileprivate var otherName...
struct Square {
private(set) var area = 0
var side: Int = 0 {
didSet {
area = side*side
}
}
}
public struct Square {
public private(set) var area = 0
public var side: Int = 0 {
didSet {
area = side*side
}
...