I am learning Swift
by myself on MacOS. When following the tutorial and practicing the array function: <array_name>.sort()
, I can get it executed but I always wonder how it works and what is the actual algorithm inside it.
So is there any way to check the certain function definitions?
Asked
Active
Viewed 45 times
0
-
check this out http://stackoverflow.com/questions/27677026/swift-sorting-algorithm-implementation – Laura Calinoiu Mar 15 '17 at 07:10
-
Thanks! I got new jungle to discover! – fryingPan Mar 15 '17 at 07:58
1 Answers
1
If you want to check the declaration of the function/class, you can command-click on it. If you want the documentation, you can either option-click it or check it on the API reference page. If you want to see the implementation details of the Swift standard library, check the source code here at GitHub. If the implementation you are checking is in a non open-source APIs though, you can't quite check it.

jlehr
- 15,557
- 5
- 43
- 45

Papershine
- 4,995
- 2
- 24
- 48
-
Thanks, the cmd-click and option-click unveiled lots of declaration details. – fryingPan Mar 15 '17 at 08:00
-