TipKit Rule won't compile

    static let hoverEvent: Event = Event(id: "hoverEvent")
    /// Parameters-Rules
    @Parameter
    static var isHovering: Bool = false
    static var tipCountKey = "UserTipCount"

    var title: Text
    var message: Text?
    var image: Image?
    var tipShownLimit: Int
    @ObservedObject var buttonState: ButtonState
    
    var rules: [Rule] {
        #Rule(Self.hoverEvent) {
            $0.donations.count < tipShownLimit
        }
    }
}

error: Event Rules require a count comparison. If I replace tipShownLimit like this: var rules: [Rule] { #Rule(Self.hoverEvent) { $0.donations.count < 3 } }

it compiles fine. the error is: Event Rules require a count comparison.

Replies

Missed the first line of code:

    static let hoverEvent: Event = Event(id: "hoverEvent")
    /// Parameters-Rules
    @Parameter
    static var isHovering: Bool = false
    static var tipCountKey = "UserTipCount"

    var title: Text
    var message: Text?
    var image: Image?
    var tipShownLimit: Int
    @ObservedObject var buttonState: ButtonState

    var rules: [Rule] {
        [
        #Rule(Self.$isHovering) {
            $0 == true
        },
        #Rule(Self.hoverEvent) {
                $0.donations.count < 10
            }
        ]
    }
}

first line of code:

struct UserTip: Tip {