在Swift中使用未声明的类型'UIImage'

时间:2023-01-23 18:06:57

On using this function in swift and i am getting compiler error. Function is:

在swift中使用此函数,我收到编译器错误。功能是:

class func imageWithImage (imageToResize : UIImage, scaledToSize newSize : CGSize) {
    return imageToResize;
}

and the error are:

而错误是:

  1. Use of undeclared type 'UIImage'
  2. 使用未声明类型'UIImage'
  3. Use of undeclared type 'CGSize'
  4. 使用未声明类型'CGSize'

What's wrong with this..? what can i do to use UIImage in Swift..?

这有什么问题..?我怎么能在Swift中使用UIImage ..?

1 个解决方案

#1


69  

Did you add import UIKit to your file?

您是否在文件中添加了导入UIKit?

#1


69  

Did you add import UIKit to your file?

您是否在文件中添加了导入UIKit?