#import <Foundation/Foundation.h>
Go to the source code of this file.
Classes | |
category | NSObject(FMS_Swizzler) |
FMSSwizzler's public methods. More... |
Typedefs | |
typedef enum pseudoPropertyType | FMSPseudoPropertyType |
typedef void(^ | FMSPseudoPropertyAdder )(NSString *propertyName) |
Enumerations | |
enum | pseudoPropertyType { FMSObjectRetain, FMSObjectCopy, FMSObjectAssignUnsafe, FMSBool, FMSInteger, FMSUnsignedInteger, FMSFloat, FMSDouble } |
The public interface for FMSSwizzler.
Note: I've tried to test and identify most of the obvious gotchas. However, by it's nature class and method swizzling is inherently unsafe. There may be additional edge cases that will cause errors. Please use these methods with care, and test your code thoroughly.
Note: to add the library to a project, first add the library to the target project, then set the project's Other Linker Flags build setting to -ObjC
. This will force the compiler to include the NSObject+FMSSwizzler
code.
You can either copy NSObject+FMSSwizzler.h
and the appropriate libFMSSwizzler_*.a file into the target project, or you can place both projects in a workspace. If the destination project and library share a workspace, make sure to add the following paths to the destination project's build settings.
For iOS: User Header Search Paths: "$OBJROOT/UninstalledProducts/include/"
For OSX: Header Search Paths: "$TARGET_BUILD_DIR/usr/local/include"
Then import the header as "FMSSwizzler/NSObject+FMSSwizzler.h"
typedef void(^ FMSPseudoPropertyAdder)(NSString *propertyName) |
A block that can add a property of the given property name to its class. You should generate an FMSPseudoPropertyAdder block for each class, and for each property type.
typedef enum pseudoPropertyType FMSPseudoPropertyType |
Used to identify the property type for dynamically added pseudo-properties
enum pseudoPropertyType |
Used to set the property type for dynamicly added pseudo-properties. All properties are nonatomic.