Skip to content

Commit

Permalink
Add Compareable implementation for ModifierPlacement
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Nov 1, 2023
1 parent 2fea1bc commit 947ae44
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@

import SwiftUI

enum ModifierPlacement: Int {
enum ModifierPlacement: Int, Comparable {
case regular
case outermost

static func < (lhs: ModifierPlacement, rhs: ModifierPlacement) -> Bool {
lhs == .regular && rhs == .outermost
}
}


Expand Down Expand Up @@ -41,7 +45,7 @@ extension Module {
var viewModifiers: [any SwiftUI.ViewModifier] {
retrieveProperties(ofType: ViewModifierProvider.self)
.sorted { lhs, rhs in
lhs.placement.rawValue < rhs.placement.rawValue
lhs.placement < rhs.placement
}
.map { provider in
provider.viewModifier
Expand Down

0 comments on commit 947ae44

Please sign in to comment.