Log in or register to post comments

How to add subview on preview

November 26, 2018 - 6:15pm #1

I have download the sample and I can see the preview view and can see the AR when detect the target.

Now, I want to add some subviews to the preview view, for example UILabels.

 

I just use ImageTargetsViewController and try to add UILabels on storyboard of Image Targets Scene, but unfortunately, nothing shown on the preview view.

Is my mistake? could you please give me some suggestion?

 

Regards,

Lu

How to add subview on preview

December 21, 2018 - 10:49am #2

The reason is failing is that viewWillAppear is called only once when a view appears (obviously) but webViewDidFinishLoad is called every time the webView finishes loading anything. So when you click on a link the method is called when the new page gets loaded. Note that there will not have been a matching call to viewWillAppear in that case. So you would be trying to remove a subview that isn't actually in the view hierarchy.

Log in or register to post comments