     override var annotationFrame: CGRect? {
         return annotation?.frame
     }
-
 
     // MARK: - Initializers
 

    }

    override public func draw(_ rect: CGRect) {
        tintColor.setFill()
        annotation?.strokeColor.setStroke()

        let path = annotation.flatMap(PathForDrawingBoxAnnotation)
        path?.fill()
        path?.stroke()
    }

    override public func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
        return annotation.flatMap(PathForPointInsideBoxAnnotation).map { $0.contains(point) } ?? false
    }


    // MARK: - AnnotationView


    }
}

private extension BoxAnnotationView {
    
    private static func path(forDrawing annotation: BoxAnnotation) -> UIBezierPath? {
        let frame = annotation.frame
        let strokeWidth = annotation.strokeWidth
        let borderWidth = annotation.borderWidth
        let cornerRadius = annotation.cornerRadius
        
        let outerBox = frame.insetBy(dx: strokeWidth, dy: strokeWidth)
        let innerBox = outerBox.insetBy(dx: borderWidth + strokeWidth, dy: borderWidth + strokeWidth)
        
        if min(innerBox.size.height, innerBox.size.width) < (borderWidth + strokeWidth) * 2.0 {
            return nil
        }
        
        if min(innerBox.size.height, innerBox.size.width) < cornerRadius * 2.5 {
            return nil
        }
        
        let firstPath = CGPath(roundedRect: innerBox, cornerWidth: cornerRadius, cornerHeight: cornerRadius, transform: nil)
        let secondPath = CGPath(copyByStroking: firstPath, transform: nil, lineWidth: borderWidth + strokeWidth, lineCap: .butt, lineJoin: .bevel, miterLimit: 100)
        
        guard let strokePath = secondPath else { return nil }
        
        let path = UIBezierPath(cgPath: strokePath)
        path.lineWidth = strokeWidth
        path.close()
        return path
    }
    
    private static func path(forPointInside annotation: BoxAnnotation) -> UIBezierPath? {
        let outsideStrokeWidth = annotation.borderWidth * 2.0
        
        return path(forDrawing: annotation)
            .flatMap { path in
                CGPath(copyByStroking: path.cgPath, transform: nil, lineWidth: outsideStrokeWidth, lineCap: .butt, lineJoin: .bevel, miterLimit: 0)
            }
            .map { path in
                UIBezierPath(cgPath: path)
        }
    }
}
