You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using FuzzyMatchingSwift for a while now and in general it works really nice. I've experienced two things I wanted to share. Maybe I've been using it wrong but here's the issue:
I've integrated an SQLite Database into my iOS project. It's a movie quiz where the user has to guess the name of a movie and type it in a text field. Then the code scans the "fuzzyness" from the answer and executes an action. Here's my code:
let precission = self.guess.text?.confidenceScore(movieName)
if precission! <= 0.25 {
self.result.text = "You're right! It was \(movieName)"
} else {
self.result.text = "No, that's not the one. Try again!"
}
Sometimes when the "no" answer is triggered the app seems to be freezing for 2-3 seconds before the result is displayed. Sometimes even the whole app crashes.
Edit:
I tested a change and it seems that the crashes are gone but the reaction is still slow. Could it be possible that the following changes prevent the app from crashing?
let precission = Double((self.guess.text?.confidenceScore(movieName))!) //changed to Double
if precission <= 0.25 { //deleted unwrap "!"
self.result.text = "You're right! It was \(movieName)"
} else {
self.result.text = "No, that's not the one. Try again!"
}
Do you have an idea how I could improve my code here?
Thanks and regards, have a great holiday season
Patrick
The text was updated successfully, but these errors were encountered:
Hi,
I'm using FuzzyMatchingSwift for a while now and in general it works really nice. I've experienced two things I wanted to share. Maybe I've been using it wrong but here's the issue:
I've integrated an SQLite Database into my iOS project. It's a movie quiz where the user has to guess the name of a movie and type it in a text field. Then the code scans the "fuzzyness" from the answer and executes an action. Here's my code:
Sometimes when the "no" answer is triggered the app seems to be freezing for 2-3 seconds before the result is displayed. Sometimes even the whole app crashes.
Edit:
I tested a change and it seems that the crashes are gone but the reaction is still slow. Could it be possible that the following changes prevent the app from crashing?
Do you have an idea how I could improve my code here?
Thanks and regards, have a great holiday season
Patrick
The text was updated successfully, but these errors were encountered: