NSString+FLEX.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // NSString+FLEX.h
  3. // FLEX
  4. //
  5. // Created by Tanner on 3/26/17.
  6. // Copyright © 2017 Tanner Bennett. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "FLEXRuntimeUtility.h"
  10. @interface NSString (FLEXTypeEncoding)
  11. ///@return whether this type starts with the const specifier
  12. @property (nonatomic, readonly) BOOL flex_typeIsConst;
  13. /// @return the first char in the type encoding that is not the const specifier
  14. @property (nonatomic, readonly) FLEXTypeEncoding flex_firstNonConstType;
  15. /// @return whether this type is an objc object of any kind, even if it's const
  16. @property (nonatomic, readonly) BOOL flex_typeIsObjectOrClass;
  17. /// @return the class named in this type encoding if it is of the form \c @"MYClass"
  18. @property (nonatomic, readonly) Class flex_typeClass;
  19. /// Includes C strings and selectors as well as regular pointers
  20. @property (nonatomic, readonly) BOOL flex_typeIsNonObjcPointer;
  21. @end
  22. @interface NSString (KeyPaths)
  23. - (NSString *)stringByRemovingLastKeyPathComponent;
  24. - (NSString *)stringByReplacingLastKeyPathComponent:(NSString *)replacement;
  25. @end