If you haven't tried CodeRunner, you really ought to. It's basically a macOS app that lets you run code snippets in different languages, include Swift. It doesn't have the fancy features present in Swift Playgrounds and the text editor is quite rudimentary, but despite that, it is really fast to build and run Swift code, so for most built-in non-UI stuff, you can explore Swift code very quickly, e.g. if you wanted to build a
DateFormatter and want to experiment with various date formats.
It's really worth checking out. There's a free trial available.
PS: This is not a paid ad