Can Swift playgrounds see other source files in the same project?

前端 未结 4 855
终归单人心
终归单人心 2020-12-29 02:00

I created the most simple custom class in a separate Swift file in my project:

class Foo
{
    init()
    {
        println(\"I made a foo.\")
    }
}
         


        
4条回答
  •  醉梦人生
    2020-12-29 02:05

    They cannot. Playgrounds are self-contained. This will hopefully change in the future.

    Edit: As of Xcode 6.3, Playgrounds can now contain supporting code. They still cannot see other code in the same project, but code can be added to the support folder of a Playground that can be used from within the playground. See the Swift blog for more info.

提交回复
热议问题