How do I create an importable module in Swift?

前端 未结 5 1412
遇见更好的自我
遇见更好的自我 2020-12-08 06:08

I have read through Apple\'s documentation for Swift and can find nothing about how to create modules or how to define class or stucture members as private or public.

5条回答
  •  再見小時候
    2020-12-08 06:52

    In Swift, "Modules" refers to Frameworks. Xcode now has a template for creating a framework project for both iOS and OS X.

    There is currently no way to declare methods or properties public / protected. If you would like to see this added as a feature, you can make a feature request on Apple's bug reporter. It should also be noted that Apple has stated that the language could change with each release of Xcode, so it is possible that member access levels could be added before the public release.

提交回复
热议问题