Search code examples
swiftswift4apple-maps

Check if a latitude and longitude is within a circle in swift using apple maps?


enter image description here

i want know, if i give a set of latitude and longitude within a circle and radius


Solution

  • use: distance(from:

    let distance = usersLocation.distance(from: circleCenter)
    
    if distance > maxRadius { print("outside of range") }