gpt4 book ai didi

SWIFT 4.0 中导入的 iOS 11 和 Objective-C 警告

转载 作者:行者123 更新时间:2023-11-29 00:07:33 25 4
gpt4 key购买 nike

enter image description here enter image description here

应用程序在通过 Bridging-Header.h 更新到 SWIFT 4.0 之前没有问题现在我通过SWIFT 4.0导入的Objective-C文件出错了;代码9.1。

我在这里问与大多数人类似的问题的唯一原因 - 所有其他答案都是关于 SWIFT 的。此错误位于 OBJECTIVE-C 文件中。这并不重要,程序运行得很好,但如何修复错误(不是隐藏)。

#pragma mark Containment view controller deployment and transition

// Containment Deploy method. Returns a block to be invoked at the
// animation completion, or right after return in case of non-animated deployment.
- (void (^)(void))_deployForViewController:(UIViewController*)controller inView:(UIView*)view
{
if ( !controller || !view )
return ^(void){};

CGRect frame = view.bounds;

UIView *controllerView = controller.view;
controllerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
controllerView.frame = frame;

if ( [controllerView isKindOfClass:[UIScrollView class]] )
{
BOOL adjust = controller.automaticallyAdjustsScrollViewInsets;

if ( adjust )
{
[(id)controllerView setContentInset:UIEdgeInsetsMake(statusBarAdjustment(_contentView), 0, 0, 0)];
}
}

[view addSubview:controllerView];

void (^completionBlock)(void) = ^(void)
{
// nothing to do on completion at this stage
};

return completionBlock;
}

最佳答案

这与 Swift 无关。

正如错误消息所述,UIViewController 属性 automaticallyAdjustsScrollViewInsets 在 iOS 11 中已被弃用。请改用 UIScrollView 的 contentInsetAdjustmentBehavior

关于SWIFT 4.0 中导入的 iOS 11 和 Objective-C 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47612003/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com