Skip to content

SwiftUI iOS xcode15.0 b1

Alex Soto edited this page Jun 5, 2023 · 2 revisions

#SwiftUI.framework

diff -ruN /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Headers/SwiftUI.h /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Headers/SwiftUI.h
--- /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Headers/SwiftUI.h	2023-03-04 21:46:43
+++ /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Headers/SwiftUI.h	2023-05-26 22:26:51
@@ -1,3 +1,7 @@
 // Copyright © 2015 Apple Inc. All rights reserved.
 
-#import <UIKit/UIKit.h>
+#if !__METAL_VERSION__
+# import <UIKit/UIKit.h>
+#else
+# include <SwiftUI/SwiftUI_Metal.h>
+#endif
diff -ruN /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Headers/SwiftUI_Metal.h /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Headers/SwiftUI_Metal.h
--- /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Headers/SwiftUI_Metal.h	1969-12-31 19:00:00
+++ /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Headers/SwiftUI_Metal.h	2023-05-26 22:26:51
@@ -0,0 +1,31 @@
+// Copyright © 2022 Apple Inc. All rights reserved.
+
+#ifndef SWIFTUI_METAL_H
+#define SWIFTUI_METAL_H
+
+#if __METAL_VERSION__
+
+#include <metal_stdlib>
+
+namespace SwiftUI {
+
+/// A region of a rasterized layer.
+struct Layer {
+  metal::texture2d<half> tex;
+  float2 info[5];
+
+  /// Samples the layer at `p`, in user-space coordinates,
+  /// interpolating linearly between pixel values. Returns an RGBA
+  /// pixel value, with color components premultipled by alpha (i.e.
+  /// [R*A, G*A, B*A, A]), in the layer's working color space.
+  half4 sample(float2 p) const {
+    p = metal::fma(p.x, info[0], metal::fma(p.y, info[1], info[2]));
+    p = metal::clamp(p, info[3], info[4]);
+    return tex.sample(metal::sampler(metal::filter::linear), p);
+  }
+};
+
+} // namespace SwiftUI
+
+#endif // __METAL_VERSION__
+#endif // SWIFTUI_METAL_H
Clone this wiki locally