效果展示
====================================================
实现步骤
STEP1、导入头文件
import Vision
STEP2、识别图片
var textLayers : [CAShapeLayer] = []
//VNDetectTextRectanglesRequest 这个不要写错!
let textDetectionRequest = VNDetectTextRectanglesRequest(completionHandler: {(request, error) in
guard let observations = request.results as? [VNTextObservation]
else { fatalError("unexpected result type from VNDetectTextRectanglesRequest") }
//把检测到的文字添加layer
textLayers = self.addShapesToText(forObservations: observat