This commit is contained in:
2025-11-17 20:26:39 +08:00
parent 005e3c7581
commit 26ef29ac4e
5 changed files with 10 additions and 8 deletions

View File

@@ -39,7 +39,6 @@ typedef NS_ENUM(NSInteger, KBGuideItemType) {
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor colorWithWhite:0.96 alpha:1.0];
// self.title = KBLocalized(@"使用引导");
[self.view addSubview:self.tableView];
[self.view addSubview:self.inputBar];

View File

@@ -30,7 +30,7 @@
[[AppleSignInManager shared] signInFromViewController:presenter completion:^(ASAuthorizationAppleIDCredential * _Nullable credential, NSError * _Nullable error) {
if (error) { if (completion) completion(NO, error); return; }
if (![credential isKindOfClass:[ASAuthorizationAppleIDCredential class]]) {
if (completion) completion(NO, [NSError errorWithDomain:@"KBLogin" code:-1 userInfo:@{NSLocalizedDescriptionKey: KBLocalized(@"无效的登录凭证")}]);
if (completion) completion(NO, [NSError errorWithDomain:@"KBLogin" code:-1 userInfo:@{NSLocalizedDescriptionKey: KBLocalized(@"Invalid login credential")}]);
return;
}
@@ -54,7 +54,7 @@
self.currentUser = user;
NSString *token = user.token ?: [self.class tokenFromResponseObject:jsonOrData];
if (token.length == 0) {
if (completion) completion(NO, [NSError errorWithDomain:@"KBLogin" code:-2 userInfo:@{NSLocalizedDescriptionKey: KBLocalized(@"未返回 token")}]);
if (completion) completion(NO, [NSError errorWithDomain:@"KBLogin" code:-2 userInfo:@{NSLocalizedDescriptionKey: KBLocalized(@"No token returned")}]);
return;
}
@@ -63,7 +63,7 @@
refreshToken:nil
expiryDate:nil
userIdentifier:cred.user];
if (completion) completion(ok, ok ? nil : [NSError errorWithDomain:@"KBLogin" code:-3 userInfo:@{NSLocalizedDescriptionKey: KBLocalized(@"保存登录态失败")}]);
if (completion) completion(ok, ok ? nil : [NSError errorWithDomain:@"KBLogin" code:-3 userInfo:@{NSLocalizedDescriptionKey: KBLocalized(@"Failed to save login state")}]);
}];
}];
}

View File

@@ -413,6 +413,7 @@ typedef NS_ENUM(NSInteger, KBSearchSection) {
_collectionView.backgroundColor = [UIColor whiteColor];
_collectionView.dataSource = self;
_collectionView.delegate = self;
_collectionView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
// cell & header
[_collectionView registerClass:KBTagCell.class forCellWithReuseIdentifier:kTagCellId];
[_collectionView registerClass:KBSkinCardCell.class forCellWithReuseIdentifier:kSkinCellId];