I keep having this error
I've seen other questions been answered by using textLabel.text, but it doesn't work in my case
I'm new to swift so could someone please explain me why and how to solve this.
I keep having this error
I've seen other questions been answered by using textLabel.text, but it doesn't work in my case
I'm new to swift so could someone please explain me why and how to solve this.
You need to unwrap
textLabel
by using an!
aftertextLabel
.This is because
textLabel
is anOptional
(hence thetextLabel?
type instead of justtextLabel
). Read more about optionals here.Hope that helps!