mirror of
				https://github.com/SoPat712/YTLitePlus.git
				synced 2025-10-31 12:54:13 -04:00 
			
		
		
		
	added files via upload
This commit is contained in:
		
							
								
								
									
										49
									
								
								Tweaks/FLEX/Utility/Runtime/Objc/Reflection/FLEXMethodBase.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								Tweaks/FLEX/Utility/Runtime/Objc/Reflection/FLEXMethodBase.m
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| // | ||||
| //  FLEXMethodBase.m | ||||
| //  FLEX | ||||
| // | ||||
| //  Derived from MirrorKit. | ||||
| //  Created by Tanner on 7/5/15. | ||||
| //  Copyright (c) 2020 FLEX Team. All rights reserved. | ||||
| // | ||||
|  | ||||
| #import "FLEXMethodBase.h" | ||||
|  | ||||
|  | ||||
| @implementation FLEXMethodBase | ||||
|  | ||||
| #pragma mark Initializers | ||||
|  | ||||
| + (instancetype)buildMethodNamed:(NSString *)name withTypes:(NSString *)typeEncoding implementation:(IMP)implementation { | ||||
|     return [[self alloc] initWithSelector:sel_registerName(name.UTF8String) types:typeEncoding imp:implementation]; | ||||
| } | ||||
|  | ||||
| - (id)initWithSelector:(SEL)selector types:(NSString *)types imp:(IMP)imp { | ||||
|     NSParameterAssert(selector); NSParameterAssert(types); NSParameterAssert(imp); | ||||
|      | ||||
|     self = [super init]; | ||||
|     if (self) { | ||||
|         _selector = selector; | ||||
|         _typeEncoding = types; | ||||
|         _implementation = imp; | ||||
|         _name = NSStringFromSelector(self.selector); | ||||
|     } | ||||
|      | ||||
|     return self; | ||||
| } | ||||
|  | ||||
| - (NSString *)selectorString { | ||||
|     return _name; | ||||
| } | ||||
|  | ||||
| #pragma mark Overrides | ||||
|  | ||||
| - (NSString *)description { | ||||
|     if (!_flex_description) { | ||||
|         _flex_description = [NSString stringWithFormat:@"%@ '%@'", _name, _typeEncoding]; | ||||
|     } | ||||
|  | ||||
|     return _flex_description; | ||||
| } | ||||
|  | ||||
| @end | ||||
		Reference in New Issue
	
	Block a user
	 Balackburn
					Balackburn