Now you can learn and explore coding using Swift Playgrounds on Mac. Take advantage of the same great experimenting environment from iPad, updated with a unique Mac experience that includes a new sidebar, Touch Bar support, and code suggestions that provide additional help. You can even use the same playground file on both platforms. Swift Playgrounds is an easy way to try out new code for your app, then use that code for development in Xcode.View on the Mac App Store
Source