4 ms·
There are no examples.
by computerex 7y ago
There are no examples.
- zapzupnz 7y agoThere's no need for examples because initializing objects/structs is such a basic feature of both languages that Apple supports, it should be taken as read that the reader knows how to do it. CIColor.init(red: 0.0, green: 1.0, blue: 0.0, alpha: 1.0) [[CIColor alloc] initWithRed:0.0 green:1.0 blue:0.0 alpha:1.0]
- jrumbut 7y agoNeed may be too strong a word, but I've never seen documentation suffer because there were too many high quality examples. Great documentation uses those examples to shine light on other features that go nicely with (in this case) CIColor or to highlight the right way to do common tasks.
- rurp 7y agoIn addition to this, many developers (such as myself) learn best by example. Seeing a new tool in use is almost always the fastest way for me to grok it.
- zapzupnz 7y agoYeah but, again, we're talking about an initializer. An initializer doesn't need an example other than on the language's documentation page for initializers. The comparison given was totally unfair, as pointed out by another user. Let's look at something more similar to LINQ's Distinct function. Here's the Collection Types page from the Swift book: https://docs.swift.org/swift-book/LanguageGuide/CollectionTypes.html https://docs.swift.org/swift-book/LanguageGuide/CollectionTy... Here's the examples from the API page for Swift's Collection type: https://developer.apple.com/documentation/swift/collection https://developer.apple.com/documentation/swift/collection Or for Sequence, also full of examples: https://developer.apple.com/documentation/swift/sequence https://developer.apple.com/documentation/swift/sequence
- computerex 7y agoHere's a counter-example that someone else pointed out: https://docs.microsoft.com/en-us/dotnet/api/system.drawing.color?view=netcore-3.0 https://docs.microsoft.com/en-us/dotnet/api/system.drawing.c... It's very comparable and highlights the differences and lack of detail in Apple documentation well.