-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGYNotificationCenter.h
More file actions
54 lines (38 loc) · 1.61 KB
/
Copy pathGYNotificationCenter.h
File metadata and controls
54 lines (38 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// GYNotificationCenter.h
// WeRead
//
// Created by 王斌 on 16/7/4.
// Copyright © 2016年 tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GYNotificationOberverIdentifer.h"
@interface GYNotificationCenter : NSObject
+ (nullable instancetype)defaultCenter;
#pragma mark -- add observer
- (void)addObserver:(nonnull id)observer
name:(nonnull NSString *)aName
block:(nonnull GYNotificatioObserverBlock)block;
- (void)addObserver:(nonnull id)observer
name:(nonnull NSString *)aName
dispatchQueue:(nullable dispatch_queue_t)disPatchQueue
block:(nonnull GYNotificatioObserverBlock)block;
- (void)addObserver:(nonnull id)observer
name:(nonnull NSString *)aName
object:(nullable id)anObject
block:(nonnull GYNotificatioObserverBlock)block;
- (void)addObserver:(nonnull id)observer
name:(nonnull NSString *)aName
object:(nullable id)anObject
dispatchQueue:(nullable dispatch_queue_t)disPatchQueue
block:(nonnull GYNotificatioObserverBlock)block;
#pragma mark -- remove observer
- (void)removerObserver:(nonnull id)observer
name:(nonnull NSString *)anName
object:(nullable id)anObject;
- (void)removerObserver:(nonnull id)observer;
#pragma mark - post Notification
- (void)postNotification:(NSNotification *)notification;
- (void)postNotificationName:(NSString *)aName object:(nullable id)anObject;
- (void)postNotificationName:(NSString *)aName object:(nullable id)anObject userInfo:(nullable NSDictionary *)aUserInfo;
@end