Skip to content

Commit

Permalink
⭐️ Impl: Add CGSize+Init
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Apr 28, 2023
1 parent a2bc44f commit 1810e29
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ios/src_library/Extensions+Init/CGSize+Init.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// CGSize+Init.swift
// react-native-ios-modal
//
// Created by Dominic Go on 4/28/23.
//

import Foundation

public extension CGSize {
init?(fromDict dict: NSDictionary){
guard let width = dict["width"] as? NSNumber,
let height = dict["height"] as? NSNumber
else { return nil };

self.init(
width: width.doubleValue,
height: height.doubleValue
);
};
};

0 comments on commit 1810e29

Please sign in to comment.