4 ms·
I was surprised this example didn't take advantage of Swift's built-in Comparable protocol, so I rewrote it! I also wrote an example of how you can implement th
by dstaley 12y ago
I was surprised this example didn't take advantage of Swift's built-in Comparable protocol, so I rewrote it! I also wrote an example of how you can implement the Comparable protocol for a struct, so that they can then be sorted.
https://gist.github.com/dstaley/e7171375d3f5cb9f2fe4 https://gist.github.com/dstaley/e7171375d3f5cb9f2fe4