Skip to content

Commit

Permalink
Updated projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ci-bot committed Feb 21, 2024
1 parent 26333e8 commit 8c34256
Show file tree
Hide file tree
Showing 59 changed files with 1,409 additions and 302 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
Pods/
Podfile.lock
xcuserdata/
db.dat
regula.license
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -12,6 +12,7 @@
8680540A275A3DB00036B3AF /* DocumentReaderService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86805409275A3DB00036B3AF /* DocumentReaderService.swift */; };
868341E726F0C11B00644618 /* DocFormat+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 868341E626F0C11B00644618 /* DocFormat+Extensions.swift */; };
86878F0626EF96360082F481 /* NSObject+ClassName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86878F0526EF96360082F481 /* NSObject+ClassName.swift */; };
96760D3E2B850A3B00475CB7 /* db.dat in Resources */ = {isa = PBXBuildFile; fileRef = 96760D3D2B850A3B00475CB7 /* db.dat */; };
9D00FDD225D2E3DA00D6FEF1 /* BarcodeTypes+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D00FDD125D2E3DA00D6FEF1 /* BarcodeTypes+Extensions.swift */; };
9D00FDD525D3C34300D6FEF1 /* BarcodeListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D00FDD425D3C34300D6FEF1 /* BarcodeListViewController.swift */; };
9D053B6F25CD6D770014EE23 /* FieldType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D053B6E25CD6D770014EE23 /* FieldType+Extensions.swift */; };
Expand Down Expand Up @@ -53,6 +54,8 @@
9DA9A410283693DC0063B00E /* layer.json in Resources */ = {isa = PBXBuildFile; fileRef = 9DA9A40F283693DC0063B00E /* layer.json */; };
9DA9A413283780450063B00E /* CustomUIModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DA9A412283780450063B00E /* CustomUIModels.swift */; };
9DC45D3025D692AC0077AE4A /* DocReaderFrame+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DC45D2F25D692AC0077AE4A /* DocReaderFrame+Extensions.swift */; };
9DE55FA92B4FED40003ECE9F /* CheckResultCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DE55FA72B4FED40003ECE9F /* CheckResultCell.swift */; };
9DE55FAA2B4FED40003ECE9F /* CheckResultCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9DE55FA82B4FED40003ECE9F /* CheckResultCell.xib */; };
9DF08E5225D3C9C700880F7E /* SettingsActionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF08E5025D3C9C700880F7E /* SettingsActionCell.swift */; };
9DF08E5325D3C9C700880F7E /* SettingsActionCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9DF08E5125D3C9C700880F7E /* SettingsActionCell.xib */; };
9DF08E5C25D3F84B00880F7E /* TextFieldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF08E5B25D3F84B00880F7E /* TextFieldViewController.swift */; };
Expand Down Expand Up @@ -83,6 +86,7 @@
86805409275A3DB00036B3AF /* DocumentReaderService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentReaderService.swift; sourceTree = "<group>"; };
868341E626F0C11B00644618 /* DocFormat+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DocFormat+Extensions.swift"; sourceTree = "<group>"; };
86878F0526EF96360082F481 /* NSObject+ClassName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSObject+ClassName.swift"; sourceTree = "<group>"; };
96760D3D2B850A3B00475CB7 /* db.dat */ = {isa = PBXFileReference; lastKnownFileType = file; path = db.dat; sourceTree = "<group>"; };
9D00FDD125D2E3DA00D6FEF1 /* BarcodeTypes+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BarcodeTypes+Extensions.swift"; sourceTree = "<group>"; };
9D00FDD425D3C34300D6FEF1 /* BarcodeListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BarcodeListViewController.swift; sourceTree = "<group>"; };
9D053B6E25CD6D770014EE23 /* FieldType+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FieldType+Extensions.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -127,6 +131,8 @@
9DA9A40F283693DC0063B00E /* layer.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = layer.json; sourceTree = "<group>"; };
9DA9A412283780450063B00E /* CustomUIModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomUIModels.swift; sourceTree = "<group>"; };
9DC45D2F25D692AC0077AE4A /* DocReaderFrame+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DocReaderFrame+Extensions.swift"; sourceTree = "<group>"; };
9DE55FA72B4FED40003ECE9F /* CheckResultCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckResultCell.swift; sourceTree = "<group>"; };
9DE55FA82B4FED40003ECE9F /* CheckResultCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CheckResultCell.xib; sourceTree = "<group>"; };
9DF08E5025D3C9C700880F7E /* SettingsActionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsActionCell.swift; sourceTree = "<group>"; };
9DF08E5125D3C9C700880F7E /* SettingsActionCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingsActionCell.xib; sourceTree = "<group>"; };
9DF08E5B25D3F84B00880F7E /* TextFieldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -231,6 +237,7 @@
9D33E2C925CA9FE400FF9561 /* DocumentReader-Swift.entitlements */,
9D00FDDA25D3C68A00D6FEF1 /* Resources */,
9D33E2C425CA9EF500FF9561 /* regula.license */,
96760D3D2B850A3B00475CB7 /* db.dat */,
9D33E2CB25CAA12200FF9561 /* Certificates.bundle */,
9D33E2CC25CAA12200FF9561 /* CertificatesPA.bundle */,
9D33E2CD25CAA12200FF9561 /* CertificatesTA.bundle */,
Expand All @@ -254,6 +261,8 @@
9D658B0D25CC000E00DDB739 /* TextCell.xib */,
9D658B1225CC02F700DDB739 /* ImageCell.swift */,
9D658B1325CC02F700DDB739 /* ImageCell.xib */,
9DE55FA72B4FED40003ECE9F /* CheckResultCell.swift */,
9DE55FA82B4FED40003ECE9F /* CheckResultCell.xib */,
);
path = Cells;
sourceTree = "<group>";
Expand Down Expand Up @@ -376,6 +385,7 @@
files = (
9D969824284A0BB20005C1BD /* ir.bmp in Resources */,
9D658B1525CC02F700DDB739 /* ImageCell.xib in Resources */,
96760D3E2B850A3B00475CB7 /* db.dat in Resources */,
9D33E2CF25CAA12200FF9561 /* CertificatesPA.bundle in Resources */,
9DA9A410283693DC0063B00E /* layer.json in Resources */,
9D33E2AC25CA940700FF9561 /* LaunchScreen.storyboard in Resources */,
Expand All @@ -384,6 +394,7 @@
9D969826284A0BB20005C1BD /* white.bmp in Resources */,
9D33E2CE25CAA12200FF9561 /* Certificates.bundle in Resources */,
9DF08E5325D3C9C700880F7E /* SettingsActionCell.xib in Resources */,
9DE55FAA2B4FED40003ECE9F /* CheckResultCell.xib in Resources */,
9D33E2C525CA9EF500FF9561 /* regula.license in Resources */,
9D969825284A0BB20005C1BD /* uv.bmp in Resources */,
9D658B0F25CC000E00DDB739 /* TextCell.xib in Resources */,
Expand Down Expand Up @@ -466,6 +477,7 @@
9D33E2A025CA940700FF9561 /* AppDelegate.swift in Sources */,
9D658B0225CBD11B00DDB739 /* ResultsViewController.swift in Sources */,
8673192D27EAFE1B00B754DF /* OnlineProcessingViewController.swift in Sources */,
9DE55FA92B4FED40003ECE9F /* CheckResultCell.swift in Sources */,
9D4B75BC25D51EE100EB4EA4 /* CaptureMode+Extensions.swift in Sources */,
9D4B75C925D538F200EB4EA4 /* ChildViewController.swift in Sources */,
9D00FDD225D2E3DA00D6FEF1 /* BarcodeTypes+Extensions.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import DocumentReader

final class DocumentReaderService {
enum State {
case downloadingDatabase(progress: Double)
case initializingAPI
case completed
case error(String)
Expand All @@ -33,30 +32,16 @@ final class DocumentReaderService {
return
}

DispatchQueue.global().async {
DocReader.shared.prepareDatabase(
databaseID: kRegulaDatabaseId,
progressHandler: { (inprogress) in
progress(.downloadingDatabase(progress: inprogress.fractionCompleted))
},
completion: { (success, error) in
if let error = error, !success {
progress(.error("Database error: \(error.localizedDescription)"))
return
}
let config = DocReader.Config(license: licenseData)
DocReader.shared.initializeReader(config: config, completion: { (success, error) in
DispatchQueue.main.async {
progress(.initializingAPI)
if success {
progress(.completed)
} else {
progress(.error("Initialization error: \(error?.localizedDescription ?? "nil")"))
}
}
})
let config = DocReader.Config(license: licenseData)
DocReader.shared.initializeReader(config: config, completion: { (success, error) in
DispatchQueue.main.async {
progress(.initializingAPI)
if success {
progress(.completed)
} else {
progress(.error("Initialization error: \(error?.localizedDescription ?? "nil")"))
}
)
}
}
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ class MainViewController: UIViewController {
DocumentReaderService.shared.initializeDatabaseAndAPI(progress: { [weak self] state in
guard let self = self else { return }
switch state {
case .downloadingDatabase(progress: let progress):
let progressValue = String(format: "%.1f", progress * 100)
self.statusLabel.text = "Downloading database: \(progressValue)%"
case .initializingAPI:
self.statusLabel.text = "Initializing..."
self.activityIndicator.stopAnimating()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// CheckResultCell.swift
// DocumentReader-Swift
//
// Created by Dmitry Evglevsky on 11.01.24.
// Copyright © 2024 Regula. All rights reserved.
//

import UIKit

class CheckResultCell: UITableViewCell {
@IBOutlet weak var resultLabel: UILabel!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="CheckResultCell" customModule="DocumentReader_Swift" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.40000000000000002" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="X4k-i0-brf">
<rect key="frame" x="16" y="8" width="288" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="X4k-i0-brf" secondAttribute="trailing" constant="16" id="99J-3v-U4I"/>
<constraint firstItem="X4k-i0-brf" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="8" id="IuX-Vt-gpl"/>
<constraint firstItem="X4k-i0-brf" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="nw8-Xc-8Pf"/>
<constraint firstAttribute="bottom" secondItem="X4k-i0-brf" secondAttribute="bottom" constant="8" id="ydl-Uf-mFo"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="resultLabel" destination="X4k-i0-brf" id="VcA-ai-VQV"/>
</connections>
<point key="canvasLocation" x="138.93129770992365" y="41.549295774647888"/>
</tableViewCell>
</objects>
</document>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -17,7 +17,7 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="190"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tG3-n9-Fkw">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tG3-n9-Fkw">
<rect key="frame" x="16" y="4" width="288" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -17,7 +17,7 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="G9y-0K-dgO">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="G9y-0K-dgO">
<rect key="frame" x="16" y="4" width="26" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="qUH-a2-10R"/>
Expand All @@ -26,7 +26,7 @@
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Text" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ypm-Ja-g0f">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Text" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ypm-Ja-g0f">
<rect key="frame" x="16" y="25" width="30.5" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand Down
Loading

0 comments on commit 8c34256

Please sign in to comment.