Programming

Playground 에서 View Controller 사용하기

 2018. 6. 3. 00:30
반응형

https://stackoverflow.com/questions/43160615/how-to-setup-viewcontroller-in-playgrounds

import UIKit
import PlaygroundSupport 

class ViewController:UIViewController { 
    override func viewDidLoad() { 
        super.viewDidLoad() 
  }
} 

let viewController = ViewController() 
PlaygroundPage.current.liveView = viewController 
PlaygroundPage.current.needsIndefiniteExecution = true

live view 가 보이지 않는다면

View > Assistant Editor > Show Assistant Editor

를 통해 화면을 띄울 수 있다.

반응형
1 2 3 4 5 6 7 8 ··· 61