I spent 5 minutes trying to bash my head figuring out why the following code did not push out the token:
if token != nil && token!.isEmpty {
pushOutToken(token)
}
only to realize that the funky Swift unwrapping operator ! applied to token looks - at a quick glance - like a not operator transposed in position, hence the reason for me missing it. I am used to Java, C, C++, C# and tens of other languages that uses the ! as a not operator. Correct code should be:
if token != nil && !token!.isEmpty {
pushOutToken(token)
}
Go figure...