Skip to content

Instantly share code, notes, and snippets.

@qmchenry
Created April 22, 2016 20:17
Show Gist options
  • Save qmchenry/56583e257b7b2dd2102c97ac6bdfa1e8 to your computer and use it in GitHub Desktop.
Save qmchenry/56583e257b7b2dd2102c97ac6bdfa1e8 to your computer and use it in GitHub Desktop.
Function to compute priorities for all AUNTiOptions and return a sorted Array of options and priorities
static func priorities(values: AUNTiValues) -> [(priority: Float, option: AUNTiOption)] {
return all.map{ (priority: values.priority(forOption: $0), option: $0) }.sort{ $0.priority > $1.priority }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment