You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 16, 2022. It is now read-only.
Create custom class that inherits from ProcessingView
import ProcessingKit
classSampleView:ProcessingView{func setup(){
// The setup() function is run once, when the view instantiated.
}func draw(){
// Called directly after setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called.
}}
Create a SampleView instance
Create programmatically
lazy varsampleView:SampleView={letsampleView=SampleView(frame: frame)
sampleView.isUserInteractionEnabled =true // If you want to use touch events (default true)
return sampleView
}()
Use InterfaceBuilder
Add UIView to ViewController
Select UIView & Open Identity inspector
Set SampleView to Custom class field
Add outlet connection
@IBOutlet weak varsampleView:SampleView!overridefunc viewDidLoad(){
super.viewDidLoad()
sampleView.isUserInteractionEnabled =true // If you want to use touch events (default true)
}