FRZSwizzling

2.0.0

A method-swizzling that works.
Frizlab/FRZSwizzling

What's New

FRZSwizzling 2.0

2024-02-27T22:03:16Z

FRZSwizzling

Platforms SPM compatible License happn

A swizzling that works.

Installation

Either via SPM (recommended), or by copying NSObject+FRZSwizzling.{h,m} into your project.

Important Note

The repository does have an xcodeproj with a shared scheme for debug purposes. The project might be compatible with Carthage–or not. It is not officially supported but might work for you.

Usage

@import FRZSwizzling; /* If installed via SPM. */

@implementation NSView (MyViewAdditions)

static void MySetFrame(id self, SEL _cmd, CGRect frame);
static void (*OriginalSetFrame)(id self, SEL _cmd, CGRect frame);

static void MySetFrame(id self, SEL _cmd, CGRect frame) {
   // ***** CUSTOM WORK HERE *****
   OriginalSetFrame(self, _cmd, frame);
   // ***** OR HERE *****
}

+ (void)load
{
   FSZ_CHECKED_SWIZZLE(NSView, setFrame:, MySetFrame, OriginalSetFrame);
}

@end

Developers Notes

The include folder in the FRZSwizzling source code folder is there for SPM-compatibility. It contains a special FRZSwizzling.h umbrella header and a soft link to the other (public) header.

Credits

This project was originally created by François Lamboley while working at happn.

Description

  • Swift Tools 5.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Oct 21 2024 18:27:35 GMT-0900 (Hawaii-Aleutian Daylight Time)