mirror of
https://github.com/Burrit0z/kai
synced 2025-07-04 14:36:47 +00:00
so close to beta 1
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
#import "KAIBatteryCell.h"
|
||||
|
||||
NSMutableArray *deviceInstances = [[NSMutableArray alloc] init];
|
||||
|
||||
@implementation KAIBatteryCell
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)arg1 device:(BCBatteryDevice *)device {
|
||||
@ -113,7 +111,6 @@ NSMutableArray *deviceInstances = [[NSMutableArray alloc] init];
|
||||
[self.battery.widthAnchor constraintEqualToConstant:20].active = YES;
|
||||
[self.battery.heightAnchor constraintEqualToConstant:10].active = YES;
|
||||
|
||||
[deviceInstances addObject:self];
|
||||
}
|
||||
|
||||
return self;
|
||||
@ -166,28 +163,4 @@ NSMutableArray *deviceInstances = [[NSMutableArray alloc] init];
|
||||
|
||||
}
|
||||
|
||||
+(instancetype)cellForDeviceIfExists:(BCBatteryDevice *)device frameToCreateNew:(CGRect)arg2 {
|
||||
KAIBatteryCell *foundCell;
|
||||
|
||||
//NSString *deviceName = MSHookIvar<NSString *>(device, "_name");
|
||||
|
||||
for(KAIBatteryCell *cell in deviceInstances) {
|
||||
if(cell.device == device || [cell.device.identifier isEqualToString:device.identifier]) {
|
||||
foundCell = cell;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(foundCell == nil) {
|
||||
foundCell = [[KAIBatteryCell alloc] initWithFrame:arg2 device:device];
|
||||
}
|
||||
|
||||
return foundCell;
|
||||
//return deviceInstances;
|
||||
}
|
||||
|
||||
+(void)resetArray {
|
||||
deviceInstances = [[NSMutableArray alloc] init];
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user