[swift-users] private vs. fileprivate on global declaration in Swift3?

Cao Jiannan frogcjn at 163.com
Wed Sep 28 02:16:33 CDT 2016


Should I use private or fileprivate to declare global variables/consts in Swift 3? e.g.

fileprivate let a = 1
fileprivate class SomeClass {
    fileprivate b = 0
}
Or 

private let a = 1
private class someClass {
    fileprivate b = 0
}

Thanks!
I think the Swift team should tell us which is better.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160928/3bdccf66/attachment.html>


More information about the swift-users mailing list