@@ -9,33 +9,34 @@ import Foundation
9
9
import UIKit
10
10
import CoreFoundation
11
11
import React
12
+ import CoreGraphics
12
13
13
14
extension RCTConvert {
14
15
static func CGSize( _ json: Any , offset: Int ) -> CGSize {
15
16
let arr = self . nsArray ( json)
16
17
if arr!. count < offset + 2 {
17
18
NSLog ( " Too few elements in array (expected at least %zd): %@ " , 2 + offset, arr!)
18
- return CoreFoundation . CGSize. zero
19
+ return CoreGraphics . CGSize. zero
19
20
}
20
- return CoreFoundation . CGSize ( width: self . cgFloat ( arr![ offset] ) , height: self . cgFloat ( arr![ offset + 1 ] ) )
21
+ return CoreGraphics . CGSize ( width: self . cgFloat ( arr![ offset] ) , height: self . cgFloat ( arr![ offset + 1 ] ) )
21
22
}
22
23
23
24
static func CGPoint( _ json: Any , offset: Int ) -> CGPoint {
24
25
let arr = self . nsArray ( json)
25
26
if arr!. count < offset + 2 {
26
27
NSLog ( " Too few elements in array (expected at least %zd): %@ " , 2 + offset, arr!)
27
- return CoreFoundation . CGPoint. zero
28
+ return CoreGraphics . CGPoint. zero
28
29
}
29
- return CoreFoundation . CGPoint ( x: self . cgFloat ( arr ? [ offset] ) , y: self . cgFloat ( arr![ offset + 1 ] ) )
30
+ return CoreGraphics . CGPoint ( x: self . cgFloat ( arr ? [ offset] ) , y: self . cgFloat ( arr![ offset + 1 ] ) )
30
31
}
31
32
32
33
static func CGRect( _ json: Any , offset: Int ) -> CGRect {
33
34
let arr = self . nsArray ( json)
34
35
if arr!. count < offset + 4 {
35
36
NSLog ( " Too few elements in array (expected at least %zd): %@ " , 4 + offset, arr!)
36
- return CoreFoundation . CGRect. zero
37
+ return CoreGraphics . CGRect. zero
37
38
}
38
- return CoreFoundation . CGRect ( x: self . cgFloat ( arr![ offset] ) , y: self . cgFloat ( arr![ offset + 1 ] ) , width: self . cgFloat ( arr![ offset + 2 ] ) , height: self . cgFloat ( arr![ offset + 3 ] ) )
39
+ return CoreGraphics . CGRect ( x: self . cgFloat ( arr![ offset] ) , y: self . cgFloat ( arr![ offset + 1 ] ) , width: self . cgFloat ( arr![ offset + 2 ] ) , height: self . cgFloat ( arr![ offset + 3 ] ) )
39
40
}
40
41
41
42
static func CGColor( _ json: Any , offset: Int ) -> CGColor ? {
0 commit comments