I'm trying to work wi开发者_运维问答th ARKit in order to enable Augmented Reality in one of my applications.
I'm able to add the ARViewController by doing this :
ParkingAppDelegate *appDelegate = (ParkingAppDelegate *)[[UIApplication sharedApplication] delegate];
arvc = [[ARViewController alloc] initWithDelegate:self];
//add the button to the view
[arvc.view addSubview:button];
[[appDelegate window] addSubview:arvc.view];
But I can't removing it and go back to my app ...
Do you have any ideas ?
Thanks
It should be similar to adding/removing controller & it's view.
I.e. you dispose the VC, but its' view is still keep by UIWindow.
- (void) hideController {
//[arvc willMoveToParentViewController:nil];
[arvc.view removeFromSuperview];
arvc = nil; //[arvc removeFromParentViewController];
}
精彩评论