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...
See Variable Values in Code and the Variable Viewer When your app pauses at a breakpoint, hover over a variable in your source code to view its current value. If the variable is an image or other type that isn't expressible as text, click the Quick Look button at the upper-right to see a preview of the variable.
In Swift, there are two kinds of types: named types and compound types. A named type is a type that can be given a particular name when it's defined. Named types include classes, structures, enumerations, and protocols. For example, instances of a user-defined class named MyClass have the type MyClass .
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With