title: iOS Swift Setting View Frame Position Programmatically
body: <p>I having two sub views inside scrollview. I need to position that both subviews programmatically. I did it correctly by writing code inside <code>DispatchQueue.main.async</code>. Here is the code:</p>
  <pre><code>DispatchQueue.main.async {
      self.SelectClientDetailView.frame = CGRect(x: 0, y: 637, width: self.SelectClientDetailView.frame.size.width, height: self.SelectClientDetailView.frame.size.height)
      self.SelectClientDetailView2.frame = CGRect(x: 0, y: 837, width: self.SelectClientDetailView2.frame.size.width, height: self.SelectClientDetailView2.frame.size.height)
  }
  </code></pre>
  <p>Its working good but when I scrolling my scrollview this both views set back to old positions. How to fix it. Its Default <code>y</code> position will be <code>SelectClientDetailView</code>:400 and <code>SelectClientDetailView2</code>: 600</p>