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

Popular posts from this blog

javascript - Why Selenium can't find an element that is graphically visible -

java - How to compare two classes -

mysql - Gateway Timeout Error on Insert 70000 record using Hibernate in Java -