OpenGLView not working without storyboard

0 votes
asked Feb 22, 2020 by moeindevelop (160 points)
edited Feb 22, 2020 by moeindevelop

I have two projects, one is using storyboard and the other doesn't, Everything works fine in storyboard based project, camera loads, targets found but in the xib based project, OpenGLView doesnt show up and my app crashes! 

here is the code for my viewController:

import UIKit

class ScannerViewController: GLKViewController {
//    override func loadView() {
//        let glView = OpenGLView()
//        self.view = glView
//    }
    override func viewDidLoad() {
        // Do any additional setup after loading the view.
        if !easyar_CameraDevice.isAvailable() {
            print("Camera device not available")
        if !easyar_CloudRecognizer.isAvailable() {
            print("Cloud recognizer not available")
        let glView = self.view as! OpenGLView

    override func viewWillAppear(_ animated: Bool) {
        let glView = self.view as! OpenGLView
    override func viewWillDisappear(_ animated: Bool) {
        let gView = self.view as! OpenGLView
    override func willRotate(to toInterfaceOrientation: UIInterfaceOrientation, duration: TimeInterval) {
        super.willRotate(to: toInterfaceOrientation, duration: duration)
        let gView = self.view as! OpenGLView
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.


here is my log:

2020-02-22 17:54:32.620731+0330 Third eye[4805:1105596] Failed to bind EAGLDrawable: <CAEAGLLayer: 0x28072f5e0> to GL_RENDERBUFFER 1
2020-02-22 17:54:32.620888+0330 Third eye[4805:1105596] Failed to make complete framebuffer object 8cd6
2020-02-22 17:54:32.643522+0330 Third eye[4805:1105596] [MC] System group container for path is /private/var/containers/Shared/SystemGroup/
2020-02-22 17:54:32.646741+0330 Third eye[4805:1105596] [MC] Reading from public effective user settings.

Please log in or register to answer this question.

Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.