I met with this code, and I could not figure out what does this two question marks mean?
the Definition of this variable looks like following:
var featureImageSizeOptional: CGSize?
The code that makes me confused is:
let featureImageSize = featureImageSizeOptional ?? CGSizeZero
It's the coalescing operator. It returns the first expression (featureImageSizeOptional
) if it's non-nil. If the first expression is nil, the operator returns the second expression (CGSizeZero
).
See the Language Guide for more info.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments