Improves KVOObservable code.

This commit is contained in:
Krunoslav Zaher 2016-07-08 00:20:24 +02:00
parent e2edffc39d
commit edf423d42e
1 changed files with 1 additions and 2 deletions

View File

@ -104,8 +104,7 @@ func observeWeaklyKeyPathFor(
let propertyAttributes = property_getAttributes(property)
// should dealloc hook be in place if week property, or just create strong reference because it doesn't matter
let propertyAttributesAsString = propertyAttributes == nil ? "" : String(cString: propertyAttributes!)
let isWeak = isWeakProperty(propertyAttributesAsString)
let isWeak = isWeakProperty(propertyAttributes.map(String.init) ?? "")
let propertyObservable = KVOObservable(object: target, keyPath: propertyName, options: options.union(.initial), retainTarget: false) as KVOObservable<AnyObject>
// KVO recursion for value changes