diff --git a/ios/src_library/React Native/RNIComputable/RNIComputableOffset.swift b/ios/src_library/React Native/RNIComputable/RNIComputableOffset.swift index bb128a08..88d448b2 100644 --- a/ios/src_library/React Native/RNIComputable/RNIComputableOffset.swift +++ b/ios/src_library/React Native/RNIComputable/RNIComputableOffset.swift @@ -40,12 +40,15 @@ public struct RNIComputableOffset { extension RNIComputableOffset { init?(fromDict dict: NSDictionary){ - guard let offset = dict["offset"] as? NSNumber, - let offsetOperationRaw = dict["offsetOperation"] as? String, - let offsetOperation = OffsetOperation(rawValue: offsetOperationRaw) - else { return nil }; - + guard let offset = dict["offset"] as? NSNumber else { return nil }; self.offset = offset.doubleValue; - self.offsetOperation = offsetOperation; + + self.offsetOperation = { + guard let offsetOperationRaw = dict["offsetOperation"] as? String, + let offsetOperation = OffsetOperation(rawValue: offsetOperationRaw) + else { return .add }; + + return offsetOperation; + }(); }; };