title: How to change iOS 8 custom keyboard height with Swift?
body: <p>I'm making a custom keyboard for iOS 8 using Swift. I'm extremely new to iOS development and I've been unable to solve this problem on my own. In the App Extension Programming documents online Apple said that you can change the height of any custom keyboard after it has been launched. They provided an example in Objective-C but I'm using Swift and so far, I can't seem to find a Swift version of the code.</p>
  
  <p>Can someone convert the 3 lines of code into Swift or show me a way to change the height of the keyboard please?</p>
  
  <p>Here's the webpage with the code:
  <a href="https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html" rel="nofollow">https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html</a></p>
  
  <p>And here's the lines of code:</p>
  
  <pre><code>CGFloat _expandedHeight = 500;
  NSLayoutConstraint *_heightConstraint = 
  [NSLayoutConstraint constraintWithItem: self.view 
      attribute: NSLayoutAttributeHeight 
      relatedBy: NSLayoutRelationEqual 
      toItem: nil 
      attribute: NSLayoutAttributeNotAnAttribute 
      multiplier: 0.0 
      constant: _expandedHeight];
  [self.view addConstraint: _heightConstraint];
  </code></pre>