How can I add text to autocomplete like below, the "Tells the element to activate itself..." part,
This is what I have,
But the "This is a test" part doesn't show up in autocomplete,
Please do not link to other posts that cover how to write comments so that they would show up in the window that pops up with Option+Click, I'm well-aware of how to do that. My question is specifically around comments showing up in the auto-complete window.
Go to Xcode > Preferences > Text Editing again. Quit out of Xcode and then relaunch Xcode. Now go to Code completion and check 'Suggest completions while typing'. Try typing library function or enum and enjoy!
Press the escape key when auto-complete makes the first suggestion. This will display the list. Escape or control-comma will show the list, control-period will accept the current suggestion and (subsequently) rotate through suggestions, control-slash will move to the next placeholder argument that was inserted.
P: property (IIRC Xcode favors L/V for Swift, but you see P for ObjC properties)
try this, tested on Xcode 9.3 - 9.4 beta and swift 4.1
/// this is printName func and will print your name
func printName(name: String){
print("my name is \(name)")
}
and result :
/**
Put comments just above the funcion using the Markdown format like this
*/
func exampleFunction() {
print("The comments above will show up in the auto complete popover.")
}
Popover Example
Full explanation @ Hacking With Swift
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