Skip to content

Commit bb16769

Browse files
authored
[Optimize] Remove importing CoreGraphics on Darwin for CGFloat (#45)
1 parent 02d8ca4 commit bb16769

File tree

19 files changed

+0
-76
lines changed

19 files changed

+0
-76
lines changed

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Alignment/AlignmentID.swift

-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
// Audited for RELEASE_2021
66
// Status: Complete
77

8-
#if canImport(Darwin)
9-
import CoreGraphics
10-
#else
118
import Foundation
12-
#endif
139

1410
/// A type that you use to create custom alignment guides.
1511
///

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Alignment/HorizontalAlignment.swift

-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
// Status: Complete
77
// ID: E20796D15DD3D417699102559E024115
88

9-
#if canImport(Darwin)
10-
import CoreGraphics
11-
#else
129
import Foundation
13-
#endif
1410

1511
/// An alignment position along the horizontal axis.
1612
///

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Alignment/VerticalAlignment.swift

-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
// Status: Complete
77
// ID: E20796D15DD3D417699102559E024115
88

9-
#if canImport(Darwin)
10-
import CoreGraphics
11-
#else
129
import Foundation
13-
#endif
1410

1511
/// An alignment position along the vertical axis.
1612
///

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Alignment/ViewDimensions.swift

-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
// Audited for RELEASE_2021
66
// Status: Complete
77

8-
#if canImport(Darwin)
9-
import CoreGraphics
10-
#else
118
import Foundation
12-
#endif
139

1410
/// A view's size and alignment guides in its own coordinate space.
1511
///

Sources/OpenSwiftUI/Layout/LayoutAdjustments/Edge/EdgeInsets.swift

-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
// Audited for RELEASE_2021
66
// Status: Complete
77

8-
#if canImport(Darwin)
9-
import CoreGraphics
10-
#else
118
import Foundation
12-
#endif
139

1410
/// The inset distances for the sides of a rectangle.
1511
@frozen

Sources/OpenSwiftUI/Layout/LayoutFundamentals/Stack/HStack.swift

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#if canImport(Darwin)
2-
import CoreGraphics
3-
#else
41
import Foundation
5-
#endif
62

73
@frozen
84
public struct HStack<Content: View>: PrimitiveView {

Sources/OpenSwiftUI/Layout/LayoutFundamentals/Stack/_HStackLayout.swift

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#if canImport(Darwin)
2-
import CoreGraphics
3-
#else
41
import Foundation
5-
#endif
62

73
@frozen
84
public struct _HStackLayout {

Sources/OpenSwiftUI/Layout/LayoutFundamentals/internal/LayoutComputer.swift

-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
// Audited for RELEASE_2021
66
// Status: WIP
77

8-
#if canImport(Darwin)
9-
import CoreGraphics
10-
#else
118
import Foundation
12-
#endif
139

1410
// TODO:
1511
struct LayoutComputer: Equatable {

Sources/OpenSwiftUI/Layout/LayoutFundamentals/internal/Spacing.swift

-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
// Status: TODO
77
// ID: 127A76D3C8081D0134153BE9AE746714
88

9-
#if canImport(Darwin)
10-
import CoreGraphics
11-
#else
129
import Foundation
13-
#endif
1410

1511
struct Spacing {
1612
// TODO

Sources/OpenSwiftUI/Layout/LayoutFundamentals/internal/_ProposedSize.swift

-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
// Audited for RELEASE_2021
66
// Status: Complete
77

8-
#if canImport(Darwin)
9-
import CoreGraphics
10-
#else
118
import Foundation
12-
#endif
139

1410
struct _ProposedSize: Hashable {
1511
var width: CGFloat?

Sources/OpenSwiftUI/Test/_BenchmarkHost.swift

-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
// Status: Complete
77
// ID: 3E629D505F0A70F29ACFC010AA42C6E0
88

9-
#if canImport(Darwin)
10-
import CoreGraphics
11-
#else
129
import Foundation
13-
#endif
1410

1511
#if canImport(QuartzCore)
1612
import QuartzCore

Sources/OpenSwiftUI/View/Animation/TODO/Animatable.swift

-4
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ extension Animatable where AnimatableData == EmptyAnimatableData {
4141
}
4242
}
4343

44-
#if canImport(Darwin)
45-
import CoreGraphics
46-
#else
4744
import Foundation
48-
#endif
4945

5046
// MARK: - Animatable + CoreGraphics
5147

Sources/OpenSwiftUI/View/Animation/VectorArithmetic.swift

-4
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ extension Double: VectorArithmetic {
5656
}
5757
}
5858

59-
#if canImport(Darwin)
60-
import CoreGraphics
61-
#else
6259
import Foundation
63-
#endif
6460

6561
extension CGFloat: VectorArithmetic {
6662
@_transparent

Sources/OpenSwiftUI/View/Core/IdentifiedViewProxy.swift

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#if canImport(Darwin)
2-
import CoreGraphics
3-
#else
41
import Foundation
5-
#endif
62

73
public struct _IdentifiedViewProxy {
84
var identifier: AnyHashable

Sources/OpenSwiftUI/View/Core/ViewTransform.swift

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// ID: CE19A3CEA6B9730579C42CE4C3071E74
22

3-
#if canImport(Darwin)
4-
import CoreGraphics
5-
#else
63
import Foundation
7-
#endif
84

95
struct ViewTransform {
106
private var chunks: ContiguousArray<Chunk>

Sources/OpenSwiftUI/View/Text/Font/TODO/Font.swift

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#if canImport(Darwin)
2-
import CoreGraphics
3-
#else
41
import Foundation
5-
#endif
62

73
@frozen
84
public struct Font: Hashable {

Sources/OpenSwiftUI/View/Text/Text/TODO/Text.swift

-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
// Audited for RELEASE_2021
66
// Status: Empty
77

8-
#if canImport(Darwin)
9-
import CoreGraphics
10-
#else
118
import Foundation
12-
#endif
139

1410
@frozen
1511
public struct Text: Equatable {

Tests/OpenSwiftUITests/Layout/LayoutAdjustments/Alignment/AlignmentIDTests.swift

-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77

88
@testable import OpenSwiftUI
99
import Testing
10-
#if canImport(Darwin)
11-
import CoreGraphics
12-
#else
1310
import Foundation
14-
#endif
1511

1612
struct AlignmentIDTests {
1713
private struct TestAlignment: AlignmentID {

Tests/OpenSwiftUITests/View/Core/Debug/ViewDebugTests.swift

-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77

88
@testable import OpenSwiftUI
99
import Testing
10-
#if canImport(Darwin)
11-
import CoreGraphics
12-
#else
1310
import Foundation
14-
#endif
1511

1612
struct ViewDebugTests {
1713
@Test(.disabled("Skip the test until we finish the implementation of _ViewDebug"))

0 commit comments

Comments
 (0)