I have a view interface
which contains a subview touchWheel
. On clicking a minimise button on interface
I'd like to perform a transform & send the view to the bottom-right corner of my screen. The thing is that I want to "detach" the touchWheel
view & send it to the corner separately with the parent-view, interface
, following behind (& in fact fading out).
when I try this I encounter a problem. My animation works fine initially & touchWheel
is sent towards the bottom corner, as desired. When touchWheel
is about half-way to its destination I animate interface
so that it follows touchWheel
.
Once interface
starts animating it appears to control touchWheel
& touchWheel
changes course.
It seems that interface
still retains control of touchWheel
since it's its parent view.
- (void)hideInterfaceButtonClicked : (id) sender
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"RemoveGrey" object:self];
//Remove Views & transform
[touchWheel removeViews];
interfaceHidden = YES;
//Send Interface to corner
[UIView animateWithDuration:1.25
delay:0.0
options:UIViewAnimationCurveEaseIn
animations:^{
// Move to the right
CGAffineTransform translateInterface = CGAffineTransformMakeTranslation(437,200);
// Scale
CGAffineTransform scale = CGAffineTransformMakeScale(0.135,0.135);
// Apply them to the view
self.transform = CGAffineTransformConcat(scale, translateInterface);
self.alpha = 0.0;
} completion:^(BOOL finished) {
NSLog(@"Animation Has Stopped");
[[NSNotificationCenter defaultCenter] postNotificationName:@"hiddenInterfaceViewNeeded" object:self]; //after MoveView finishes
}];
}
Making touchWheel
subview of something other than interface
creates other problems which would complicate things further.
Any ideas how one might get around this issue? any tips greatly appreciated :)