I'm new to Swift - using Swift 3, Xcode 8.0 beta 6, Mac OS X 10.11.6. The following line works in my project (this is a simple test case to see if the "contains" method works):
if ("hello John".contains("John")){}
It works great in my project, but when I cut it out and paste it into the playground project, it gives an error:
"A value of type 'String' has no member 'contains'.
My question is, in addition to why this error occurs, are there different frameworks / functions / methods, etc., used in playground projects from ordinary projects? Thank you for your help. Squire
source
share