| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // MODataCache.m
- // MiMoLive
- //
- // Created by SuperC on 2023/10/15.
- //
- #define YY_CACHE_DEFAULT_NAME @"MiMoLiveCache" //YYCache使用的默认cacheName
- #import "MODataCache.h"
- @implementation MODataCache
- + (YYCache *)sharedYYCache
- {
- static YYCache *_cache = nil;
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^
- {
- _cache = [YYCache cacheWithName:YY_CACHE_DEFAULT_NAME];
- });
- return _cache;
- }
- - (void)setCacheDataWith:(NSString *)key AndValue:(CGFloat)value{
- if(key.length == 0){
- return;
- }
-
- NSString *keyStr = [NSString stringWithFormat:@"mimo_normal_key_%@",key];
- [[MODataCache sharedYYCache] setObject:@(value) forKey:keyStr];
-
- NSNumber *endNum = (NSNumber *)[[MODataCache sharedYYCache] objectForKey:@"mimo_normal_key"];
- CGFloat needValue = endNum ? endNum.floatValue : 0.55;
-
- BOOL isHave = NO;
- NSString *cachePath = (NSString *)[[MODataCache sharedYYCache] objectForKey:@"mimo_sticker"];
- if(cachePath.length > 0){
- if([cachePath isEqualToString:@"mo_cat.zip"] ||
- [cachePath isEqualToString:@"mo_bunny.zip"] ||
- [cachePath isEqualToString:@"mo_lingjie.zip"] ||
- [cachePath isEqualToString:@"mo_xed.zip"] ||
- [cachePath isEqualToString:@"mo_xhh.zip"]){
- isHave = YES;
- }
- }
-
-
- }
- @end
|