title: How to disable constraint at run time in ios?
body: <p>I am having a view which is further having some text fields.  I have set the aspect ratio of the view with self &amp; its super view.  Now when I click the text field then keyboard appears I am resizing the view &amp; setting its y position as well so that keyboard does not cover the textfields.  I am using below code for that.</p>
  
  <pre><code>- (void)textFieldDidBeginEditing:(UITextField *)textField
  {
      /* keyboard is visible, move views */
      if([textField isEqual:self.txt_twitter] || [textField isEqual:self.txt_linkedin])
      {
          [UIView animateWithDuration:0.1f animations:^
           {
               CGRect rect = self.view.frame;
  
               // 1. move the view's origin up so that the text field that will be hidden come above the keyboard
               // 2. increase the size of the view so that the area behind the keyboard is covered up.
               rect.origin.y -= 130;
              rect.size.height += 130;
               self.view.frame = rect;
  
  
  
           }];
      }
  
  }
  
  - (void)textFieldDidEndEditing:(UITextField *)textField
  {
  
      /* resign first responder, hide keyboard, move views */
      /* keyboard is visible, move views */
      if([textField isEqual:self.txt_twitter] || [textField isEqual:self.txt_linkedin])
      {
          [UIView animateWithDuration:0.1f animations:^
           {
               CGRect rect = self.view.frame;
  
               // revert back to the normal state.
               rect.origin.y += 130;
               rect.size.height -= 130;
  
  
               self.view.frame = rect;
  
  
           }];
  
      }
  
  }
  </code></pre>
  
  <p>Now when my view height increase then it's width also increase because I have set the constraints for that.  Please tell me how can I resolve this issue.  In this case I don't want to increase the width of my view.</p>