Post

Replies

Boosts

Views

Activity

Reply to Guided Project: Apple Pie
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.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’22
Reply to Apple Pie Guided Project: getting error - Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value.
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).
Mar ’22
Reply to Guided Project: Apple Pie
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.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Interface builder not setting button title?
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.
Replies
Boosts
Views
Activity
Mar ’22
Reply to Apple Pie Guided Project: getting error - Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value.
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).
Replies
Boosts
Views
Activity
Mar ’22
Reply to Develop in swift fundamentals and xcode 12
You likely need an xcode update. This happened to me after I installed BigSur. After updating xcode it worked again.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21