Skip to content

Commit

Permalink
[SDL] ios Touch Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed May 14, 2019
1 parent ba0fc92 commit 59da5b7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/video/uikit/SDL_uikitwindow.m
Expand Up @@ -67,6 +67,20 @@ - (void)layoutSubviews;

@implementation SDL_uikitwindow

- (void)didAddSubview:(UIView *)subview
{
[super didAddSubview:subview];
// We need to pach the enabled state in subviews as a Metal view gets added and covers up the SDL_uikitview that handles touch.
// So set needs layout so that the layout gets done (which is where we patch the flags) Johna.
NSArray<UIView*>* subviews = self.subviews;
for (int i=0; i<[subviews count]; i++)
{
UIView *view = [subviews objectAtIndex:i];
// NSLog( @"View %p enabled %d\n", view, view.userInteractionEnabled );
[view setNeedsLayout]; // force the subviews to layout.
}
}

- (void)layoutSubviews
{
/* Workaround to fix window orientation issues in iOS 8+. */
Expand Down

0 comments on commit 59da5b7

Please sign in to comment.