Skip to content

Commit

Permalink
Removed MaterialComponents code (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miggets7 authored Sep 10, 2024
1 parent e778005 commit e1132f9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion GenericApp/GenericApp/UI/WizardAppViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import UIKit
import MaterialComponents.MaterialTextFields
import ORLib
import DropDown

Expand Down
1 change: 0 additions & 1 deletion GenericApp/GenericApp/UI/WizardDomainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import UIKit
import MaterialComponents.MaterialTextFields
import ORLib

class WizardDomainViewController: UIViewController {
Expand Down
1 change: 0 additions & 1 deletion GenericApp/GenericApp/UI/WizardRealmViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import UIKit
import MaterialComponents.MaterialTextFields
import ORLib
import DropDown

Expand Down
4 changes: 2 additions & 2 deletions ORLib/ORLib/ConsoleProviders/BleProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ORLib/ORLib/ConsoleProviders/QrScannerProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 7 additions & 3 deletions ORLib/ORLib/UI/ORViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e1132f9

Please sign in to comment.