79123488

Date: 2024-10-24 20:17:39
Score: 1
Natty:
Report link

When you have optionals and code completion suggests testing for '!= nil', you must keep in mind true and false are both not nil. In this scenario it's best to do something like this:

if let bool = data?.contains("string") {
   boolVariable = bool
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): When you have
  • Low reputation (0.5):
Posted by: mrcrowley