let locationManager = CLLocationManager()
if #available(iOS 15.0, *) {
// use UICollectionViewCompositionalLayout
let isLocationSimulated = locationManager.location?.sourceInformation?.isSimulatedBySoftware ?? false
let isProducedByAccess = locationManager.location?.sourceInformation?.isProducedByAccessory ?? false
let info = CLLocationSourceInformation(softwareSimulationState: isLocationSimulated, andExternalAccessoryState: isProducedByAccess)
if info.isSimulatedBySoftware == true || info.isProducedByAccessory == true{
result(true)
} else {
result(false)
}
}
else{
result(false)
}