1.

How can the double question mark symbol "??" be used in ios Swift programming?

Answer»

The nil-coalescing operator "??" is a SHORTHAND for the ternary conditional operator, which we used to test for nil. A double question MARK can also be used to set a variable's default value.

"default STRING" stringVar??

This does PRECISELY what you would EXPECT: if stringVar is not nil, it is returned; otherwise, the "default string" is returned.



Discussion

No Comment Found