Create new UIImage each time or once
There is no overhead in calling UIImage(named: ...) repeatedly,
because the UIKit framework already caches the image, as documented
in the UIImage(named:) reference: 


  This method looks in the system caches for an image object with the specified name and returns the variant of that image that is best suited for the main screen. If a matching image object is not already in the cache, this method locates and loads the image data from disk or from an available asset catalog, and then returns the resulting object.


So keep it simple and assign the image object where needed:

if self.isSecureTextEntry {
    imageView.image = UIImage(named: "eye.png")
} else {
    imageView.image = UIImage(named: "no_eye.png")
}


or shorter:

imageView.image = UIImage(named: isSecureTextEntry ? "eye.png" : "no_eye.png")


Note that self is not necessary to access instance members.

Or use image literals, a feature introduced in Xcode 8.
You can simply type the name of an image resource in the asset catalog. This will be autocompleted to #imageLiteral(resourceName: "&lt;name&gt;"), but displayed as the image itself



in the Xcode source editor.

This is useful to avoid typing errors in the image name, and to visually
check if the right image was chosen. You can even double-click on
the image icon and choose a different one.