什么取代了 init(name:float:) 现在它已被弃用

what replaces init(name:float:) now that it has been deprecated

我收到一条警告,指出 init(name:float:) 已被 Swift3 弃用。有谁知道它被什么取代了?

问题出现在着色器中:

SKUniform(name: "size", 
    float:GLKVector3Make(
        Float(self.frame.size.width), 
        Float(self.frame.size.height), 0)),

来自iOS 10 Release Notes

iOS 10 deprecates several APIs, including:

...

Several SKUniform symbols related to floating point values. Instead, use methods such as initWithName:vectorFloat2: and uniformWithName:matrixFloat2x2:, as appropriate.

例如:

SKUniform(name: "size", 
          vectorFloat2:vector2(
            Float(self.frame.size.width), 
            Float(self.frame.size.height)
          ))