title: How do I add multiple static funcs to compare my json data multiple ways in my model using Comparable?
body: <pre><code>struct Categories:Identifiable, Decodable, Hashable, Comparable {
      
      static func &lt; (lhs: Categories, rhs: Categories) -&gt; Bool {
          
          lhs.name&lt;rhs.name
          
      }
      
      static func &lt; (lhs: Categories, rhs: Categories) -&gt; Bool {
          
          lhs.cost&lt;rhs.cost
          
      }
      
      
      var id = UUID()
      var name:String = &quot;&quot;
      var cost:String = &quot;&quot;
      var pic:String = &quot;&quot;
      var description:String = &quot;&quot;
      var reviews:String = &quot;&quot;
      var stars:String = &quot;&quot;
      var phoneNumber:String = &quot;&quot;
      var type:String = &quot;&quot;
      
      
      
  }
  </code></pre>
  <p>This gives me an error obviously, I was wondering how I could have multiple functions for multiple ways of sorting my json data so I can sort my data different ways at a press of a button</p>