I have a string extension in which I define a function that calculates the DamerauLevenshtein distance between two different strings. When adding the following code:
var result = "Hello"
result.damerauLevenshteinTo("Hellow")
in any other class such as a UIViewController, UITableViewController, etc. the code compiles fine.
As soon as I try adding it to my own class defined as class CustomClass: AnyObject
I get the following error message.
Value of type String has no member 'damerauLevenshteinTo'
What am I missing? Thanks!
Update Copy pasting the entire class with the extension to an empty project compiles great... Moving it to the old project still gives me the error no matter what I try.
Update 2 It seems I can't use any custom classes or subclasses inside this class. Hm...
Update 3 Deleting the file and pasting the class in a new one got rid of the error after about the third time... Hurray