0

For example in my user model I have a computed property fullName:

var fullName: String {
    return firstName + " " + lastName
}

I want to set a short description for this variable so that during Code Completion I have a small hint.

Like in the screen below:

enter image description here

How to do this?

2 Answers2

1

You could use /** */ to add document to your code

/** Here is fullname */
var fullName: String {
  return firstName + " " + lastName
}
Tuan Luong
  • 3,902
  • 1
  • 16
  • 18
1

Precede the variable declaration with a three-slash comment. Like this:

enter image description here

matt
  • 515,959
  • 87
  • 875
  • 1,141