I will explain below how to set background color to UIimage while developing app for iOS.
Assumptions: I assume that you have already created Xcode project for iOS app development & you are using storyboards for developing the same. Also you have dragged UIimage View to your current ViewController.
Step 01: Now connect your UIimage View to your ViewController.swift file with code something like this
@IBOutlet weak var selectImage: UIImageView!
Step 02: Now in your desired function set your UIimage’s background color with following code using dot operator