Swift assignments inside conditions -


i wondering code does:

var something: string = "hi"  if = "hello world!" {     // executed? } 

will assign something variable , if body? or set value of variable if body , outside not change? or has nil?

this pattern works assignments can fail — is, if you're assigning result of expression returns optional value. , in case, use if let, not if.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -