ios - Why should the classes in the FrameWork must be public? -


i create framework using swift, , create test project check if framework goes well.

the framework has 2 classfile named "pubutils" , "utils".

in test project, can use public class pubutils. cannot use utils class, because cannot find it. , method in pubutils must public if want use them. donnot know apple design or make mistakes.

yes. classes/method public access level visible external world. restrict others using internal classes/methods. default access level internal means accessible within same target/module.private access level has little visibility. how access control mechanism in swift works.

in case, if want other source files use framework classes, make them public. each framework considered separate module.

read more about: access control


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -