INNER CODE UNIT · Swift
finish
wu9007/qrcode_scanner · ios/Classes/SwiftQrscanPlugin.swift:111
private func finish(errorCode: String, message: String) {
pendingResult?(FlutterError(code: errorCode, message: message, details: nil))
pendingResult = nil
}
static func uiColor(_ value: Any?) -> UIColor? {
let bits: UInt32
if let num = value as? NSNumber {
bits = UInt32(truncatingIfNeeded: num.int64Value)
} else if let i = value as? Int {
bits = UInt32(truncatingIfNeeded: i)
} else {
return nil
}
let a = CGFloat((bits >> 24) & 0xff) / 255
let r = CGFloat((bits >> 16) & 0xff) / 255
let g = CGFloat((bits >> 8) & 0xff) / 255
let b = CGFloat(bits & 0xff) / 255