UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Learning to find, read, and decipher articles in the Xcode Developer documentation.

Forums > 100 Days of SwiftUI

I'd like to make better use of the Xcode DevDocs.

I just completed Checkpoint 5 in 100 Days. The checkpoint uses .filter, .isMultiple (of:), .sorted, and .map functions/methods. I took a look in DevDocs, first searching for and finding 'Array'. But there's no specific mention of the functions/methods. Searching for the functions directly didn't turn up any SwiftUI results.

1) What's the best way to use DevDocs to find and get a better understanding of these and other functions.

2) Are specific functions associated with specific objects like arrays, sets, Integers, Strings, etc. ?

Thanks, jake

3      

@Boxia  

Thanks for Jake sharing this amazing information.

3      

I've been struggling with this myself. Whenever I go to look for a certain term or concept I'm getting either limited information or nothing at all. So anyone with insight on this....please comment lol

3      

I will try to add my two cents, which might help you a bit. I do not consider apple documentation easier to dig into either, however, I am more than sure, more experienced users will say it is much more user friendly now than it is used to be :).

Maybe it is easier to start your search using this link https://developer.apple.com/documentation/technologies

So here you will see different libraries that exist in apple. For example, if you need to dig into more basic things you can refer to Standard Library of Swift Framework https://developer.apple.com/documentation/Swift .On the left side you will see links to Int, String, Array, etc.

Should you need find info on Array properties and methods you can look into this: https://developer.apple.com/documentation/swift/array Which inlcudes functions such as dropLast, dropFirst, sort etc.

For SwiftUI framework you can dig info here https://developer.apple.com/documentation/SwiftUI etc. I think you got the point.

Sometimes it is not so obvious that structure has some method. E.x. you won't see func filter on Array or String by following above links. But if you scroll all the way down on String or Array on the detail side (right side). You will see section Relationships and Conforms to. So this part is Protocols which those structures conforms to, and Sequence protocol has method func filter, so that is why both String and Array can use filter method...

Ugrrrhhh, I know... what the heck.... But this is how it works. BUT no worries with more practice and coding days you are getting used to such things and you will learn what methods are available to different data types. So keep coding and keep learning.

AND sometimes it is just quicker to goole what you want to do and find info :)

3      

You can get most of the same info from within Xcode itself.

If you Option-click on, say, filter (or right-click and choose Show Quick Help), you will get a little popup window with quick help for the function. But at the bottom of the quick help is a link that says Open in Developer Documentation. The only thing that's really missing from the online documentation is the See also section.

Jump to Definition is also very useful, as that takes you to the header files and those often have additional comments and examples to clarify usage of data types, methods, etc.

3      

String is an example of a type for which the documentation of its properties and methods is frustratingly scattered among at least 3 places: String struct, StringProtocol, and NSString.

Michael Tsai (developer of the venerable Spam Sieve app for Mac) strongly recommended in his blog 5 days ago a $15/yr Mac app (free trial) called "Dash" that does fuzzy full-text search of documentation of programming API's including Swift and dozens of others. It includes an Xcode plugin. Might be worth a try, altho I haven’t tried it myself yet.

Incidentally, Michael Tsai's blog (MJTsai) is a great resource for Mac programmers, with interesting comments from seasoned developers.

3      

Hacking with Swift is sponsored by Superwall

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.