How to determine which textfield is active swift

前端 未结 7 1722
太阳男子
太阳男子 2020-12-06 04:01

I cant figure out which UITextField is currently active so i can clear its text if they hit cancel on a UIBarButtonItem. Here is my code. There is

7条回答
  •  死守一世寂寞
    2020-12-06 05:04

    you can assign a tag to all your text feild and in textFieldDidBeginEditing check your current textFeild.tag and it's clear witch textfeild is in use .

提交回复
热议问题