View NSResponder.h
@interface NSResponder
- (id)supplementalTargetForAction:(SEL)action sender:(id)sender NS_AVAILABLE_MAC(10_7);
@end
View actiondispatch.m
id target = [self targetForAction:@selector(myAction:) sender:self];
[target myAction:self];
View UIResponder.h
@interface UIResponder
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender;
- (id)targetForAction:(SEL)action withSender:(id)sender NS_AVAILABLE_IOS(7_0);
@end
@interface UIApplication
- (BOOL)sendAction:(SEL)action to:(id)target from:(id)sender forEvent:(UIEvent *)event;
@end
View NSResponder.h
@interface NSResponder
- (BOOL)tryToPerform:(SEL)anAction with:(id)anObject;
- (void)doCommandBySelector:(SEL)aSelector;
@end
@interface NSApplication
- (BOOL)sendAction:(SEL)theAction to:(id)theTarget from:(id)sender;
- (id)targetForAction:(SEL)theAction to:(id)theTarget from:(id)sender;
@end
View gist:d767d593bfbdf74913d3
- (void)disableVibrancyForPopover:(NSPopover *)popover {
NSAppearance *appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
popover.appearance = appearance;
}
View gist:af8be11f4aa1ac7b6234
- (NSURL *)URLFromWeblocFileData:(NSData *)data {
NSDictionary *dict = [NSPropertyListSerialization propertyListWithData:data
options:NSPropertyListImmutable
format:NULL
error:NULL];
NSString *urlString = dict[@"URL"];
return [NSURL URLWithString:urlString];
}
View gist:2a7e49d54b95826ddda9
- (void)viewDidLoad {
[super viewDidLoad];
for (NSViewController *aController in self.childViewControllers) {
if ([aController.view isDescendantOf:self.containerView]) {
self.contentViewController = aController;
}
}
}
View gist:f67640ffadb65cb13766
- (void)viewDidLoad {
[super viewDidLoad];
for (NSViewController *aController in self.childViewControllers) {
NSString *identifier = [aController identifier];
if ([identifier isEqualToString:@"master"]) {
self.masterViewController = aController;
}
else if ([identifier isEqualToString:@"detail"]) {
self.detailViewController = aController;
View gist:885231145a28dacbf964
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"contained"]) {
self.contentViewController = segue.destinationViewController;
}
}
View gist:365a450389bf88ade24c
- (void)windowDidLoad {
NSSplitViewController *splitViewController = (NSSplitViewController *)self.rootViewController;
self.masterViewController = (MyMasterViewController *)splitViewController.childViewControllers[0];
self.detailViewController = (MyDetailViewController *)splitViewController.detailViewControllers[1];
}