   case BottomLeft = "bottomleft"
 }
 
-extension UIView {
+/// Clear the child views.
+private extension UIView {
   func clearChildViews(){
     subviews.forEach({ $0.removeFromSuperview() })
   }
 }
 
-extension UILabel {
+/// Update the font of the text and fit it's width.
+private extension UILabel {
   func changeFont(fontSize:CGFloat) {
     font = UIFont(name: "HelveticaNeue-Bold", size: fontSize)
     adjustsFontSizeToFitWidth = true

//  Copyright © 2016 Mukesh Thawani. All rights reserved.
//

import Foundation

@IBDesignable public class TriLabelView: UIView {
  
  private var length = CGFloat()
  private var newRect = CGRect()
  
  public var position:Position = .TopLeft {
    didSet {
      setNeedsDisplay()
    }
  }
  
  @available(*, unavailable, message="This property is reserved for IB. Use position instead")
  @IBInspectable public var positionName: String? {
    didSet {

    viewColor.setFill()
    trianglePath.fill()
    trianglePath.stroke()
    addLabelToView()
  }
  
  /// Add the label to the label view.
  private func addLabelToView() {
    self.clearChildViews()
    let (x, y, labelAngle,textWidth,textHeight) = getLabelPostion(newRect.width)
    let firstLabel = UILabel()
