I encountered the same issue, but realized that even though it says "ViewController" is not in scope still if you go to the playground page and run, it would run playground just fine even with the error showing. I think this is some sort of bug of XCode.