Post

Replies

Boosts

Views

Activity

Comment on Difference between private and fileprivate?
The info in the language reference does not explain what's the difference. It seems when used in file level private is same as fileprivate: class SandBoxVC: NSViewController { override func viewDidLoad() { super.viewDidLoad() print(aaaa, bbbb) // no compiler error here } } fileprivate let aaaa = 1234 private let bbbb = "bbbb" I almost believe this is an oversight bug in Swift compiler - private should not be used in file level.
Jul ’24