title: Using a Variable to refer to an Image IBOutlet and changing the Image
body: <p>thanks for taking the time to read this.</p>
  
  <pre><code>class InterfaceController: WKInterfaceController {
  
  var sliderValue:Int = 0
  var imageName: String = ""
  
  @IBOutlet weak var im1: WKInterfaceImage!
  @IBOutlet weak var im2: WKInterfaceImage!
  
  
  @IBAction func sliderAction(value: Float) {
  
      sliderValue = Int(value)
      imageName = "im\(sliderValue)"   
  }
  
  
  @IBAction func button() {
  imageName.setImageNamed(sliderValue)
  }
  </code></pre>
  
  <p>The problem: I want to use the variable     imageName and use it as the name of the IBOutlet (so it imageName is either im1 or im2). So basically this is what i want (but doesnt work obviously):</p>
  
  <pre><code>imageName.setImageNamed(sliderValue)
  </code></pre>
  
  <p>How to make that possible?</p>
  
  <p>Best regards and many thanks for any help!!</p>