I've added a sub view like this in the main view:
BTLPXYPad *XYPad = [[BTLPXYPad alloc] initWithFrame: CGRectMake (30, 10, 280, 460)];
[window addSubview:XYPad];
done all my bits that i need to and then removed it using this in the BTLPXYPad class:
[self removeFromSuperview];
What I need is to perform a task once it has gone. I know that with a UIViewController type class I could use viewDidDissapear but I can't seem to find the same thing for a UIView Type. Can anyone help please?
To know when you a view has actually been removed you could implement didMoveToSuperview
and check if the superview is now nil
- (void)didMoveToSuperview;
{
[super didMoveToSuperview];
if (!self.superview) {
NSLog(@"Removed from superview");
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With