-3

Swift produce an error when I'm try to compare ~ (tilde) or | (pipe) with a character in NSString object

Communicator.swift:63:48: Invalid character in source file and many other places error produced by swift

what i am thinking that it may be conflict with | operator or ~ operator so it don't allow me to do so how can I escape it if possible or what should i do to solve this i am using Xcode 6.2 and i am new to swift and IOS.

REMARK : M know very well how to compare string etc the problem is with ~ (tild) and | pipe character whenever i compare with them swift produce error plzzzzz first see the image i uploaded and this question is not duplicate of anyone m spend my 4 to 5 hours in searching solution of this in verious swift blogs and google fb,google groups and etc place also searched in stackoverflow too but m can't find the solution then i ask hear so please not about it before comment answer or vote minus my code take at least a second in see what i exactly asked to you thank you

Indrajit Sinh Rayjada
  • 1,243
  • 1
  • 14
  • 24

1 Answers1

-3

I have found the answer myself, just change following

String(UnicodeScalar(data.characterAtIndex(0))) == "~"
pacholik
  • 8,607
  • 9
  • 43
  • 55
Indrajit Sinh Rayjada
  • 1,243
  • 1
  • 14
  • 24