Skip to content

Instantly share code, notes, and snippets.

@csknns
Last active October 1, 2022 09:18
Show Gist options
  • Save csknns/afdb9dc3a76bb2a52017564b611ba375 to your computer and use it in GitHub Desktop.
Save csknns/afdb9dc3a76bb2a52017564b611ba375 to your computer and use it in GitHub Desktop.
// Hold the filter and the closure that updates its value
var filtersAndValueUpdaters: [ (Filter, ((Float, Int) -> Void)) ] = []
// The selected filter has also the closure that updates its value
var selectedfilter: (Filter, (Float, Int) -> Void)
let filterA = FilterA()
filtersAndValueUpdaters.append((filterA, { [weak filterA] value, _ in
filterA?.param = value
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment