title: UISlider doesn't move when its parent UIView's location is set?
body: <p>I have a UIView called <code>volumeControlView</code> which gets created when this action is called:</p>
  
  <pre><code>@IBAction func toggleRainControl(_ sender: Any) {
      self.view.addSubview(volumeControlView)
      //volumeControlView.frame.origin = CGPoint(x: 0, y: -100)
      volumeControlView.layer.cornerRadius = 25
      volumeSlider.transform = CGAffineTransform(rotationAngle: CGFloat(-Double.pi/2))
  }
  </code></pre>
  
  <p>Inside of <code>volumeControlView</code> I have a UISlider called <code>volumeSlider</code>. It's supposed to adjust the volume of my rain sound effect when touched. When the user touches the <code>volumeSlider</code>, this action is called:</p>
  
  <pre><code>@IBAction func changeRainVolume(_ sender: UISlider) {
      let selectedValue = Double(sender.value)
      player.rainPlayer.volume = selectedValue
  }
  </code></pre>
  
  <p>This all works perfectly when the commented-out line in toggleRainControl() is commented out, but when I try to adjust the position of <code>volumeControlView</code> by uncommenting that line, it breaks the UISlider functionality and it no longer moves when the user touches it. What am I doing wrong?</p>
  
  <p>UPDATE:</p>
  
  <p>I updated toggleRainControl() to this:</p>
  
  <pre><code>@IBAction func toggleRainControl(_ sender: Any) {
      self.view.addSubview(volumeControlView)
      self.view.frame = CGRect(x: self.view.frame.origin.x, y: self.view.frame.origin.y - 100, width: self.view.frame.width, height: self.view.frame.height + 100)
      volumeControlView.layer.cornerRadius = 25
      volumeSlider.transform = CGAffineTransform(rotationAngle: CGFloat(-Double.pi/2))
  }
  </code></pre>
  
  <p>Here is what it looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/SKxuI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SKxuI.jpg" alt="The blue part is the frame of volumeControlView"></a></p>
  
  <p>The blue part is the frame of volumeControlView</p>