VuforiaSampleSwift icon indicating copy to clipboard operation
VuforiaSampleSwift copied to clipboard

Is it possible to work with this solution and Interface Builder?

Open jarrillaga opened this issue 7 years ago • 2 comments

I want to use your solution because is great but it would be very usefull to use Interface Builder to add some fixed elements above the scene. I now that I can add them in the prepare() function of my ViewController but I really prefear to work in IB because of the AutoLayout constraints.

Is it possible to do use IB in a quick way or it is too hard to change this?

Thanks !

jarrillaga avatar Mar 31 '17 22:03 jarrillaga

Hi, @jarrillaga

You can use Interface Builder, but you can not add directly UI elements above the scene using IB. You may construct UI using IB like below.

  1. Create view controller for UI elements using IB. (eg. viewControllerA)
  2. And adds container view to ViewControllerA (below UI elements). (eg. viewControllerA.containerView)
  3. Create view controller for Vuforia Scene. (eg. viewControllerB)
  4. Adds viewControllerB as child view controller to viewControllerA.

yshrkt avatar Apr 01 '17 09:04 yshrkt

@yshrkt is right, add EAGLView as subView of ViewController's view and add sibling views(the view you want to add via IB) for EAGLView. Be sure the EAGLView is low hierarchy than the sibling views you add.

self.eaglView = manager.eaglView self.eaglView.frame = CGRect(origin: CGPoint.zero, size: UIScreen.main.bounds.size) self.view.insertSubview(eaglView, at: 0)

Meonardo avatar Aug 23 '17 16:08 Meonardo