title: Swift inputAccessoryView override bug
body: <p>I'm experiencing a weird bug with the appearance of my <code>inputAccessoryView</code>. While in the middle of a transition, it appears like so:</p>
  
  <p><img src="https://i.stack.imgur.com/iNHcWl.png" alt="Mid-transition"></p>
  
  <p>After the transition, it appears as it should:</p>
  
  <p><img src="https://i.stack.imgur.com/c2VkOl.png" alt="enter image description here"></p>
  
  <p>I override the property like so:</p>
  
  <pre><code>    override var inputAccessoryView: UIView! {
      get {
          if composeView == nil {
              composeView = CommentComposeView(frame: CGRectMake(0, 0, 0, MinimumToolbarHeight - 0.5))
              self.setupSignals()
          }
  
          return composeView
      }
  }
  </code></pre>
  
  <p>I'm wondering if anyone can point out any obvious flaw in what I'm doing or provide some more information on how to ensure my view appears as it should, before, during, and after transitions.</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong>  </p>
  
  <p>Here's my <code>CommentComposeView</code>:</p>
  
  <pre><code>import UIKit
  
  class CommentComposeView: UIToolbar {
      var textView: SAMTextView!
      var sendButton: UIButton!
  
      private var didSetConstraints: Bool = false
  
      required init(coder aDecoder: NSCoder) {
          super.init(coder: aDecoder)
          self.initialize()
      }
  
      override init(frame: CGRect) {
          super.init(frame: frame)
          self.initialize()
      }
  
      private func initialize() {
          textView = SAMTextView(frame: CGRectZero)
          sendButton = UIButton.buttonWithType(.System) as UIButton
  
          self.barStyle = .Black
          self.translucent = true
  
          textView.backgroundColor = UIColor.presentOffWhite()
          textView.font = UIFont.presentLightMedium()
          textView.layer.borderWidth = 0.5
          textView.layer.cornerRadius = 5
          textView.placeholder = "Comment"
          textView.scrollsToTop = false
          textView.textContainerInset = UIEdgeInsetsMake(4, 3, 3, 3)
          textView.keyboardAppearance = .Dark
          textView.keyboardType = .Twitter
          self.addSubview(textView)
  
          sendButton = UIButton.buttonWithType(.System) as UIButton
          sendButton.enabled = false
          sendButton.titleLabel!.font = UIFont.presentBoldLarge()
          sendButton.setTitle("Send", forState: .Normal)
          sendButton.setTitleColor(UIColor.whiteColor(), forState: .Normal)
          sendButton.setTitleColor(UIColor.presentCyan(), forState: .Highlighted)
          sendButton.setTitleColor(UIColor.presentLightGray(), forState: .Disabled)
          sendButton.contentEdgeInsets = UIEdgeInsetsMake(6, 6, 6, 6)
          self.addSubview(sendButton)
  
          RAC(self.sendButton, "enabled") &lt;~ self.textView.rac_textSignal()
              .map { text in
                  return (text as NSString).length &gt; 0
          }
  
          textView.setTranslatesAutoresizingMaskIntoConstraints(false)
          sendButton.setTranslatesAutoresizingMaskIntoConstraints(false)
      }
  
      override func updateConstraints() {
          super.updateConstraints()
  
          if !didSetConstraints {
              // TODO: Replace raw constraints with a friendlier looking DSL
              self.addConstraint(
                  NSLayoutConstraint(item: textView, attribute: .Left, relatedBy: .Equal, toItem: self, attribute: .Left, multiplier: 1, constant: 8)
              )
  
              self.addConstraint(
                  NSLayoutConstraint(item: textView, attribute: .Top, relatedBy: .Equal, toItem: self, attribute: .Top, multiplier: 1, constant: 7.5)
              )
  
              self.addConstraint(
                  NSLayoutConstraint(item: textView, attribute: .Right, relatedBy: .Equal, toItem: sendButton, attribute: .Left, multiplier: 1, constant: -2)
              )
  
              self.addConstraint(
                  NSLayoutConstraint(item: textView, attribute: .Bottom, relatedBy: .Equal, toItem: self, attribute: .Bottom, multiplier: 1, constant: -8)
              )
  
              self.addConstraint(
                  NSLayoutConstraint(item: sendButton, attribute: .Right, relatedBy: .Equal, toItem: self, attribute: .Right, multiplier: 1, constant: 0)
              )
  
              self.addConstraint(
                  NSLayoutConstraint(item: sendButton, attribute: .Bottom, relatedBy: .Equal, toItem: self, attribute: .Bottom, multiplier: 1, constant: -4.5)
              )
          }
      }
  }
  </code></pre>