这两天看书学习swift遇到一个问题:自定义了一个类,想在Playground里试验,于是在Playground里包含了该类,却怎么也引用不了:
后来看了书中自带的源码,才发现是要把自定义类里的代码拷贝到Playground里,这。。。。。。
书中是这么写的“Copy and paste the entirety ofOrderedDictionary.swiftinto the new playground.You have to do this because, sadly, the playground cannot “see” code in your appmodule. ”,我刚开理解错误,以为是要把swift文件放在Playground下,原来是要把代码拷贝到Playground里。