应用的皮肤不能删除

This commit is contained in:
2026-02-28 21:23:38 +08:00
parent e619f48f93
commit 47291934a2
6 changed files with 20 additions and 16 deletions

View File

@@ -14,6 +14,7 @@
#import "KBMyVM.h"
#import "KBMyTheme.h"
#import "KBHUD.h"
#import "KBSkinManager.h"
static NSString * const kMySkinCellId = @"kMySkinCellId";
@@ -254,6 +255,25 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
return cell;
}
- (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.isEditingMode) {
KBMyTheme *theme = self.data[indexPath.item];
NSString *currentSkinId = [KBSkinManager shared].current.skinId;
// themeId NSString NSNumber
NSString *themeIdStr = nil;
if ([theme.themeId isKindOfClass:[NSString class]]) {
themeIdStr = theme.themeId;
} else if ([theme.themeId respondsToSelector:@selector(stringValue)]) {
themeIdStr = [(id)theme.themeId stringValue];
}
if (currentSkinId.length > 0 && themeIdStr.length > 0 && [themeIdStr isEqualToString:currentSkinId]) {
[KBHUD showInfo:KBLocalized(@"The skin in use cannot be deleted")];
return NO;
}
}
return YES;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (!self.isEditingMode) {
//

Binary file not shown.