Adding waypoints to directions request

Hi,

I've built an application that utilises direction request and calculates a route between 2 points.

let direction = MKDirections(request: self.directionRequest)
    direction.calculate { (response, error) in
        guard let response = response else {
            if let error = error {
                print("ERROR FOUND : \(error.localizedDescription)")
            }
            return
      }
      let route = response.routes[0]...

I'm only getting the best direction using self.directionRequest.requestsAlternateRoutes = false however, on some of the routes a user is taken through a section of roads that I would like them to avoid so I've been trying to find a way to add waypoints to keep them on a path that is accessible to them.

Apparently there is a waypoints option https://developer.apple.com/documentation/sirikit/inridestatus/1648492-waypoints/ however I have no idea where this would go in my app.

I'm using Swift 5.

Adding waypoints to directions request
 
 
Q