I tried to pass data from one controller to another using segue method. My first viewcontroller is
class ViewController: UIViewController {
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
if (segue.identifier == "btnSubmitSegue") {
var svc = segue.destinationViewController as ForthViewController;
svc.dataParsed = "this is new text"
}
}
}
In Destination view controller ->
class ForthViewController: UIViewController {
@IBOutlet weak var mylabel1: UILabel!
var dataParsed:String!
override func viewDidLoad() {
super.viewDidLoad()
NsLog(dataParsed)
mylabel1.text = dataParsed
}
}
but data is not load to mylabel1.text in destination controller. Can you pls help to figure out