declare uiimage variable code example Example: how to set a image to null in swift imageView.image = nil