Disable text field interaction with segue

Disable text field interaction with segue

I want to make textfield's user interaction disabled when the user tapped on tableview's row and the segue is applied.Where did I something wrong ? I am getting "Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value" error when I select row at tableview.

I want to make textfield's user interaction disabled when the user tapped on tableview's row and the segue is applied.Where did I something wrong ? I am getting "Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value" error when I select row at tableview.

here is my ViewController class and its necessary functions

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    self.selectedTrip = dateArray[indexPath.row]
    performSegue(withIdentifier: "toDetailsVC", sender: self)
}

override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "toDetailsVC" { let destinationVC = segue.destination as! detailsViewController destinationVC.kmField.isUserInteractionEnabled = false } }

and kmField in detailsVC is like

@IBOutlet weak var kmField: UITextField!


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

iOS App Development: How Apple's iOS 13 & Swift 5 Will Change App Development Industry

Want to know how Apple's iOS 13 & Swift 5 will change the iOS app development industry? Refer to this blog that contains in-detail information on it.

How To Build Reminders iOS App in Swift 5 for Beginners

In this video, we build the Reminders App in Swift for iOS. Learn how to use dates, local / user notifications, tableviews, and much more. From scratch to working app, we'll go over every step up toe process together.

Creating an iOS app with user presence using Node.js and Swift

In this tutorial, we are going to see how you can add user presence to an iOS application using Pusher Channels, Node.js, and Swift.