问题
In Swift 3, what exactly is the difference in access control between
private class Foo { }
and
fileprivate class Bar { }
assuming both are top-level classes, that is, they are placed directly into a file rather than nested in some other construct?
回答1:
There is no difference in your case. The only time that fileprivate differs from private is inside a class, struct, or protocol.
来源:https://stackoverflow.com/questions/43054774/distinction-between-private-and-fileprivate-top-level-classes