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 } }
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
Post a Comment