
Code of ViewController (code of file from where you want to pass value):
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var txt1: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
...