Post

Replies

Boosts

Views

Activity

Reply to "Failed to produce diagnostic for expression; please submit a bug report and include the project"
Move the code below out of the toolbar list. This is not a toolbar type hence the error.  RoundedRectangle(cornerRadius: 7)           .fill(Color(.systemGray4))           .frame(width: 200, height: 299, alignment: .center)         VStack {           Text("New Folder")           Text("Enter a name for this folder")           TextField("Name", text: $newFolderName)         }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22
Reply to Unexpectedly found nil while unwrapping an Optional value
don't force unwrap let letterString = sender.title(for: .normal)! @IBAction func letterButtonPressed(_ sender: UIButton) {      // unwrap the optional response from sender.title(for:) else return from method  guard let letterString = sender.title(for: .normal) else { return } sender.isEnabled = false   let letter = Character(letterString.lowercased())      currentGame.playerGuessed(letter: letter)      updateGameState()   }    func updateGameState() {     if currentGame.incorrectMovesRemaining == 0 {       totalLosses += 1     } else if currentGame.word == currentGame.formattedWord {       totalWins += 1     } else {       updateUI() } }
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’22