Post

Replies

Boosts

Views

Activity

Conversion of Integer array to Location coordinates is not working in iPadOS 16 Beta
Dear team, Im facing one issue in iPadOS 16 Beta (16.1 release). The issue was in my application server send response in Integer array and we have to convert that Integer array to location coordinates. Find my attached code. func convertIntergerArrayToCoordinates(_ values: [Int]) -> CLLocationCoordinate2D? {         func toBytes(withArrayOfInts numbers: [Int]?) -> [UInt8] {             guard let numbers = numbers else { return [] }             return numbers.map({ UInt8($0) })         }         func sliceToArray<T>(withSlice slice: ArraySlice<T>?) -> [T] {             guard let slice = slice else { return [] }             return slice.map { $0 }         }         let capacity: Int = 8         if let latitude = toBytes(withArrayOfInts: sliceToArray(withSlice: values[0..<capacity])).withUnsafeBufferPointer({ $0.baseAddress })?.withMemoryRebound(to: Double.self, capacity: capacity, { $0.pointee }), let longitude = toBytes(withArrayOfInts: sliceToArray(withSlice: values[capacity..<capacity*2])).withUnsafeBufferPointer({ $0.baseAddress })?.withMemoryRebound(to: Double.self, capacity: capacity, { $0.pointee }) {             return CLLocationCoordinate2D(latitude: latitude, longitude: longitude)         } else {             return nil         }     } This code was working perfectly for iOS 16 latest Beta but not working in iPadOS 16 latest beta. Kindly share you anyone having idea on this. Input: let values = [184, 173, 45, 60, 47, 201, 71, 64, 190, 200, 241, 48, 90, 142, 94, 192, 33, 179, 0] /// lat: 47.571754 lon: -122.224254
0
0
389
Sep ’22