Skip to content

zekunyan/TTGKVOGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TTGKVOGuard

CI Status Version License Platform

What

Auto remove KVO observer from object after the object or the observer dealloc, base on TTGDeallocTaskHelper.

Requirements

iOS 6 and later.

Installation

TTGKVOGuard is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "TTGKVOGuard"

Usage

  1. TTGKVOGuard is default off, so you must turn it on first.
#import <TTGKVOGuard/NSObject+TTGKVOGuard.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Enable the TTGKVOGuard
    [NSObject ttg_setTTGKVOGuardEnable:YES];
    return YES;
}
  1. 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.

About

Auto remove KVO observer from object after it dealloc.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published