MLKitBarcodeScanning 프레임워크 참조
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
BarcodeScanner
class BarcodeScanner : NSObject
이미지의 바코드를 스캔하는 바코드 스캐너입니다.
-
지정된 옵션과 함께 바코드 스캐너를 반환합니다.
선언
Swift
class func barcodeScanner(options: MLKBarcodeScannerOptions) -> Self
반환 값
특정 옵션으로 구성된 바코드 스캐너입니다.
-
선언
Swift
class func barcodeScanner() -> Self
반환 값
기본 옵션으로 구성된 바코드 스캐너입니다.
-
사용할 수 없습니다. 클래스 메서드를 사용합니다.
-
바코드 스캔을 위해 제공된 이미지를 처리합니다.
매개변수
image
|
|
completion
|
스캔된 바코드 또는 오류가 있는 기본 대기열에서 콜백하는 핸들러입니다.
|
-
지정된 이미지의 바코드 결과를 반환하거나 오류가 발생한 경우 nil
를 반환합니다. 바코드 스캔
호출 스레드에서 동기식으로 수행됩니다.
UI 차단을 방지하려면 기본 스레드 외부에서 이 메서드를 호출하는 것이 좋습니다.
결과에서 이 메서드가 기본 스레드에서 호출되면 NSException
이 발생합니다.
매개변수
image
|
|
error
|
결과를 가져오는 중에 오류가 발생하면 채워지는 선택적 오류 매개변수입니다.
|
반환 값
주어진 이미지의 바코드 결과 또는 nil
(오류가 있는 경우)입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003e\u003ccode\u003eBarcodeScanner\u003c/code\u003e is a class used for scanning barcodes within images.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to create a scanner instance with custom or default options.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eprocess(_:)\u003c/code\u003e method asynchronously scans an image for barcodes and returns the results.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eresults(in:)\u003c/code\u003e method synchronously scans an image, but it should be called off the main thread to avoid blocking the UI.\u003c/p\u003e\n"]]],["The `BarcodeScanner` class scans barcodes within images. It offers two class methods, `barcodeScanner(options:)` and `barcodeScanner()`, to create instances, either with custom or default configuration options. The `process(_:)` method asynchronously scans an image for barcodes, returning an array of `MLKBarcode` objects. The method `results(in:)` synchronously returns barcode results in a given image. Note that attempting to use the main thread when invoking the method `results(in:)` will raise an error.\n"],null,[]]