nicklockwood / CubeController

CubeController is a UIViewController subclass that can be used to create a rotating 3D cube navigation.
Other
142 stars 20 forks source link

Possible to add CubeController as child viewcontroller? #4

Closed briomusic closed 10 years ago

briomusic commented 10 years ago

I am trying to create a semi-transparent cubecontroller in front of a fixed background image. To achieve this I am adding your cubecontroller as a child viewcontroller to my main view controller (as well as adding its view into my view hierarchy), like so: CubeController *cubeController = [[CubeController alloc] init]; cubeController.dataSource = self; [self addChildViewController:cubeController]; [self.view addSubview:cubeController.view];

This actually works (and looks amazing), apart from the fact that a 'ghost copy' of the first visible viewcontroller remains on screen. At the same time the actual view rotates as intended. Kinda hard to explain, so I am attaching a screenshot....

is there anything I can do to remove this ghost image? cubecontroller_as_childviewcontroller

nicklockwood commented 10 years ago

Is it possible that you've accidentally added more than one copy of the cube controller view to your superview?

Put a breakpoint in the code you posted and make sure it's not being executed more than once.

briomusic commented 10 years ago

Ouch - you are completely right of course. Red face and case closed :)