title: IOS9 programmatically constraints for iphone and ipad
body: <p>In view controller i have created uitextfield programmatically. For this textField I would like to have the following constraints: 90 pixel from top, 50 pixel for height, 8 pixels from right and left sides for iphone devices (so the width is adjusted) and 400 pixel fixed width in case of ipad devices.</p>
  
  <p>Here is the part of my code where these constraints are specified:</p>
  
  <pre><code>text.topAnchor.constraint(equalTo: view.topAnchor, constant: 90).isActive = true
  text.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 8).isActive = true
  text.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -8).isActive = true
  text.heightAnchor.constraint(equalToConstant: 50).isActive = true
  </code></pre>
  
  <p>This code provide right result for iphone devices, however for ipad devices it is not what I want to get (the width of text field is adjusted). I understand that the block of code is not correct for ipad.</p>
  
  <p>My question is how can i set the constraints programmatically for iphone and ipad devices for the logics described above?</p>
  
  <p>I think the possible solution might be to check screen size width before setting constraints, but I don't know is it proper solution for this task. </p>