VuforiaSampleSwift
VuforiaSampleSwift copied to clipboard
Is it possible to work with this solution and Interface Builder?
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 !
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.
- Create view controller for UI elements using IB. (eg. viewControllerA)
- And adds container view to ViewControllerA (below UI elements). (eg. viewControllerA.containerView)
- Create view controller for Vuforia Scene. (eg. viewControllerB)
- Adds viewControllerB as child view controller to viewControllerA.
@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)