This commit is contained in:
2025-12-03 13:31:02 +08:00
parent 27aa723e7d
commit b87998549c
11 changed files with 104 additions and 12 deletions

View File

@@ -8,6 +8,7 @@
#import "KBLoginVC.h"
#import <AuthenticationServices/AuthenticationServices.h>
#import "KBLoginVM.h"
#import "AppDelegate.h"
@interface KBLoginVC () <UITextViewDelegate>
@@ -155,11 +156,18 @@
#pragma mark - Actions
- (void)onTapAppleLogin {
// Apple Sign-In
KBLOG(@"onTapAppleLogin");
[[KBLoginVM shared] signInWithAppleFromViewController:KB_CURRENT_NAV completion:^(BOOL success, NSError * _Nullable error) {
if (success) {
[KBHUD showInfo:KBLocalized(@"Signed in successfully")];
// TabBar
dispatch_async(dispatch_get_main_queue(), ^{
id<UIApplicationDelegate> appDelegate = UIApplication.sharedApplication.delegate;
if ([appDelegate respondsToSelector:@selector(setupRootVC)]) {
AppDelegate *delegate = (AppDelegate *)appDelegate;
[delegate setupRootVC];
}
});
} else {
NSString *msg = error.localizedDescription ?: KBLocalized(@"Sign-in failed");
[KBHUD showInfo:msg];