Xcode-beta (8S162m): Documentation: Return types should be shown in lists of methods in Swift API reference docs
| Originator: | Karoly.Lorentey | ||
| Number: | rdar://27370972 | Date Originated: | 15-Jul-2016 02:18 PM |
| Status: | Open | Resolved: | |
| Product: | Documentation | Product Version: | Xcode-beta (8S162m) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
The new unified API reference documentation in Xcode 8 works very well (thank you!). However, on Swift class/struct documentation pages, methods are listed with simplified signatures that include the type of every parameter, but not their return type. I find this misleading and surprising; I think showing the return type would be much clearer.
Steps to Reproduce:
1. Open the API reference page for String, and browse it to find a method that looks like what you need, say, range(of:options:range:locale:).
https://developer.apple.com/reference/swift/string
2. Find the following info:
func range(of: String, options: CompareOptions, range: Range<Index>?, locale: Locale?)
Finds and returns the range of the first occurrence of a given string within a given range of the String, subject to given options, using the specified locale, if any.
[Beta]
3. Become confused because the method seems to have no return value, even though the documentation extract talks about it.
Expected Results:
I’d expect to see the type of the return value in the simplified method signature that is shown in the method list.
Actual Results:
The return type is elided.
Regression:
I believe this is new with Xcode 8.
Notes:
These simplified signatures in Swift method lists also do not
- mark parameters with a default value
- include the actual argument name used in the definition
- include type constraints of generic functions.
I am OK with not having these; I agree with the desire to extract only the most essential info.
In Objective-C docs, only selector names are displayed, which I think is also fine, in the context of Objective-C. (It would be less so in Swift.)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!