 
 private extension UIColor
 {
-   static func backgroundColorForPriority(priority: TaskPriority) -> UIColor
+   static func speechBubbleBackgroundColorForPriority(priority: TaskPriority) -> UIColor
    {
       switch priority
       {


class GoalieSpeechBubble: UIView
{
   var tailDirection: BubbleTailDirection = BubbleTailDirection.Left {
      didSet {
         setNeedsDisplay()

   private let _textLabel = UILabel()
   private var _currentPriority: TaskPriority = .Unknown
   
   private var _labelWidth: CGFloat {
      return _textLabel.bounds.width
   }
   
   // MARK: - Lifecycle
   override func awakeFromNib()
   {
      super.awakeFromNib()
      
      layer.masksToBounds = true
      backgroundColor = UIColor.clearColor()
      
      addSubview(_textLabel)
   }
   
   // MARK: - Public
   func updateWithText(text: String, priority: TaskPriority)
   {
      _currentPriority = priority
      _updateTextLabelWithText(text, priority: priority)
      setNeedsDisplay()
   }
   
   // MARK: - Private
   private func _updateTextLabelWithText(text: String, priority: TaskPriority)
   {
      _textLabel.attributedText = NSAttributedString.speechBubbleString(text)
      _textLabel.textColor = UIColor.textColorForPriority(priority)
      _textLabel.sizeToFit()
      
      self.widthConstraint?.constant = self._labelWidth + 25
   }
   
   private func _updateTextLabelPosition()
   {
      _textLabel.center = CGPoint(x: bounds.midX, y: bounds.midY - 5)
   }
   
   override func layoutSubviews()
   {
      super.layoutSubviews()
      _updateTextLabelPosition()
   }
   
   // MARK: - Drawing
   override func drawRect(rect: CGRect)
   {
      let color = UIColor.speechBubbleBackgroundColorForPriority(_currentPriority)
      GoalieSpeechBubbleKit.drawBubbleWithColor(color, tailDirection: tailDirection, inFrame: rect)
   }
}
