     }
     
     // MARK: creating views
-    
     private func createLabel() -> UILabel {
         let label = UILabel()
         label.backgroundColor = UIColor.clearColor()

        return imageView
    }
    
    // MARK: size and frame calculation
    public override func sizeThatFits(size: CGSize) -> CGSize {
        let imageLocationAdjustment = imageLocationSizeAdjustment()
        let labelSize = calculateLabelSize()
        
        let height = labelSize.height + config.contentInsets.topAndBottom + imageLocationAdjustment.height
        let width = labelSize.width + config.contentInsets.leftAndRight + imageLocationAdjustment.width
        
        return CGSizeMake(width, height)
    }
    
    private func calculateLabelSize() -> CGSize {
        let imageLocationAdjustment = imageLocationSizeAdjustment()
        let screenSize = UIScreen.mainScreen().bounds
        let maxLabelWidth = screenSize.width - 2 * margin - config.contentInsets.leftAndRight - imageLocationAdjustment.width
        let size = config.font.sizeFor(message, constrain: CGSizeMake(maxLabelWidth, 0))
        
        return CGSizeMake(ceil(size.width), ceil(size.height))
    }
    
    private func imageLocationSizeAdjustment() -> CGSize {
        var widthAdjustment: CGFloat = 0
        var heightAdjustment: CGFloat = 0
        
        switch config.imageAlignment {
        case .Left, .Right:
            widthAdjustment = imageWithMarginsSize().width
        case .Top, .Bottom:
            heightAdjustment = imageWithMarginsSize().height
        }
        
        return CGSizeMake(widthAdjustment, heightAdjustment)
    }
    
    private func imageViewFrame() -> CGRect {
        var x: CGFloat = 0
        var y: CGFloat = 0
        var width: CGFloat = 0
        var height: CGFloat = 0

        let allInsets = config.contentInsets + config.imageMargins
        
        switch config.imageAlignment {

                return
            }
            
            messageLabel.frame = createLabelFrame()
            
            guard let _ = image else {
                return
            }
            
            imageView.frame = createImageViewFrame()
        }
    }
    
