title: How to animate a Custom View Right to Left and Left to Right using Swift
body: <p>I have designed a view. Normally when I click on a button, this view will Show and Hide. Now I am trying to animate that View with Left to right and right to left. Below is my code but it is not working. kindly check it.</p>
  
  <pre><code>if(self.openedView) {
          self.openedView = false;
          UIView.animate(withDuration: 0.3, delay: 0.0, options: .curveEaseIn, animations: {() -&gt; Void in
  
  
  
          }, completion: {(_ finished: Bool) -&gt; Void in
          })
  
           shareMainView.isHidden = true;
      } else {
           self.openedView = true;
          UIView.animate(withDuration: 0.3, delay: 0.0, options: .curveEaseOut, animations: {() -&gt; Void in
          }, completion: {(_ finished: Bool) -&gt; Void in
              /*done*/
          })
  
          shareMainView.isHidden = false;
      }
  </code></pre>
  
  <p><code>shareMainView.isHidden = false;</code> this is my view which will be opened and hidden with the animation.</p>