3
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user