Distinction between private and fileprivate top-level classes

巧了我就是萌 提交于 2019-12-20 03:14:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!