關於xcode沒升級,但使用了iOS11的新函式編譯不過解決

weixin_34365417發表於2017-10-19

解決:加個預編譯的巨集

無法編譯程式碼

if (@available(iOS 11, *)) {
        insets = self.safeAreaInsets;
    }

更改為

#ifdef __IPHONE_11_0
    if (@available(iOS 11, *)) {
        insets = self.safeAreaInsets;
    }
 #endif

相關文章