我收到一条警告,指出 init(name:float:)
已被 Swift3 弃用。有谁知道它被什么取代了?
问题出现在着色器中:
SKUniform(name: "size",
float:GLKVector3Make(
Float(self.frame.size.width),
Float(self.frame.size.height), 0)),
最佳答案
iOS 10 deprecates several APIs, including:
...
Several
SKUniform
symbols related to floating point values. Instead, use methods such asinitWithName:vectorFloat2:
anduniformWithName:matrixFloat2x2:
, as appropriate.
例如:
SKUniform(name: "size",
vectorFloat2:vector2(
Float(self.frame.size.width),
Float(self.frame.size.height)
))
关于swift - 什么替换了 init(name :float:) now that it has been deprecated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39550725/