美文网首页swift
Swift playground support file ac

Swift playground support file ac

作者: partrick_li | 来源:发表于2015-05-14 09:08 被阅读0次

Swift playground support file accessibility

Playground卡顿问题

在 MacBook Air 上跑Xcode的Swift Playground,每次改代码,整个Playground文件就会成重新编译,经常会卡段。Xcode 6.3支持support code缓解这个问题,support code文件夹下的swift代码会预编译。因此把已经调试好的代码移到这里support code里,保持Playground简洁,就不会每次都卡住了。
不过这里要注意swift代码的accessbility,直接把Playground里的代码拷到support里有时编译会通不过,因为另一个file里代码的accessibility默认是internal的,因此要在Playground里使用support里的struct或class,得手动修改为public。

相关文章

网友评论

    本文标题:Swift playground support file ac

    本文链接:https://www.haomeiwen.com/subject/wzdqqttx.html