Guest User

Untitled

a guest
Mar 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. if([viewB superview]!=nil)
  2. NSLog(@"visible");
  3. else
  4. NSLog(@"not visible");
  5.  
  6. if([self.childView isDescendantOfView:self.parentView])
  7. {
  8. // The childView is contained in the parentView.
  9. }
  10.  
  11. // useful debugging method - send it a view and it will log all subviews
  12. // can be called from the debugger
  13. - (void) viewAllSubviews:(UIView *) topView Indent:(NSString *) indent {
  14. for (UIView * theView in [topView subviews]){
  15. NSLog(@"%@%@", indent, theView);
  16. if ([theView subviews] != nil)
  17. [self viewAllSubviews:theView Indent: [NSString stringWithFormat:@"%@ ",indent]];
  18. }
  19. }
  20.  
  21. if viewB.superview != nil{
  22. print("visible")
  23. }
  24. else{
  25. print("not visible")
  26. }
  27.  
  28. if selfView.isDescendant(of: self.parentView) {
  29. print("visible")
  30. }
  31. else{
  32. print("not visible")
  33. }
Add Comment
Please, Sign In to add comment