Skip to content

Value matching Bool or Int #45

Closed Answered by orchetect
DoubleBaroness asked this question in Q&A
Discussion options

You must be logged in to vote

@DoubleBaroness I have released 1.2.1 which now allows AnyOSCNumberValue to match against an OSC bool value.

That means only a single mask call is needed:

if let (flag, num) = try message.values.masked(AnyOSCNumberValue.self, Int32.self) {
    // flag can be any of the following: int32, int64, float32, double, or bool
    let flagBool = flag.boolValue // convenience property to get Bool
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@orchetect
Comment options

Answer selected by orchetect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
2 participants