FLEXRuntimeUtility.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // FLEXRuntimeUtility.h
  3. // Flipboard
  4. //
  5. // Created by Ryan Olson on 6/8/14.
  6. // Copyright (c) 2014 Flipboard. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <objc/runtime.h>
  10. extern const unsigned int kFLEXNumberOfImplicitArgs;
  11. @interface FLEXRuntimeUtility : NSObject
  12. // Property Helpers
  13. + (NSString *)prettyNameForProperty:(objc_property_t)property;
  14. + (NSString *)typeEncodingForProperty:(objc_property_t)property;
  15. + (BOOL)isReadonlyProperty:(objc_property_t)property;
  16. + (SEL)setterSelectorForProperty:(objc_property_t)property;
  17. + (NSString *)fullDescriptionForProperty:(objc_property_t)property;
  18. + (id)valueForProperty:(objc_property_t)property onObject:(id)object;
  19. + (NSString *)descriptionForIvarOrPropertyValue:(id)value;
  20. // Ivar Helpers
  21. + (NSString *)prettyNameForIvar:(Ivar)ivar;
  22. + (id)valueForIvar:(Ivar)ivar onObject:(id)object;
  23. + (void)setIvar:(Ivar)ivar onObject:(id)object withInputString:(NSString *)inputString;
  24. // Method Helpers
  25. + (NSString *)prettyNameForMethod:(Method)method isClassMethod:(BOOL)isClassMethod;
  26. + (NSArray *)prettyArgumentComponentsForMethod:(Method)method;
  27. // Method Calling/Field Editing
  28. + (id)performSelector:(SEL)selector onObject:(id)object withArguments:(NSArray *)arguments error:(NSError * __autoreleasing *)error;
  29. + (NSString *)editiableDescriptionForObject:(id)object;
  30. + (id)objectValueFromEditableString:(NSString *)string;
  31. @end