https://github.com/zekunyan/ttgkvoguard
Auto remove KVO observer from object after it dealloc.
https://github.com/zekunyan/ttgkvoguard
guard ios kvo objective-c
Last synced: 5 months ago
JSON representation
Auto remove KVO observer from object after it dealloc.
- Host: GitHub
- URL: https://github.com/zekunyan/ttgkvoguard
- Owner: zekunyan
- License: mit
- Created: 2016-08-01T16:17:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-02T17:18:48.000Z (over 9 years ago)
- Last Synced: 2025-03-13T19:47:02.889Z (9 months ago)
- Topics: guard, ios, kvo, objective-c
- Language: Objective-C
- Size: 24.4 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TTGKVOGuard
[](https://travis-ci.org/zekunyan/TTGKVOGuard)
[](http://cocoapods.org/pods/TTGKVOGuard)
[](http://cocoapods.org/pods/TTGKVOGuard)
[](http://cocoapods.org/pods/TTGKVOGuard)
## What
Auto remove KVO observer from object after the object or the observer dealloc, base on [TTGDeallocTaskHelper](https://github.com/zekunyan/TTGDeallocTaskHelper).
## Requirements
iOS 6 and later.
## Installation
TTGKVOGuard is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "TTGKVOGuard"
```
## Usage
1. TTGKVOGuard is default off, so you must turn it on first.
```
#import
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Enable the TTGKVOGuard
[NSObject ttg_setTTGKVOGuardEnable:YES];
return YES;
}
```
2. No more need to do. Just start coding as usual :)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Author
zekunyan, zekunyan@163.com
## License
TTGKVOGuard is available under the MIT license. See the LICENSE file for more info.