When print(mess)
is called from the viewDidLoad
function, it prints what is expected in the console, but when it is assigned to a UITextField
or UILabel
, then the assigned value is not getting reflected in the UITextField
or UILabel
. why is this ?
Doing this:
var mess: String = ""
override func viewDidLoad()
{
super.viewDidLoad()
self.infoLabel.text = mess //label not getting updated
print(mess) //printing the required output in console
}
But when I am doing this its working fine
override func viewDidLoad()
{
super.viewDidLoad()
let date = DATE()
let calendar = Calendar.current
let minutes = calendar.component(.minutes, from: date)
temp.text = String(minutes)
}