OS 15 update seems to have changed some button behavior.
You can use sender.titleLable!.text!
instead of
sender.title(for: normal)!
sender.configuration!.text!
also works.
Also changing the button style from plain to default may solve the problem.
It is better here to use a guard.
Post
Replies
Boosts
Views
Activity
IOS 15 update seems to have changed some button behavior.
use sender.titleLable!.text! instead of sender.title(for: normal)!
sender.configuration!.text! also works.
Also changing the button style from plain to default.
It is better here to use a guard.
let letterString = sender.title(for: .normal)! no longer works as of the IOS15 update.
You can do this:
let letterString = sender.titleLabel!.text!
or this:
let letterString = sender.configuration!.text!
to fix the issue.
But you should probably be using a guard here.
guard let letterString = sender.configuration?.text
else { return print("error unwrapping button title") }
That way the app doesn't crash (it still doesn't work, but it doesn't crash, so you're moving in the right direction).
You likely need an xcode update. This happened to me after I installed BigSur. After updating xcode it worked again.