MLKitBarcodeScanning फ़्रेमवर्क संदर्भ
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
BarcodeScanner
class BarcodeScanner : NSObject
बारकोड स्कैनर, जो किसी इमेज में बारकोड स्कैन करता है.
-
दिए गए विकल्पों के साथ बारकोड स्कैनर दिखाता है.
एलान
Swift
class func barcodeScanner(options: MLKBarcodeScannerOptions) -> Self
पैरामीटर
options
|
बारकोड स्कैनर कॉन्फ़िगरेशन वाले विकल्प.
|
रिटर्न वैल्यू
दिए गए विकल्पों के साथ कॉन्फ़िगर किया गया बारकोड स्कैनर.
-
डिफ़ॉल्ट विकल्पों वाला बारकोड स्कैनर दिखाता है.
एलान
Swift
class func barcodeScanner() -> Self
रिटर्न वैल्यू
डिफ़ॉल्ट विकल्पों के साथ कॉन्फ़िगर किया गया बारकोड स्कैनर.
-
उपलब्ध नहीं हैं. क्लास वाले तरीकों का इस्तेमाल करें.
-
बारकोड स्कैन करने के लिए दी गई इमेज को प्रोसेस करता है.
पैरामीटर
image
|
प्रोसेस करने के लिए इमेज.
|
completion
|
मुख्य सूची में बारकोड के स्कैन या गड़बड़ी के साथ वापस कॉल करने के लिए हैंडलर.
|
-
दी गई इमेज में बारकोड के नतीजे दिखाता है या कोई गड़बड़ी होने पर nil
दिखाता है. बारकोड स्कैन करने की सुविधा
कॉलिंग थ्रेड पर सिंक्रोनस रूप से की जाती है.
हमारा सुझाव है कि यूज़र इंटरफ़ेस (यूआई) को ब्लॉक होने से बचाने के लिए, इस तरीके को मुख्य थ्रेड से बाहर रखें. बतौर
नतीजे के तौर पर, अगर इस तरीके को मुख्य थ्रेड पर कॉल किया जाता है, तो NSException
दिखता है.
पैरामीटर
image
|
|
error
|
नतीजे पाने में कोई गड़बड़ी होने पर, गड़बड़ी का एक वैकल्पिक पैरामीटर अपने-आप भर जाता है.
|
रिटर्न वैल्यू
दी गई इमेज में बारकोड के नतीजों की कलेक्शन या कोई गड़बड़ी होने पर nil
.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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,[]]