Merge pull request #889 from cloudygeek/patch-1

Update Options.swift
This commit is contained in:
Lorenzo Pichilli 2022-04-15 23:48:03 +02:00 committed by GitHub
commit c41e95a44c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -16,10 +16,8 @@ public class Options<T>: NSObject {
func parse(options: [String: Any?]) -> Options {
for (key, value) in options {
if value != nil, !(value is NSNull) {
if self.responds(to: Selector(key)) {
self.setValue(value, forKey: key)
}
if !(value is NSNull), value != nil, self.responds(to: Selector(key)) {
self.setValue(value, forKey: key)
}
}
return self