iOS 开发交流

Xcode 10.1 更新

2018-11-26  本文已影响2538人  Mr__Peng__
概览

Xcode 10.1 包含SDK iOS 12.1 ,watchOS 5.1, macOS 10.14.1,tvOS 12.1. 支持调试iOS 8和更高版本,tvOS 9和更高版本,watchOS 2 和更高版本,需要Mac运行在macOS 10.13.6或更高版本

General(常规)
新功能

App StoreTestFlight不接受包含arm64e的提交。 提交上传到AppStore的时候,Xcode会删除arm64e内容。

解决问题
Apple Clang Compiler
解决问题
Asset Catalog
已知问题
解决问题
Build System
解决问题
Debugging
新功能
Devices
解决问题
Interface Builder
新功能
解决问题
Simulator
已知问题
Swift Compiler
已知问题
protocol SomeProtocol { }
class SomeClass: SomeProtocol { }

extension SomeProtocol {
    var someNonmutatingProperty: CGPoint {
        nonmutating set { _ = self }
        get { return .zero }
    }
}

// Might be miscompiled, deallocating SomeClass() too early.
SomeClass().someNonmutatingProperty.x = 42

解决方案: 将操作分解为多个语句,以便getset操作在不同的语句中发生:

let someObject = SomeClass()
// First get the nonmutating property value.
var temp = someObject.someNonmutatingProperty
temp.x = 42
// Then modify it.
someObject.someNonmutatingProperty = temp
解决问题
class A<B> {
    let function: (B) -> B
}
func takeFunction(_: (Int) -> Int) {}

func passFunction(from a: A<Int>) {
    takeFunction(a.function)
}
protocol Example {
    mutating func test() -> Self
}

func foo(x: inout Example) {
    _ = x.test() // No longer crashes the compiler sometimes.
}
func f(_: [AnyObject])

f([NSObject.self, NSString.self])
Swift Standard Library
解决问题
Source Control
解决问题
Testing
已知问题
解决问题
上一篇 下一篇

猜你喜欢

热点阅读