Skip to content

Commit

Permalink
💫 Update: RNIComputableOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Apr 28, 2023
1 parent 86e2397 commit 501190c
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}();
};
};

0 comments on commit 501190c

Please sign in to comment.