Skip to content
This repository has been archived by the owner on Nov 1, 2017. It is now read-only.

Commit

Permalink
keep NSViewControllers in the responder chain
Browse files Browse the repository at this point in the history
  • Loading branch information
joshaber committed Jan 11, 2012
1 parent 0cd9401 commit 25a7e8c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/UIKit/TUINSView.m
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ - (void)setRootView:(TUIView *)v
}
}

- (void)setNextResponder:(NSResponder *)r
{
NSResponder *nextResponder = [self nextResponder];
if([nextResponder isKindOfClass:[NSViewController class]]) {
// keep view controller in chain
[nextResponder setNextResponder:r];
} else {
[super setNextResponder:r];
}
}

- (void)viewWillMoveToWindow:(NSWindow *)newWindow {
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResignKeyNotification object:self.window];

Expand Down

0 comments on commit 25a7e8c

Please sign in to comment.