Created
August 7, 2017 11:32
-
-
Save codePrincess/2a1f083402e59b8cae2d29aa44b0a3b4 to your computer and use it in GitHub Desktop.
playground structure for basic doodeling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//at the very top of the class | |
import Foundation | |
import UIKit | |
import PlaygroundSupport | |
public class MyDoodleCanvas { | |
... | |
} | |
//after the class implementation | |
var canvasView = UIView(frame: CGRect(x: 0, y: 0, width: 450, height: 630)) | |
var myCanvas = MyDoodleCanvas() | |
myCanvas.backgroundColor = .white | |
myCanvas.isUserInteractionEnabled = true | |
myCanvas.frame = canvasView.frame | |
canvasView.addSubview(myCanvas) | |
//most important: tell the playground what to display! | |
PlaygroundPage.current.liveView = canvasView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment