iink SDK on Device

Answered

[iOS] Ink not appearing

Hey... I have this issue, basically the writings aren't appearing. I did check using different background colors and both the EditorViewController's view and it's input view are in place, and the input view is receiving the touches.

Since I'm not using storyboards, I'm manually adding the view



 

txtField.editorView = [[EditorViewController alloc] init];
txtField.editorView.view.frame = CGRectMake(0, 0, 8000, 8000);
txtField.editorView.engine = [IinkManager sharedInstance].engine;
txtField.editorView.inputMode = InputModeForcePen;
[reactFieldView addSubview:txtField.editorView.view];

 



Any idea why may be causing this?


thanks in advance



Best Answer

Dear Felipe,


thank you for contacting us.


Currently, did you re-implement the UIReferenceImplementation?


Indeed, it seems like either the drawCaptureStrokes is not called in the ImageDrawer or in the RenderView.


Can you check in this way?


Best regards,


Olivier


Dear Gonzalo,


when implementing your DisplayViewController, are you setting your captureRenderView with a layerType IINKLayerTypeCapture:


self.captureRenderView.layerType = IINKLayerTypeCapture;


Let us know if this helps.


Best regards,


Olivier

Hi Olivier,

I'm running into the same problem where the ink does not show up (but the handwriting recognition output does when i write) but in Swift, my code is as follows. First, I create a container UIView:  

// create the container view w/ hardcoded constraints
        
        let containerView = UIView()
        containerView.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(containerView)
        NSLayoutConstraint.activate([
            containerView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 50),
            containerView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -50),
            containerView.topAnchor.constraint(equalTo: view.topAnchor, constant: 50),
            containerView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -50),
        ])

 I then create the EditorViewController within the container view:  

// create the editor view controller and add as child view controller view to container view
        
        let editorViewController: EditorViewController = EditorViewController.init()
        if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
            if (appDelegate.engine == nil)
            {
                let alert = UIAlertController(title: "Certificate error",
                                              message: appDelegate.engineErrorMessage,
                                              preferredStyle: UIAlertController.Style.alert)
                alert.addAction(UIAlertAction(title: "OK",
                                              style: UIAlertAction.Style.default,
                                              handler: {(action: UIAlertAction) -> Void in
                                                exit(1)
                }))
                self.present(alert, animated: true, completion: nil)
                return
            }
            editorViewController.engine = appDelegate.engine
        }
        
        editorViewController.inputMode = .forcePen  // lets the user use either its mouse or fingers to draw.
        // If you have got an iPad Pro with an Apple Pencil, please set this value to InputModeAuto for a better experience.
        
        addChild(editorViewController)
        editorViewController.view.translatesAutoresizingMaskIntoConstraints = false
        containerView.addSubview(editorViewController.view)
        
        NSLayoutConstraint.activate([
            editorViewController.view.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),
            editorViewController.view.trailingAnchor.constraint(equalTo: containerView.trailingAnchor),
            editorViewController.view.topAnchor.constraint(equalTo: containerView.topAnchor),
            editorViewController.view.bottomAnchor.constraint(equalTo: containerView.bottomAnchor)
        ])
        
        editorViewController.didMove(toParent: self)

It doesn't seem like I have to implement DisplayViewController, and looking at the .mm file it seems that  

self.captureRenderView.layerType = IINKLayerTypeCapture;

is already set when the DisplayViewController is created.


Any ideas on how to fix this? 

Best,

Felipe

 

Answer

Dear Felipe,


thank you for contacting us.


Currently, did you re-implement the UIReferenceImplementation?


Indeed, it seems like either the drawCaptureStrokes is not called in the ImageDrawer or in the RenderView.


Can you check in this way?


Best regards,


Olivier