diff --git a/GenericApp/GenericApp/UI/WizardAppViewController.swift b/GenericApp/GenericApp/UI/WizardAppViewController.swift index 2dc5333..2b340bb 100644 --- a/GenericApp/GenericApp/UI/WizardAppViewController.swift +++ b/GenericApp/GenericApp/UI/WizardAppViewController.swift @@ -7,7 +7,6 @@ // import UIKit -import MaterialComponents.MaterialTextFields import ORLib import DropDown diff --git a/GenericApp/GenericApp/UI/WizardDomainViewController.swift b/GenericApp/GenericApp/UI/WizardDomainViewController.swift index d1f7136..671630c 100644 --- a/GenericApp/GenericApp/UI/WizardDomainViewController.swift +++ b/GenericApp/GenericApp/UI/WizardDomainViewController.swift @@ -7,7 +7,6 @@ // import UIKit -import MaterialComponents.MaterialTextFields import ORLib class WizardDomainViewController: UIViewController { diff --git a/GenericApp/GenericApp/UI/WizardRealmViewController.swift b/GenericApp/GenericApp/UI/WizardRealmViewController.swift index 217953e..dce45dd 100644 --- a/GenericApp/GenericApp/UI/WizardRealmViewController.swift +++ b/GenericApp/GenericApp/UI/WizardRealmViewController.swift @@ -7,7 +7,6 @@ // import UIKit -import MaterialComponents.MaterialTextFields import ORLib import DropDown diff --git a/ORLib/ORLib/ConsoleProviders/BleProvider.swift b/ORLib/ORLib/ConsoleProviders/BleProvider.swift index 6b3f890..15fc163 100644 --- a/ORLib/ORLib/ConsoleProviders/BleProvider.swift +++ b/ORLib/ORLib/ConsoleProviders/BleProvider.swift @@ -114,7 +114,7 @@ public class BleProvider: NSObject { } public func sendToDevice(attributeId: String, value: Data, callback:@escaping ([String: Any]) -> (Void)) { - if let device = self.connectedDevice { + if self.connectedDevice != nil { sendToDeviceCallback = callback if let characteristic = deviceCharacteristics.first(where: {$0.uuid.uuidString == attributeId}) { self.maxDataLength = self.connectedDevice!.maximumWriteValueLength(for: characteristic.properties.contains(.writeWithoutResponse) ? .withoutResponse : .withResponse) @@ -258,7 +258,7 @@ extension BleProvider: CBPeripheralDelegate { } public func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) { - if let err = error { + if error != nil { sendToDeviceCallback?([DefaultsKey.actionKey: "SEND_TO_DEVICE", DefaultsKey.providerKey: "ble", DefaultsKey.successKey: false]) } else { if let data = dataToSend { diff --git a/ORLib/ORLib/ConsoleProviders/QrScannerProvider.swift b/ORLib/ORLib/ConsoleProviders/QrScannerProvider.swift index ec306b6..15e044a 100644 --- a/ORLib/ORLib/ConsoleProviders/QrScannerProvider.swift +++ b/ORLib/ORLib/ConsoleProviders/QrScannerProvider.swift @@ -60,7 +60,7 @@ public class QrScannerProvider: NSObject { } } - public func enable(callback:@escaping ([String: Any]) ->(Void)) { + public func enable(callback:@escaping ([String: Any?]) ->(Void)) { userdefaults?.removeObject(forKey: QrScannerProvider.cameraDisabledKey) userdefaults?.synchronize() let cameraAuthorizationStatus = AVCaptureDevice.authorizationStatus(for: .video) diff --git a/ORLib/ORLib/UI/ORViewController.swift b/ORLib/ORLib/UI/ORViewController.swift index 0a6ed1d..6d3572c 100644 --- a/ORLib/ORLib/UI/ORViewController.swift +++ b/ORLib/ORLib/UI/ORViewController.swift @@ -113,11 +113,15 @@ open class ORViewcontroller : UIViewController { webCfg.userContentController = userController; let sbHeight: CGFloat - if #available(iOS 11.0, *) { - sbHeight = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? UIApplication.shared.statusBarFrame.height + + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene { + // Use the statusBarManager's frame if available + sbHeight = windowScene.statusBarManager?.statusBarFrame.height ?? 0 } else { - sbHeight = UIApplication.shared.statusBarFrame.height + // Fallback in case there's no window scene (this case is rare in iOS 13+ apps) + sbHeight = 0 } + webCfg.allowsInlineMediaPlayback = true let webFrame = CGRect(x: 0, y: sbHeight, width: view.frame.size.width, height: view.frame.size.height - sbHeight)