in this line
... currentAnswer.text?.replaceSubrange(currentIndex...currentIndex, with: characterString) ...
and this line
... currentAnswer.text = currentAnswer.text?.replaceSubrange(range, with: characterString) ...
are giving me the errors "Type of expression is ambiguous without more context" and "No exact matches in call to instance method 'replaceSubrange", respectively.
I am trying to do two things. after extracting the buttontitle, i turned it into both a string and character. i am trying to check currentWord to see if it contains the buttonTitle variable, and if it does, I want to reveal the letter in the currentAnswer textfield. I got it to work, but the order was wrong, the position of each letter revealed was random. The second issue was if a letter appears in the word the user is trying to guess more than once, that letter should appear as many times in the currentAnswer textfield but it wouldn't and I have disable each letter if it is tapped so I obviously can't retap the letter again. Thanks for your help!
I started looking at this and stopped when I got to the sea of constraints. It was too wide to cross.
It seems your original question about ambiguous subranges may have nothing to do with the interface code.
Can you duplicate the substitution problem in just a few lines of logic code in Playgrounds? Let's focus on the business end of this problem.
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.