Hi guys,
I have an enhancement requestion that I think would help a lot of developers, especially those new to Swift.
The current developer documentation is awfully sparse on details, code examples, and a lot of the time the syntax shown is very confusing. I think it would be helpful if Apple did what Microsoft does and have a "feedback" section at the bottom of their documentation pages that people can offer suggestions about.
Take for example the page on addTarget, it lists it's declaration as this:
func addTarget(_ target: Any?, action: Selector, for controlEvents: UIControlEvents)
Yet to get it to work, you have to do this:
func addTarget( self, action: #selector(myFunctionToCall), for .touchUpInside)
To me this seems like an error in the documentation since not only is there no mention of #selector (Selector looks like a type in the defintion) but also the controlEvents parameter is completely dropped, despite there being no _ infront of it, making it inconsistent with other code.
There's no code snippet on this page either to see an example of how to use it, it's just expected that people know it.
I think allowing people to provide feedback for individual pages would be very useful and would help get Apples documentation up to speed. I hate to say it but Microsoft does an excellent job with their documents. There are code snippets, examples, and information galore for every class.