2017-12-02 118 views
0

enter image description here enter image description hereiOS的11和Objective-C警告进口的SWIFT 4.0

应用通过桥接-Header.h 现在我已经在Objective-C的导入文件中的错误有更新之前没有问题SWIFT 4.0通过:SWIFT 4.0; xCode 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; 
} 
+0

重新启动的XCode - 没有帮助。我不明白它为什么按照SWIFT规则对其进行格式化。也许这个问题是被认可的?也许我应该以某种方式将它标记为目标文件? – Oleksandr

回答

1

这与Swift没有任何关系。

随着错误消息状态,该物业的UIViewController automaticallyAdjustsScrollViewInsets已弃用的iOS 11.使用UIScrollView的contentInsetAdjustmentBehavior代替