Why when I try to print button title i used print(sender.currentTitel) and isn't working.
And this in below it is work:
print((sender as AnyObject).currentTitle!!)
Why when I try to print button title i used print(sender.currentTitel) and isn't working.
And this in below it is work:
print((sender as AnyObject).currentTitle!!)
Copyright © 2021 Jogjafile Inc.
I assume you are in a
IBActionfunction like this:This is due to the
Anyreference you declare when you create the IBAction. Two solution.You can modify your IBAction like this:
or test the sender conformance:
Cheers