当前位置:网站首页>How to check if a text field is empty or not in swift
How to check if a text field is empty or not in swift
2022-06-26 13:54:00 【javail】
problem :
I am working on the code below to check the textField1 and textField2 text fields whether there is any input in them or not. I am writing the following code to check textField1 and textField2 Whether the text field has any input .
The IF statement is not doing anything when I press the button. When I press the button , IF Statement does nothing .
@IBOutlet var textField1 : UITextField = UITextField() @IBOutlet var textField2 : UITextField = UITextField() @IBAction func Button(sender : AnyObject) { if textField1 == "" || textField2 == "" { //then do something } }Solution :
Reference resources : https://stackoom.com/en/question/1d8CH边栏推荐
- hands-on-data-analysis 第三单元 模型搭建和评估
- Wechat applet -picker component is repackaged and the disabled attribute is added -- below
- Connection migration for DataGrid configuration
- 程序员必备,一款让你提高工作效率N倍的神器uTools
- 2021-10-09
- A collection of common tools for making we media videos
- sed编辑器
- [proteus simulation] Arduino uno key start / stop + PWM speed control DC motor speed
- GEE——全球人类居住区网格数据 1975-1990-2000-2014
- Thinking caused by the error < note: candidate expectations 1 argument, 0 provided >
猜你喜欢

Hands on data analysis unit 3 model building and evaluation

Es sauvegarde et restauration des données par instantané

免费的机器学习数据集网站(6300+数据集)

Bigint: handles large numbers (integers of any length)

网络远程访问的方式使用树莓派

Some conclusions about Nan

Zero basics of C language lesson 8: Functions

程序员必备,一款让你提高工作效率N倍的神器uTools

去某东面试遇到并发编程问题:如何安全地中断一个正在运行的线程

Mysql database explanation (III)
随机推荐
Nexys A7开发板资源使用技巧
Calculate the distance between two points (2D, 3D)
【Proteus仿真】Arduino UNO按键启停 + PWM 调速控制直流电机转速
Luogu p3426 [poi2005]sza-template solution
Jenkins build prompt error: eacces: permission denied
Ubuntu installation and configuration PostgreSQL (18.04)
Postman自动化接口测试
ES6:Map
es常用语法一
8. Ribbon load balancing service call
Lamp compilation and installation
Is it safe to open a securities account? Is there any danger
A few lines of code can realize complex excel import and export. This tool class is really powerful!
Basic type of typescript
7-2 picking peanuts
Bug memory management
网络远程访问的方式使用树莓派
古瑞瓦特冲刺港交所上市:创下“多个第一”,获IDG资本9亿元投资
awk工具
Generate JDE dot train