Follow

Time to make this table view able to hold generic sections. Let's see the key needs to be Hashable, Comparable, and CustomStringConvertible. I could use a type alias or a protocol.

Hmm… the complier doesn't like those. I guess I need a struct to hold the string and then conform to hashable, and… wait

*faceplam*

String itself does all of this 🙃

Oops… I forgot I'd customized the sort order of my custom type, so I actually do need to use a struct that can encapsulate two variables.

Sign in to participate in the conversation
Mastodon

emory.coffee is one server in the network