4 ms·
Huh? That makes no sense. The Swift API is init?(from pasteBoard: NSPasteboard) Which should autocomplete/hint while writing code. The documentation is i
by matchbok 5y ago
Huh? That makes no sense.
The Swift API is
init?(from pasteBoard: NSPasteboard)
Which should autocomplete/hint while writing code. The documentation is in the type, not littered within the function name. Much more easier to read and write. The "pasteboard" is still very much in the function declaration.
Compared to the obj-C version:
+ (NSURL *)URLFromPasteboard:(NSPasteboard *)pasteBoard;
Not sure why they insist on no spacing, or sane formatting, for Obj-c. I still can't read most Obj-c - it's horribly designed.
- thought_alarm 5y ago> Which should autocomplete/hint while writing code It does not. Parameter types and alternate parameter names are ignored by Xcode autocomplete. If you want to use init(from:), you have to already know that it exists and does something good. Typically, you only find a method like that by looking at the Obj-C header. And that method is declared in the NSPasteboard header, not NSURL.
- Someone 5y agoSo, the problem is not the naming, but autocomplete in Xcode? Or is it impossible to write a good auto-completer for Swift because Swift is rather unique in splitting function names into multiple strings? IIRC, Xcode uses LSP; is that a bottle-neck?