How to reorder cells based on sort criteria programatically SWIFT 4

I'm trying to reorder cells based on sorting criteria that will be triggered from a segment control. The problem that i am having when sorting it just sorts the labels in the table but some elements like a button that the text will change based on user interaction stays at the same row which do not make sense it should be more with the cell itself. Please see differences when tapped on the distance segment control it sorts the data correctly the problem is the button START ROUTE was pressed when it was at row 2 and changed into IN TRANZIT and now that is sorted it should be at row 1 but that is not the case here. The data that is populating the table is coming from core data. Can someone point me in the right direction, please?

enter image description here enter image description here

        func sortData() {
            if segment.selectedSegmentIndex == 1 {
                dropOffLocations.sort(by: {$0.dateCreated! < $1.dateCreated! })
            } else if segment.selectedSegmentIndex == 2 {
                dropOffLocations.sort(by: {$0.distance < $1.distance })
            } else if segment.selectedSegmentIndex == 3 {
                dropOffLocations.sort(by: {$0.postcode! < $1.postcode! })

        @IBAction func segmentChange(_ sender: Any) {

@objc func tappedButton(sender : UIButton) {
    if let cell = sender.superview?.superview?.superview as? UITableViewCell {
        if let indexPath = tableView.indexPath(for: cell) {
              sender.setTitle("IN TRANZIT", for: .normal)
            sender.titleLabel?.adjustsFontSizeToFitWidth = true
            sender.backgroundColor = #colorLiteral(red: 0.05882352963, green: 0.180392161, blue: 0.2470588237, alpha: 0.75)

            let location = dropOffLocations[indexPath.row]
            let destinationCoordinate = CLLocationCoordinate2D(latitude: location.latitude, longitude: location.longitude)
            let destinationPlacemark = MKPlacemark(coordinate: destinationCoordinate)
            let destinationMapItem = MKMapItem(placemark: destinationPlacemark)

   = location.street
            destinationMapItem.openInMaps(launchOptions: [MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving])


      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
            guard let cell = tableView.dequeueReusableCell(withIdentifier: "deliveryAddressCell", for: indexPath) as? AddressCell else { return UITableViewCell() }

            let dropOffLocation = dropOffLocations[indexPath.row]

            cell.startBtn.addTarget(self, action: #selector(self.tappedButton(sender:)), for: .touchUpInside)
            cell.startBtn.titleLabel?.adjustsFontSizeToFitWidth = true
            cell.startBtn.titleLabel?.minimumScaleFactor = 0.5
            cell.startBtn.titleLabel?.numberOfLines = 1
            cell.startBtn.titleLabel?.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2)
            cell.configureCell(dropOffLocation: dropOffLocation)
            cell.numberLbl.text = String(indexPath.row + 1)

            return cell