Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zekunyan/ttgnotificationguard
Auto remove the observer from NSNotificationCenter after the oberser dealloc
https://github.com/zekunyan/ttgnotificationguard
guard ios notification objective-c
Last synced: 3 months ago
JSON representation
Auto remove the observer from NSNotificationCenter after the oberser dealloc
- Host: GitHub
- URL: https://github.com/zekunyan/ttgnotificationguard
- Owner: zekunyan
- License: mit
- Created: 2016-07-17T13:54:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-20T15:56:30.000Z (over 8 years ago)
- Last Synced: 2024-09-19T19:02:01.758Z (5 months ago)
- Topics: guard, ios, notification, objective-c
- Language: Shell
- Size: 37.1 KB
- Stars: 13
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TTGNotificationGuard
[![CI Status](http://img.shields.io/travis/zekunyan/TTGNotificationGuard.svg?style=flat)](https://travis-ci.org/zekunyan/TTGNotificationGuard)
[![Version](https://img.shields.io/cocoapods/v/TTGNotificationGuard.svg?style=flat)](http://cocoapods.org/pods/TTGNotificationGuard)
[![License](https://img.shields.io/cocoapods/l/TTGNotificationGuard.svg?style=flat)](http://cocoapods.org/pods/TTGNotificationGuard)
[![Platform](https://img.shields.io/cocoapods/p/TTGNotificationGuard.svg?style=flat)](http://cocoapods.org/pods/TTGNotificationGuard)## What
Auto remove the observer from NSNotificationCenter after the oberser dealloc, base on [TTGDeallocTaskHelper](https://github.com/zekunyan/TTGDeallocTaskHelper).## Requirements
iOS 6 and later.## Installation
TTGNotificationGuard is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "TTGNotificationGuard"
```## Usage
1. TTGNotificationGuard is default off, so you must turn it on first.
```
#import "NSNotificationCenter+TTGNotificationGuard.h"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Enable the TTGNotificationGuard
[NSNotificationCenter ttg_setTTGNotificationGuardEnable: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, [email protected]
## License
TTGNotificationGuard is available under the MIT license. See the LICENSE file for more info.