syntax - Swift variable declaration trouble -
i'm following guide use syntax declare variable:
let fromview = presenting ? toview : transitioncontext.view(forkey: uitransitioncontextfromviewkey)
but don't understand syntax: specially question mark , colon (presenting
boolean variable).
this allows declare variables based on boolean expressions. saves time don't have write out various if else statements. above expression in question declaring variable based on boolean presenting. if presenting true fromview gets set toview (on left side of colon). if presenting false, fromview gets set transitioncontext.view(forkey: uitransitioncontextfromviewkey) or right side of colon
Comments
Post a Comment