A playground's live view can be anything that conforms to PlaygroundLiveViewable. On iOS, both UIView and UIViewController conform to PlaygroundLiveViewable, as do their equivalents on macOS: NSView and NSViewController.
In the preceding code, we construct a BarChart, which is a UIView, and assign it to the liveView property of the current PlaygroundPage.
These live views respond to touch events just as they would in a macOS app or in the iOS simulator. Therefore, you can use them to test interactive views and controls.
Unfortunately, playgrounds do not currently support interface builder layout files, which are the .xibs and .storyboard files. Therefore, to use Playgrounds with your custom views, you will have to lay out your views programmatically.
Be aware that iOS-based playgrounds support many, but not all, of the frameworks available in the iOS SDK, so this may limit what you can do in a playground.