Quickly view the type of a Swift variable in XCode

2019-07-05 09:36发布

问题:

Is there any shortcut that will allow me to quickly view the type of any variable in Swift in XCode? Alt-Click returns "No Quick Help". Type inference is awesome, but makes life hard without tools such as these...

回答1:

Either use Alt-click to display the declaration of the variable which displays the type at the top right like so: Or use autocompletion to show you the type: