Friday, August 7, 2015

isEqualToString have already been over on swift?

an error message showed that :
"String does not have  member named isEqualToString"

checked internet and found below.

I just change the "isEqualToString" to "is Equal", no showing error anymore but not sure it is correct or not.



http://stackoverflow.com/questions/24096708/isequaltostring-in-swift

7 Answers

up vote78down voteaccepted
With Swift you don't need anymore to check the equality with isEqualToString
You can now use ==
Example: 
let x = "hello"
let y = "hello"
let isEqual = (x == y)


No comments:

Post a Comment