INNER CODE UNIT · Swift
a
wu9007/qrcode_scanner · ios/Classes/SwiftQrscanPlugin.swift:125
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
return UIColor(red: r, green: g, blue: b, alpha: a)
}
static func topViewController() -> UIViewController? {
let window: UIWindow?
if #available(iOS 13.0, *) {
window = UIApplication.shared.connectedScenes
.compactMap { $0 as? UIWindowScene }
.flatMap { $0.windows }
.first { $0.isKeyWindow }
} else {
window = UIApplication.shared.keyWindow
}
var top = window?.rootViewController