This commit is contained in:
2025-11-13 14:11:44 +08:00
parent bc261661ae
commit debbe2777b
28 changed files with 250 additions and 33 deletions

View File

@@ -37,7 +37,6 @@
//
KBShopVC *shop = [[KBShopVC alloc] init];
shop.title = @"商城";
BaseNavigationController *navShop = [[BaseNavigationController alloc] initWithRootViewController:shop];
navShop.tabBarItem = [self tabItemWithTitle:@"商城"
image:@"tab_shop"

View File

@@ -26,6 +26,11 @@ static NSString * const kKBAppleUserIdentifierKey = @"com.company.keyboard.apple
}
- (void)signInFromViewController:(UIViewController *)presenting completion:(KBAppleSignInCompletion)completion {
if (!NSThread.isMainThread) {
// 线 Unknown(1000)
dispatch_async(dispatch_get_main_queue(), ^{ [self signInFromViewController:presenting completion:completion]; });
return;
}
if (@available(iOS 13.0, *)) {
self.presentingVC = presenting;
self.completion = completion;
@@ -110,7 +115,21 @@ static NSString * const kKBAppleUserIdentifierKey = @"com.company.keyboard.apple
#pragma mark - (ASAuthorizationControllerPresentationContextProviding)
- (ASPresentationAnchor)presentationAnchorForAuthorizationController:(ASAuthorizationController *)controller API_AVAILABLE(ios(13.0)) {
return self.presentingVC.view.window ?: UIApplication.sharedApplication.keyWindow;
// VC window
UIWindow *win = self.presentingVC.view.window;
if (win) return win;
// iOS13+ scene keyWindow
for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) {
if (scene.activationState == UISceneActivationStateForegroundActive && [scene isKindOfClass:[UIWindowScene class]]) {
UIWindowScene *ws = (UIWindowScene *)scene;
for (UIWindow *w in ws.windows) { if (w.isKeyWindow) return w; }
if (ws.windows.firstObject) return ws.windows.firstObject;
}
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
return UIApplication.sharedApplication.keyWindow ?: UIApplication.sharedApplication.windows.firstObject;
#pragma clang diagnostic pop
}
#pragma mark - Keychain

View File

@@ -9,12 +9,11 @@
@implementation KBShopHeadView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
- (instancetype)initWithFrame:(CGRect)frame{
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor clearColor];
}
return self;
}
*/
@end

View File

@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface KBShopVC : UIViewController
@interface KBShopVC : BaseViewController
@end

View File

@@ -30,13 +30,21 @@ static const CGFloat JXheightForHeaderInSection = 50;
@property (nonatomic, strong) JXCategoryTitleView *categoryView;
@property (nonatomic, strong) NSArray <NSString *> *titles;
@property (nonatomic, strong) UIImageView *bgImageView; //
@end
@implementation KBShopVC
- (void)viewDidLoad {
[super viewDidLoad];
// [self setupUI];
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"my_bg_icon"]];
self.bgImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.view addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
[self setupUI];
}
@@ -90,6 +98,7 @@ static const CGFloat JXheightForHeaderInSection = 50;
_pagerView = [self preferredPagingView];
self.pagerView.mainTableView.gestureDelegate = self;
self.pagerView.mainTableView.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.pagerView];
// self.pagerView.listContainerView.scrollView.scrollEnabled = false;
@@ -119,7 +128,7 @@ static const CGFloat JXheightForHeaderInSection = 50;
self.naviBGView.frame = CGRectMake(0, 0, KB_SCREEN_WIDTH, KB_NAV_TOTAL_HEIGHT);
[self.view addSubview:self.naviBGView];
UILabel *naviTitleLabel = [[UILabel alloc] init];
naviTitleLabel.text = @"导航栏隐藏";
naviTitleLabel.text = @"商城";
naviTitleLabel.textAlignment = NSTextAlignmentCenter;
naviTitleLabel.frame = CGRectMake(0, KB_STATUSBAR_HEIGHT, self.view.bounds.size.width, 44);
[self.naviBGView addSubview:naviTitleLabel];