Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension to simplify adding requirements #34

Open
Truba opened this issue Jun 10, 2020 · 1 comment
Open

Extension to simplify adding requirements #34

Truba opened this issue Jun 10, 2020 · 1 comment
Assignees

Comments

@Truba
Copy link
Member

Truba commented Jun 10, 2020

Can we add an extension for simplifying addition of requirements, something like this:

options.addRequirement(key: "bluetooth") { (value) -> Bool in
    guard let value = value as? String else { return false }
    // Check device bluetooth version
    return value.starts(with: "5")
}

->

options.addRequirement(key: "bluetooth", ofType: String.self) { $0.starts(with: "5") }
@Filip2Stojanovski
Copy link
Collaborator

Hi @Truba

Thank you for the suggestion. This should be done with the #51 PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants