I have the following problem. I use this code below and I get the issue
"Variable 'characteristic' was never mutated; consider changing to 'let' constant"
for var characteristic:CBCharacteristic in service.characteristics ?? [] {
print(str)
_selectedPeripheral!.writeValue(str.dataUsingEncoding(NSUTF8StringEncoding)!, forCharacteristic: characteristic, type: CBCharacteristicWriteType.WithoutResponse)
}
When I change to "let", there's an Error:
'let' pattern cannot appear nested in an already immutable context
Why does it recommend me the change and afterwards mark it as an error?