{"id":1700,"url":"https://github.com/rbaumbach/Swizzlean","last_synced_at":"2025-08-02T04:32:26.488Z","repository":{"id":8512162,"uuid":"10124393","full_name":"rbaumbach/Swizzlean","owner":"rbaumbach","description":"Swizzlean, an Objective-C Swizzle Helper Class.","archived":false,"fork":false,"pushed_at":"2022-11-08T04:45:49.000Z","size":5141,"stargazers_count":111,"open_issues_count":0,"forks_count":67,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-01T15:23:29.414Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://swizzlean.com","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbaumbach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-17T13:54:25.000Z","updated_at":"2024-08-05T11:08:44.000Z","dependencies_parsed_at":"2022-09-10T11:23:50.039Z","dependency_job_id":null,"html_url":"https://github.com/rbaumbach/Swizzlean","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbaumbach%2FSwizzlean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbaumbach%2FSwizzlean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbaumbach%2FSwizzlean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbaumbach%2FSwizzlean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbaumbach","download_url":"https://codeload.github.com/rbaumbach/Swizzlean/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228439110,"owners_count":17920018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:15:53.695Z","updated_at":"2024-12-06T08:31:31.904Z","avatar_url":"https://github.com/rbaumbach.png","language":"Objective-C","funding_links":[],"categories":["WebSocket","Objective-C Runtime"],"sub_categories":["Other free courses","Push Notification Providers","Local Notifications"],"readme":"# Swizzlean [![Bitrise](https://app.bitrise.io/app/805069fee450821d/status.svg?token=DSHtzhY3hCKTrW_H41JyIA\u0026branch=master)](https://app.bitrise.io/app/805069fee450821d) [![Cocoapod Version](https://img.shields.io/cocoapods/v/Swizzlean.svg)](https://cocoapods.org/pods/Swizzlean) [![Cocoapod Platform](http://img.shields.io/badge/platform-iOS-blue.svg)](http://cocoapods.org/?q=Swizzlean) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![License](https://img.shields.io/dub/l/vibe-d.svg)](https://github.com/rbaumbach/Swizzlean/blob/master/MIT-LICENSE.txt)\n\nA quick and \"lean\" way to swizzle methods for your Objective-C development needs.\n\n## Adding Swizzlean to your project\n\n### Cocoapods\n\n[CocoaPods](http://cocoapods.org) is the recommended way to add `Swizzlean` to your project.\n\n1.  Add Swizzlean to your Podfile `pod 'Swizzlean'`.\n2.  Install the pod(s) by running `pod install`.\n3.  Add Swizzlean to your files with `#import \u003cSwizzlean/Swizzlean.h\u003e`.\n\n### Swift Package Manager (SPM)\n\n[Swift Package Manager](https://swift.org/package-manager/) can be used to add `Swizzlean` the to your project:\n\n1.  Add `.package(url: \"https://github.com/rbaumbach/Swizzlean\", from: \"1.1.0\")`\n2.  [Follow intructions to add](https://swift.org/getting-started/#using-the-package-manager) the `Swizzlean` package to your project.\n\n### Carthage\n\nYou can also use [Carthage](https://github.com/Carthage/Carthage) to manually add the `Swizzlean` framework to your project.\n\n1. Add `github \"rbaumbach/Swizzlean\"` to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile).\n2. [Follow instructions to manually add](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) Swizzlean dynamic framework to your project.\n\n### Clone from Github\n\n1.  Clone repository from github and copy files directly, or add it as a git submodule.\n2.  Add Swizzlean and RuntimeUtils (.h and .m) files to your project.\n\n## How To\n\n* Create an instance of **Swizzlean** passing in the class of the methods you want to swizzle.\n* Call `swizzleInstanceMethod:withReplacementImplementation:` for an instance method passing\n  in the selector of the method to be swizzled with the replacement implementation.  When\n  passing in the replacement implementation block, the first parameter is always `id _self`\n  (pointer to the 'Class' being swizzled), and the followed by any other parameters for the\n  method being swizzled.\n* Call `swizzleClassMethod:withReplacementImplementation:` for a class method passing in\n  the selector of the method to be swizzled with the replacement implementation.\n* You can check the current instance/class method that is swizzled by using the\n  `currentInstanceMethodSwizzled` and `currentClassMethodSwizzled` methods.\n* The status of the swizzled methods can be seen by calling `isInstanceMethodSwizzled` and\n  `isClassMethodSwizzled`.\n* Use reset methods to unswizzle the instance/class methods that are currently being\n  swizzled.\n* Methods are automatically reset when the Swizzlean object is deallocated.  If you would like to\n  keep the methods swizzled after `dealloc` is called, set the property `resetWhenDeallocated = NO`.\n\n### Example Usage\n\n```objective-c\nSwizzlean *swizzle = [[Swizzlean alloc] initWithClassToSwizzle:[NSString class]];\n[swizzle swizzleInstanceMethod:@selector(intValue) withReplacementImplementation:^(id _self) {\n    return 42;\n}];\nNSString *number7 = @\"7\";\nNSLog(@\"The int value for number7 is: %d\", [number7 intValue]);\n// returns - The int value for number7 is: 42\n[swizzle resetSwizzledInstanceMethod];\nNSLog(@\"The int value for number7 is: %d\", [number7 intValue]);\n// returns - The int value for number7 is: 7\n```\n\n## Testing\n\n* Prerequisites: [ruby](https://github.com/sstephenson/rbenv), [ruby gems](https://rubygems.org/pages/download), [bundler](http://bundler.io)\n\nThis project has been setup to use [fastlane](https://fastlane.tools) to run the specs.\n\nFirst, run the `setup.sh` script to bundle required gems and `Cocoapods` when in the project directory:\n\n```bash\n$ ./setup.sh\n```\n\nAnd then use `fastlane` to run all the specs on the command line:\n\n```bash\n$ bundle exec fastlane specs\n```\n\n## Version History\n\nVersion history can be found [on releases page](https://github.com/rbaumbach/Swizzlean/releases).\n\n## Suggestions, requests, feedback and acknowledgements\n\nThanks for checking out `Swizzlean` for your swizzling needs.  Any feedback can be\ncan be sent to: \u003cgithub@ryan.codes\u003e.\n\nThanks to the following contributors for keeping `Swizzlean` Swizzletastic:\n[Erik Stromlund](https://github.com/estromlund) \u0026 [Aaron Koop](https://github.com/aaronkoop)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbaumbach%2FSwizzlean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbaumbach%2FSwizzlean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbaumbach%2FSwizzlean/lists"}