This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CoreLocation | |
import RxSwift | |
import RxCocoa | |
class CLLocationManagerDelegateProxy: DelegateProxy<CLLocationManager, CLLocationManagerDelegate>, DelegateProxyType, CLLocationManagerDelegate { | |
public weak private(set) var locationManager: CLLocationManager? | |
public init(locationManager: CLLocationManager) { | |
self.locationManager = locationManager |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension Data { | |
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription | |
guard let object = try? JSONSerialization.jsonObject(with: self, options: []), | |
let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]), | |
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil } | |
return prettyPrintedString | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func shouldPerformIntensiveUnecessaryAnimation() -> Bool { | |
return ProcessInfo.processInfo.thermalState != ProcessInfo.ThermalState.critical || | |
!ProcessInfo.processInfo.isLowPowerModeEnabled || | |
!UIAccessibilityIsReduceMotionEnabled() || | |
!(UIDevice.current.batteryLevel < 10 && UIDevice.current.batteryState == .unplugged) | |
} |