How can I convert a Xcode Playground in Swift 3 to work with Xcode 9?

I made a big Swift Playground in Xcode 8 using Swift 3 and would like to make it work in Xcode 9 too. I tried to just run but availed me no success. Anyone having a solution please help...It works fine in Xcode 8 but when I do the same in Xcode 9 the spinner just spins resulting to nothing.


Thanks in Advance!

Replies

May be there is something XCode9 does not succeed in compiling.


I would advise :

- comment out all the playGround (in XCode8) and open in XCode9

- that should open !

- then uncomment progressively, half by half, until you notice a problem


Another approach would be :

- create a new playground in XCode9

- copy and paste from XCode8 playground

According to the Xcode 9 release notes:


"macOS playground execution may hang in the Running state with no results produced. This is more prevalent when changing pages. (32429211)

Workaround: Stop playground execution and rerun. If issue persists, close and reopen Xcode."


Also, playgrounds can sometimes be very slow to finish executing the first time, so make sure you wait long enough before you decide it's stuck.


If patience and retrying doing solve the problem, then follow Claude's advice of trying smaller amounts of code, to see if you can isolate the problem.

How can I commet it out? I am like a beginner, so i would appreciate if you could provide me with correct steps of commenting the program. By the time, I will try creating a new one in xcode 9 and copy and paste from xcode 8. Thanks!

Hi,

I tried doing what you suggested me to do. I opened the program Xcode 9 and just hit the run button. The program's name is Macintosh. This time I waited for about 4 minutes and the result was as follows:


Playground execution failed:

error: /var/folders/68/7k1zdk9j7c54p9d1mcvn6kmw0000gn/T/playground1-89f422..swift:3:8: error: no such module 'Macintosh_Sources'

import Macintosh_Sources

^

So what do I do next?

to comment a line out means adding // at the beginning of line so that it is considered as a comment by compiler.


you can also do it by clicking in the line and typing command-/


this his works if you select several lines and type command-/


retyping command-/ will delete the //

no solutions here above my reply works for me (period)

the running process occupies the CPU 100%, check your 'Activity Monitor'