ios - How to navigate and pass data to another view controller without use of segue in swift -


hy, new swift. have on question. have 1 view controller in have textbox , button , have second view controller have textbox , button. want whenever pressed button of first view controller second view controller appear , data of textbox of first view controller pass textbox of second view controller without use of segue. please me.

in firstviewcontroller.swift

@ibaction weak var textfiled: uitextfield!  @ibaction func senddatatonextvc(sender: uibutton) { let mainstoryboard = uistoryboard(name: "storyboard", bundle: nsbundle.mainbundle())     let vc : secondviewcontroller = mainstoryboard.instantiateviewcontrollerwithidentifier("secondviewcontrollersbid”) secondviewcontroller vc. recevedstring  = textfiled.text     self.presentviewcontroller(vc, animated: true, completion: nil) } 

in secondviewcontroller.swift

var recevedstring: string =  “”  @ibaction weak var textfiled2: uitextfield!  override func viewdidload() { super.viewdidload() textfiled2.text = recevedstring  } 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -