blob: 3db4988ae0774a14bc3b1acb51669dd2bb3a39bf (
plain)
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
|
// SDLSubscribeButton.m
//
#import "SDLSubscribeButton.h"
#import "SDLButtonName.h"
#import "SDLNames.h"
@implementation SDLSubscribeButton
- (instancetype)init {
if (self = [super initWithName:NAMES_SubscribeButton]) {
}
return self;
}
- (instancetype)initWithHandler:(SDLRPCNotificationHandler)handler {
self = [self init];
if (!self) {
return nil;
}
_handler = handler;
return self;
}
- (instancetype)initWithDictionary:(NSMutableDictionary<NSString *, id> *)dict {
if (self = [super initWithDictionary:dict]) {
}
return self;
}
- (void)setButtonName:(SDLButtonName *)buttonName {
if (buttonName != nil) {
[parameters setObject:buttonName forKey:NAMES_buttonName];
} else {
[parameters removeObjectForKey:NAMES_buttonName];
}
}
- (SDLButtonName *)buttonName {
NSObject *obj = [parameters objectForKey:NAMES_buttonName];
if (obj == nil || [obj isKindOfClass:SDLButtonName.class]) {
return (SDLButtonName *)obj;
} else {
return [SDLButtonName valueOf:(NSString *)obj];
}
}
@end
|