src/video/uikit/SDL_uikitview.m
changeset 12866 286fefb0209c
parent 12682 aec854f934db
child 12979 bbbb30026158
equal deleted inserted replaced
12865:a504364f02ee 12866:286fefb0209c
    77 #endif
    77 #endif
    78     }
    78     }
    79 
    79 
    80     return self;
    80     return self;
    81 }
    81 }
    82 
       
    83 - (void)layoutSubviews
       
    84 {
       
    85 	// Fix for touch ios.
       
    86 #if TARGET_OS_IOS
       
    87 	// on ios, a metal view gets added to our parent, and covers this for touch events.
       
    88 	// So set ourselves to user interact, and siblings false. johna
       
    89 	NSArray<UIView*>* subviews = [self.superview subviews];
       
    90 	for (int i=0; i<[subviews count]; i++)
       
    91 	{
       
    92 		UIView *view = [subviews objectAtIndex:i];
       
    93 		if (view == self) {
       
    94 			[view setUserInteractionEnabled:YES];  // set our user interaction to true.
       
    95 		} else {
       
    96 			[view setUserInteractionEnabled:NO];  // siblings to false.
       
    97 		}
       
    98 	}
       
    99 #endif
       
   100     [super layoutSubviews];
       
   101 }
       
   102 
       
   103 
    82 
   104 - (void)setSDLWindow:(SDL_Window *)window
    83 - (void)setSDLWindow:(SDL_Window *)window
   105 {
    84 {
   106     SDL_WindowData *data = nil;
    85     SDL_WindowData *data = nil;
   107 
    86