Use of undeclared type 'UIImage' in Swift

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

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

and the error are:

  1. Use of undeclared type 'UIImage'
  2. Use of undeclared type 'CGSize'

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


Did you add import UIKit to your file?

I have run on this issue when duplicated a framework target on swift. As a result and .h (that is umbrella[About] and is located in Build Phases -> Headers) were different(because it just copied from upstream target). The umbrella file contains #import <UIKit/UIKit.h>

  • Create <new_framework_target_name>.h and add #import <UIKit/UIKit.h> or
  • Rename Product Name (Build Settings) as upstream_framework_target_name.h

Need Your Help

How to run git commands on remote without having local repo

git tags branch export

I have a script called 'git-export' which helps me to export a remote repository. It is run like that:

Terminal in broken state (invisible text / no echo) after exit() during input() / raw_input()

python terminal python-3.x pyqt pyqt4

I've been writing a small utility application using Python 3 (the below testcase also works in Python 2, however) and PyQt 4 that uses the code module to spawn a REPL prompt allowing interaction wi...