ios - Edit 2 labels from 1 text field -


good day! here issue - need change 2 different labels 1 text field. tried simple if-else logic, didn't work in case.

    func labeltextchanger() {      if fromusername.text == nil {         fromusername.text = textfileld.text     } else  {         replytousername.text = textfileld.text     } } 

ma case

if understand question correctly, need change text of 2 uilabels whenever editing uitextfield? if so, should use "editing began" or "editing changed" ibaction linked storyboard file. then, have uilabel's value change whatever uitextfield's text is.

@ibaction textfileideditingchanged {     fromusername.text = textfileid.text     replytousername.text = textfileid.text }  

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

qt - Microsoft FTP Service 451 The parameter is incorrect -