2

I am instantiating a playground live view using the following code:

import UIKit
import PlaygroundSupport

let view = UIView()
view.frame = CGRect(x: 0, y: 0, width: 100, height: 100)
view.backgroundColor = .white


PlaygroundPage.current.liveView = view

The live view that appears is stuck to the top of the screen and I can't change it's location by changing the x and y values of the frame. How do I get the view to move/center on my screen?

Photo of how it comes out:

Xcode Live View

Alladinian
  • 34,483
  • 6
  • 89
  • 91
omranK
  • 71
  • 5

0 Answers0