mirror of
				https://github.com/SoPat712/YTLitePlus.git
				synced 2025-10-31 12:54:13 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			906 B
		
	
	
	
		
			Objective-C
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			906 B
		
	
	
	
		
			Objective-C
		
	
	
	
	
	
| //
 | |
| //  FLEXNSStringShortcuts.m
 | |
| //  FLEX
 | |
| //
 | |
| //  Created by Tanner on 3/29/21.
 | |
| //
 | |
| 
 | |
| #import "FLEXNSStringShortcuts.h"
 | |
| #import "FLEXObjectExplorerFactory.h"
 | |
| #import "FLEXShortcut.h"
 | |
| 
 | |
| @implementation FLEXNSStringShortcuts
 | |
| 
 | |
| + (instancetype)forObject:(NSString *)string {
 | |
|     NSUInteger length = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
 | |
|     NSData *data = [NSData dataWithBytesNoCopy:(void *)string.UTF8String length:length freeWhenDone:NO];
 | |
|     
 | |
|     return [self forObject:string additionalRows:@[
 | |
|         [FLEXActionShortcut title:@"UTF-8 Data" subtitle:^NSString *(id _) {
 | |
|             return data.description;
 | |
|         } viewer:^UIViewController *(id _) {
 | |
|             return [FLEXObjectExplorerFactory explorerViewControllerForObject:data];
 | |
|         } accessoryType:^UITableViewCellAccessoryType(id _) {
 | |
|             return UITableViewCellAccessoryDisclosureIndicator;
 | |
|         }]
 | |
|     ]];
 | |
| }
 | |
| 
 | |
| @end
 | 
