mirror of
https://github.com/SoPat712/YTLitePlus.git
synced 2025-08-25 03:48:51 -04:00
added files via upload
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// FLEXBlockShortcuts.m
|
||||
// FLEX
|
||||
//
|
||||
// Created by Tanner on 1/30/20.
|
||||
// Copyright © 2020 FLEX Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FLEXBlockShortcuts.h"
|
||||
#import "FLEXShortcut.h"
|
||||
#import "FLEXBlockDescription.h"
|
||||
#import "FLEXObjectExplorerFactory.h"
|
||||
|
||||
#pragma mark -
|
||||
@implementation FLEXBlockShortcuts
|
||||
|
||||
#pragma mark Overrides
|
||||
|
||||
+ (instancetype)forObject:(id)block {
|
||||
NSParameterAssert([block isKindOfClass:NSClassFromString(@"NSBlock")]);
|
||||
|
||||
FLEXBlockDescription *blockInfo = [FLEXBlockDescription describing:block];
|
||||
NSMethodSignature *signature = blockInfo.signature;
|
||||
NSArray *blockShortcutRows = @[blockInfo.summary];
|
||||
|
||||
if (signature) {
|
||||
blockShortcutRows = @[
|
||||
blockInfo.summary,
|
||||
blockInfo.sourceDeclaration,
|
||||
signature.debugDescription,
|
||||
[FLEXActionShortcut title:@"View Method Signature"
|
||||
subtitle:^NSString *(id block) {
|
||||
return signature.description ?: @"unsupported signature";
|
||||
}
|
||||
viewer:^UIViewController *(id block) {
|
||||
return [FLEXObjectExplorerFactory explorerViewControllerForObject:signature];
|
||||
}
|
||||
accessoryType:^UITableViewCellAccessoryType(id view) {
|
||||
if (signature) {
|
||||
return UITableViewCellAccessoryDisclosureIndicator;
|
||||
}
|
||||
return UITableViewCellAccessoryNone;
|
||||
}
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
return [self forObject:block additionalRows:blockShortcutRows];
|
||||
}
|
||||
|
||||
- (NSString *)title {
|
||||
return @"Metadata";
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfLines {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user