无法将类型 'NSImageInterpolation.Type' 的值转换为预期的参数类型“[NSImageRep.HintKey : Any]?”
Cannot convert value of type 'NSImageInterpolation.Type' to expected argument type '[NSImageRep.HintKey : Any]?'
我想根据
添加图像插值提示
guard let representation = self.bestRepresentation(for: frame, context: nil,hints: NSImageInterpolation) else {
return nil
但我一直收到此异常
Cannot convert value of type 'NSImageInterpolation.Type' to expected argument type '[NSImageRep.HintKey : Any]?'
这个错误很容易解释。
guard let representation = self.bestRepresentation(for: frame,
context: nil,
hints: [.interpolation: NSImageInterpolation.high])
else { return nil }
我想根据
添加图像插值提示 guard let representation = self.bestRepresentation(for: frame, context: nil,hints: NSImageInterpolation) else {
return nil
但我一直收到此异常
Cannot convert value of type 'NSImageInterpolation.Type' to expected argument type '[NSImageRep.HintKey : Any]?'
这个错误很容易解释。
guard let representation = self.bestRepresentation(for: frame,
context: nil,
hints: [.interpolation: NSImageInterpolation.high])
else { return nil }