https://github.com/halowang/wcretaincyclechecker
Check retain-cycle automatically when developing iOS app
https://github.com/halowang/wcretaincyclechecker
cocoapods ios objc-runtime objective-c retain-cycles
Last synced: 8 months ago
JSON representation
Check retain-cycle automatically when developing iOS app
- Host: GitHub
- URL: https://github.com/halowang/wcretaincyclechecker
- Owner: HaloWang
- License: mit
- Archived: true
- Created: 2017-02-17T03:30:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-08-16T07:08:10.000Z (almost 8 years ago)
- Last Synced: 2025-01-02T00:02:47.818Z (over 1 year ago)
- Topics: cocoapods, ios, objc-runtime, objective-c, retain-cycles
- Language: Objective-C
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WCRetainCycleChecker
**WCRetainCycleChecker** is a tool to check the retain-cycle between UIViewController subclass and proterties it retains.
🇨🇳 [中文](http://halowang.github.io/2017/02/21/WCRetainCycleChecker/)
## How it work?
WCRetainCycleChecker use method swizzling to change the implementation of `UIViewController.viewDidDisappear`.
## Installation
```ruby
pod 'WCRetainCycleChecker', :configurations => ['Debug']
```
Then:
```
cd YOUR_PODFILE_PATH && pod install
```
After finish it, WCRetainCycleChecker will effect in your project. If your UIViewController subclass has retain-cycle, WCRetainCycleChecker will warn you with following message:
```
Warning: still in memory after `-viewDidDisappear` (2s)
```
## More
You can also use [FBRetainCycleDetector](ttps://github.com/facebook/FBRetainCycleDetector) in `WCRetainCycleChecker.retainCycleFound` callback to get more infomation.
There is also a repo called [MLeaksFinder](https://github.com/Zepo/MLeaksFinder) which is more powerful than mine 👍.