// We need to keep reference to controller as Objective-C will only keep weak reference here.
lateinitprivatevarcontroller:NSObject
actualfunattachTo(container:Any){
...
...
@@ -54,7 +55,8 @@ actual open class SkiaLayer(
}
funattachTo(view:UIView){
this.view=view
contextHandler=MetalContextHandler(this)
pictureRecorder=PictureRecorder()
// See https://developer.apple.com/documentation/uikit/touches_presses_and_gestures/using_responders_and_the_responder_chain_to_handle_events?language=objc
controller=object: NSObject(){
@ObjCAction
...
...
@@ -76,33 +78,48 @@ actual open class SkiaLayer(
}
// We have ':' in selector to take care of function argument.