NSObject(Swizzle) Category Reference

Declared in NSObject+Swizzle.h

Overview

Convenience methods to swizzle instance and class selectors on NSObject types.

+ classMethodExistsWithSelector:

Determines whether the class method exists with the given selector.

+ (BOOL)classMethodExistsWithSelector:(SEL)selector

Parameters

selector

The selector of the method.

Return Value

Whether or not the method exists.

Declared In

NSObject+Swizzle.h

+ methodExistsWithSelector:

Whether or not the instance method exists with the given selector.

+ (BOOL)methodExistsWithSelector:(SEL)selector

Parameters

selector

The selector of the method.

Return Value

Whether or not the method exists.

Declared In

NSObject+Swizzle.h

+ swizzleMethod:withMethod:

Swizzle an instance method with another.

+ (BOOL)swizzleMethod:(SEL)selectorA withMethod:(SEL)selectorB

Parameters

selectorA

A selector to describe the first method.

selectorB

A selector to describe the second method.

Return Value

Whether or not the operation was completed successfully.

Declared In

NSObject+Swizzle.h

+ swizzleClassMethod:withClassMethod:

Swizzle a class method with another.

+ (BOOL)swizzleClassMethod:(SEL)selectorA withClassMethod:(SEL)selectorB

Parameters

selectorA

A selector to describe the first method.

selectorB

A selector to describe the second method.

Return Value

Whether or not the operation was completed successfully.

Declared In

NSObject+Swizzle.h

+ copyMethodWithSelector:toSelector:

Copy an instance method to another.

+ (BOOL)copyMethodWithSelector:(SEL)selectorA toSelector:(SEL)selectorB

Parameters

selectorA

A selector to describe the first method.

selectorB

A selector to describe the second method.

Return Value

Whether or not the operation was completed successfully.

Declared In

NSObject+Swizzle.h

+ copyClassMethodWithSelector:toSelector:

Copy an class method to another.

+ (BOOL)copyClassMethodWithSelector:(SEL)selectorA toSelector:(SEL)selectorB

Parameters

selectorA

A selector to describe the first method.

selectorB

A selector to describe the second method.

Return Value

Whether or not the operation was completed successfully.

Declared In

NSObject+Swizzle.h

+ swizzleMethod:withMethod:error:

Swizzle an instance method with another.

+ (BOOL)swizzleMethod:(SEL)selectorA withMethod:(SEL)selectorB error:(NSError **)error

Parameters

selectorA

A selector to describe the first method.

selectorB

A selector to describe the second method.

error

The error if one occurs.

Return Value

Whether or not the operation was completed successfully.

Declared In

NSObject+Swizzle.h