当前位置:网站首页>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边栏推荐
- Postman自动化接口测试
- Insect operator overloaded a fun
- Logical operation
- [proteus simulation] Arduino uno key start / stop + PWM speed control DC motor speed
- 李航老师新作《机器学习方法》上市了!附购买链接
- Teacher Li Hang's new book "machine learning methods" is on the market! Purchase link attached
- Bug memory management
- PHP非对称加密算法(RSA)加密机制设计
- 古瑞瓦特沖刺港交所上市:創下“多個第一”,獲IDG資本9億元投資
- MongoDB系列之适用场景和不适用场景
猜你喜欢

hands-on-data-analysis 第三单元 模型搭建和评估

awk工具

Zero basics of C language lesson 7: break & continue

8.Ribbon负载均衡服务调用

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

Range of types

8. Ribbon load balancing service call

Here document interaction free and expect automatic interaction

Calculate the distance between two points (2D, 3D)

防火墙介绍
随机推荐
es常用语法一
使用 Performance 看看浏览器在做什么
虫子 内存管理 下 内存注意点
PHP非对称加密算法(RSA)加密机制设计
Network remote access using raspberry pie
7-1 n queen problem
GO语言-管道channel
Design of simple digital circuit traffic light
Gurivat sprint Harbour Exchange listed: created “multiple first”, received 900 million yuan Investment from IDG capital
Mysql database explanation (III)
Reprint - easy to use wechat applet UI component library
[hcsd application development training camp] one line of code second cloud evaluation article - experience from the experiment process
【Proteus仿真】Arduino UNO按键启停 + PWM 调速控制直流电机转速
Calculate the distance between two points (2D, 3D)
8.Ribbon负载均衡服务调用
Create your own cross domain proxy server
Memory considerations under bug memory management
GEE——全球人类居住区网格数据 1975-1990-2000-2014
Ring queue PHP
12 SQL optimization schemes summarized by old drivers (very practical)