Skip to content

Instantly share code, notes, and snippets.

@ramakser
Created March 14, 2016 16:04
Show Gist options
  • Save ramakser/89106ec2653413df2dcd to your computer and use it in GitHub Desktop.
Save ramakser/89106ec2653413df2dcd to your computer and use it in GitHub Desktop.
self.rootView = [self.window.subviews objectAtIndex:0];
if (!self.rootView) {
self.rootView = self;
while (self.rootView.superview != nil) {
self.rootView = self.rootView.superview;
}
}
- (void)willMoveToWindow:(UIWindow *)newWindow {
if(newWindow == nil){
//the view is being removed
[self stopAnimation];
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment