       }
     }
   }
-  
+
   override public func drawRect(rect: CGRect) {
     super.drawRect(rect)
     var arrow = UIBezierPath()

  private var sideEdge: CGFloat = 20.0
  private var popoverType: PopoverType = .Down
  private var blackOverlayColor: UIColor = UIColor(white: 0.0, alpha: 0.2)
  
  // custom closure
  private var didShowHandler: (() -> ())?
  private var didDismissHandler: (() -> ())?
  
  private var blackOverlay: UIControl = UIControl()
  private var containerView: UIView!
  private var contentView: UIView!
  private var contentViewFrame: CGRect!
  private var arrowShowPoint: CGPoint!
  
  public init() {
    super.init(frame: CGRectZero)
    self.backgroundColor = UIColor.clearColor()
  }
  
  public init(options: [PopoverOption]?) {
    super.init(frame: CGRectZero)
    self.backgroundColor = UIColor.clearColor()
    self.setOptions(options)
  }
  
  public init(showHandler: (() -> ())?, dismissHandler: (() -> ())?) {
    super.init(frame: CGRectZero)
    self.backgroundColor = UIColor.clearColor()
    self.didShowHandler = showHandler
    self.didDismissHandler = dismissHandler
  }
  
  public init(options: [PopoverOption]?, showHandler: (() -> ())?, dismissHandler: (() -> ())?) {
    super.init(frame: CGRectZero)
    self.backgroundColor = UIColor.clearColor()

      frame.origin.y = self.arrowShowPoint.y
      anchorPoint = CGPoint(x: arrowPoint.x / frame.size.width, y: 0)
    }

    var lastAnchor = self.layer.anchorPoint
    self.layer.anchorPoint = anchorPoint
    var x = self.layer.position.x + (anchorPoint.x - lastAnchor.x) * self.layer.bounds.size.width
