Skip to content

Commit 1454a65

Browse files
committed
migration RFIDNotificationCodes
1 parent 86e9b03 commit 1454a65

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

Samples/Advanced/DocumentReader-Swift/DocumentReader-Swift/AdditionalScreens/CustomRfidViewController.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ class CustomRfidViewController: UIViewController {
122122

123123
func handleRFIDNotify(rfidNotify: RFIDNotify) {
124124
switch rfidNotify.code {
125-
case RGLRFIDNotificationCodesProgress:
125+
case RFIDNotificationCodes.progress:
126126
DispatchQueue.main.async {
127127
var progress: Float = 0
128128
if self.currentRfidNotify != nil {
129129
progress = Float(rfidNotify.value / 100)
130130
}
131131
self.progressView.progress = progress
132132
}
133-
case RGLRFIDNotificationCodesPCSCReadingDatagroup:
133+
case RFIDNotificationCodes.pcscReadingDatagroup:
134134
if rfidNotify.value == 1 {
135135
self.currentRfidNotify = nil
136136
} else {
@@ -143,7 +143,7 @@ class CustomRfidViewController: UIViewController {
143143

144144
func currentProgress(rfidNotify: RFIDNotify) -> Float {
145145
switch rfidNotify.code {
146-
case RGLRFIDNotificationCodesProgress:
146+
case RFIDNotificationCodes.progress:
147147
return Float(rfidNotify.value)
148148
default:
149149
break
@@ -154,7 +154,8 @@ class CustomRfidViewController: UIViewController {
154154

155155
func currentDataGroupTypeName() -> String {
156156
if let notify = self.currentRfidNotify {
157-
return RFIDNotify.rfidDataFileTypeName(RFIDDataFileType.init(rawValue: Int(notify.number)) ?? RFIDDataFileType.unspecified) ?? ""
157+
let type = RFIDDataFileType(rawValue: notify.attachment) ?? .unspecified
158+
return RFIDNotify.rfidDataFileTypeName(type) ?? ""
158159
}
159160
return ""
160161
}

Samples/Advanced/DocumentReader-Swift/DocumentReader-Swift/ResultsViewController/ResultsViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class ResultsViewController: UIViewController {
221221
var dataGroup = GroupedAttributes(type: "Data Groups", items: [])
222222
applications.forEach {
223223
$0.files.forEach {
224-
guard $0.readingStatus != RGLRFIDErrorCodesNotAvailable else { return }
224+
guard $0.readingStatus != RFIDErrorCodes.notAvailable else { return }
225225
let attribute = Attribute(name: $0.typeName, rfidStatus: $0.pAStatus)
226226
dataGroup.items.append(attribute)
227227
}
@@ -372,7 +372,7 @@ extension ResultsViewController: UITableViewDataSource, UITableViewDelegate {
372372
return UITableViewCell()
373373
}
374374
cell.textLabel?.text = item.name.uppercased()
375-
let imageName = item.rfidStatus == RGLRFIDErrorCodesFailed ? "status_not_ok" : item.rfidStatus == RGLRFIDErrorCodesNoError ? "status_ok" : "status_undefined"
375+
let imageName = item.rfidStatus == RFIDErrorCodes.failed ? "status_not_ok" : item.rfidStatus == RFIDErrorCodes.noError ? "status_ok" : "status_undefined"
376376
let imageView = UIImageView(image: UIImage(named: imageName))
377377
cell.accessoryView = imageView
378378
return cell

0 commit comments

Comments
 (0)