1
wei
2021-01-21 62d098cb78296feaa6f786a20748921338db838c
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
55
56
57
58
59
60
61
62
63
64
65
//
//  TuyaSmartUtil.h
//  TuyaSmartBaseKit
//
//  Created by 高森 on 2018/6/20.
//
 
#ifndef TuyaSmartUtil_h
#define TuyaSmartUtil_h
 
#import <Foundation/Foundation.h>
 
#import "NSDate+TYSDKOffset.h"
#import "NSError+TYSDKDomain.h"
#import "NSNumber+TYSDKRandom.h"
#import "NSObject+TYSDKHex.h"
#import "NSObject+TYSDKJSON.h"
#import "NSObject+TYSDKURL.h"
#import "NSObject+TYSDKEncrypt.h"
#import "NSObject+TYSDKCategory.h"
#import "NSBundle+TYSDKLanguage.h"
#import "NSMutableDictionary+TYSDKCategory.h"
 
#import "TYSDKUtil.h"
#import "TYSDKDevice.h"
#import "TYSDKUserDefault.h"
#import "TYSDKSafeMutableArray.h"
#import "TYSDKSafeMutableDictionary.h"
#import "TYSDKNotification.h"
#import "TYSDKLogUtils.h"
#import "TYSDKFile.h"
#import "TYSDKLocalNetworkManager.h"
#if TARGET_OS_IOS
#import "TuyaSmartReachability.h"
#endif
 
#define TYSDK_SINGLETON \
+ (instancetype)sharedInstance;
 
#define TYSDK_DEF_SINGLETON \
+ (instancetype)sharedInstance { \
    static id instance; \
    static dispatch_once_t once; \
    dispatch_once(&once, ^{ \
        instance = [[self alloc] init]; \
    }); \
    return instance; \
}
 
#define WEAKSELF_TYSDK __weak __typeof(&*self)weakSelf_TYSDK = self;
 
typedef void (^TYSuccessHandler)(void);
typedef void (^TYSuccessDict)(NSDictionary *dict);
typedef void (^TYSuccessString)(NSString *result);
typedef void (^TYSuccessList)(NSArray *list);
typedef void (^TYSuccessBOOL)(BOOL result);
typedef void (^TYSuccessID)(id result);
typedef void (^TYSuccessInt)(int result);
typedef void (^TYSuccessLongLong)(long long result);
typedef void (^TYSuccessData)(NSData *data);
 
typedef void (^TYFailureHandler)(void);
typedef void (^TYFailureError)(NSError *error);
 
#endif /* TuyaSmartUtil_h */