Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation
import OpenQuartzCoreShims
import UIFoundation_Private

protocol _DisplayList_ViewUpdater_AsyncLayerProperty {
associatedtype Value
Expand Down Expand Up @@ -106,7 +107,7 @@

static func boxValue(_ value: CGPoint) -> NSObject {
#if canImport(QuartzCore)
NSValue(point: value)
NSValue(cgPoint: value)

Check failure on line 110 in Sources/OpenSwiftUICore/Render/DisplayList/DisplayListAsyncLayer.swift

View workflow job for this annotation

GitHub Actions / Execute compatibility tests for iOS (macos-15, 16.4, 2024, 18.5)

incorrect argument label in call (have 'cgPoint:', expected 'nonretainedObject:')

Check failure on line 110 in Sources/OpenSwiftUICore/Render/DisplayList/DisplayListAsyncLayer.swift

View workflow job for this annotation

GitHub Actions / Execute tests on iOS (macos-15, 16.4, 2024, 18.5)

incorrect argument label in call (have 'cgPoint:', expected 'nonretainedObject:')

Check failure on line 110 in Sources/OpenSwiftUICore/Render/DisplayList/DisplayListAsyncLayer.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

incorrect argument label in call (have 'cgPoint:', expected 'point:')

Check failure on line 110 in Sources/OpenSwiftUICore/Render/DisplayList/DisplayListAsyncLayer.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

incorrect argument label in call (have 'cgPoint:', expected 'point:')

Check failure on line 110 in Sources/OpenSwiftUICore/Render/DisplayList/DisplayListAsyncLayer.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

incorrect argument label in call (have 'cgPoint:', expected 'nonretainedObject:')
#else
_openSwiftUIPlatformUnimplementedFailure()
#endif
Expand All @@ -118,7 +119,7 @@

static func boxValue(_ value: CGRect) -> NSObject {
#if canImport(QuartzCore)
NSValue(rect: value)
NSValue(cgRect: value)

Check failure on line 122 in Sources/OpenSwiftUICore/Render/DisplayList/DisplayListAsyncLayer.swift

View workflow job for this annotation

GitHub Actions / Execute compatibility tests for iOS (macos-15, 16.4, 2024, 18.5)

incorrect argument label in call (have 'cgRect:', expected 'nonretainedObject:')

Check failure on line 122 in Sources/OpenSwiftUICore/Render/DisplayList/DisplayListAsyncLayer.swift

View workflow job for this annotation

GitHub Actions / Execute tests on iOS (macos-15, 16.4, 2024, 18.5)

incorrect argument label in call (have 'cgRect:', expected 'nonretainedObject:')

Check failure on line 122 in Sources/OpenSwiftUICore/Render/DisplayList/DisplayListAsyncLayer.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

incorrect argument label in call (have 'cgRect:', expected 'rect:')

Check failure on line 122 in Sources/OpenSwiftUICore/Render/DisplayList/DisplayListAsyncLayer.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

incorrect argument label in call (have 'cgRect:', expected 'rect:')
#else
_openSwiftUIPlatformUnimplementedFailure()
#endif
Expand Down
3 changes: 2 additions & 1 deletion Sources/OpenSwiftUICore/Shape/ShapeLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Foundation
import OpenQuartzCoreShims
import OpenSwiftUI_SPI
import UIFoundation_Private
// import OpenRenderBoxShims

// MARK: - ShapeLayerHelper [WIP]
Expand Down Expand Up @@ -175,7 +176,7 @@

static func boxValue(_ value: CGSize) -> NSObject {
#if canImport(Darwin)
NSValue(size: value)
NSValue(cgSize: value)

Check failure on line 179 in Sources/OpenSwiftUICore/Shape/ShapeLayer.swift

View workflow job for this annotation

GitHub Actions / Execute compatibility tests for iOS (macos-15, 16.4, 2024, 18.5)

incorrect argument label in call (have 'cgSize:', expected 'nonretainedObject:')

Check failure on line 179 in Sources/OpenSwiftUICore/Shape/ShapeLayer.swift

View workflow job for this annotation

GitHub Actions / Execute tests on iOS (macos-15, 16.4, 2024, 18.5)

incorrect argument label in call (have 'cgSize:', expected 'nonretainedObject:')

Check failure on line 179 in Sources/OpenSwiftUICore/Shape/ShapeLayer.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

incorrect argument label in call (have 'cgSize:', expected 'size:')

Check failure on line 179 in Sources/OpenSwiftUICore/Shape/ShapeLayer.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

incorrect argument label in call (have 'cgSize:', expected 'size:')

Check failure on line 179 in Sources/OpenSwiftUICore/Shape/ShapeLayer.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

incorrect argument label in call (have 'cgSize:', expected 'nonretainedObject:')
#else
_openSwiftUIPlatformUnimplementedFailure()
#endif
Expand Down
26 changes: 26 additions & 0 deletions Sources/OpenSwiftUI_SPI/Shims/UIFoundation/UIGeometry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// UIGeometry.h
// OpenSwiftUI_SPI

#pragma once

#include "OpenSwiftUIBase.h"

#if OPENSWIFTUI_TARGET_OS_DARWIN

#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>

OPENSWIFTUI_ASSUME_NONNULL_BEGIN

@interface NSValue (OpenSwiftUI_UIGeometry)

+ (NSValue *)valueWithCGPoint_openswiftui_safe_wrapper:(CGPoint)point OPENSWIFTUI_SWIFT_NAME(init(cgPoint:));
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valueWithCGPoint_openswiftui_safe_wrapper/valueWithCGSize_openswiftui_safe_wrapper/valueWithCGRect_openswiftui_safe_wrapper look like Swift-mapped initializers; consider returning instancetype instead of NSValue * so Swift imports them as returning Self (and it stays correct if NSValue is subclassed/class-clustered).

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

+ (NSValue *)valueWithCGSize_openswiftui_safe_wrapper:(CGSize)size OPENSWIFTUI_SWIFT_NAME(init(cgSize:));
+ (NSValue *)valueWithCGRect_openswiftui_safe_wrapper:(CGRect)rect OPENSWIFTUI_SWIFT_NAME(init(cgRect:));

@end

OPENSWIFTUI_ASSUME_NONNULL_END

#endif /* OPENSWIFTUI_TARGET_OS_DARWIN */
55 changes: 55 additions & 0 deletions Sources/OpenSwiftUI_SPI/Shims/UIFoundation/UIGeometry.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// UIGeometry.m
// OpenSwiftUI_SPI

#import "UIGeometry.h"

#if OPENSWIFTUI_TARGET_OS_DARWIN

#import <objc/runtime.h>

OPENSWIFTUI_ASSUME_NONNULL_BEGIN

@implementation NSValue (OpenSwiftUI_UIGeometry)

+ (NSValue *)valueWithCGPoint_openswiftui_safe_wrapper:(CGPoint)point {
SEL selector = NSSelectorFromString(@"valueWithCGPoint:");
if ([self respondsToSelector:selector]) {
typedef NSValue *(*Func)(id, SEL, CGPoint);
Func func = (Func)class_getMethodImplementation(object_getClass(self), selector);
if (func != nil) {
return func(self, selector, point);
}
}
return [self valueWithBytes:&point objCType:@encode(CGPoint)];
}

+ (NSValue *)valueWithCGSize_openswiftui_safe_wrapper:(CGSize)size {
SEL selector = NSSelectorFromString(@"valueWithCGSize:");
if ([self respondsToSelector:selector]) {
typedef NSValue *(*Func)(id, SEL, CGSize);
Func func = (Func)class_getMethodImplementation(object_getClass(self), selector);
if (func != nil) {
return func(self, selector, size);
}
}
return [self valueWithBytes:&size objCType:@encode(CGSize)];
}

+ (NSValue *)valueWithCGRect_openswiftui_safe_wrapper:(CGRect)rect {
SEL selector = NSSelectorFromString(@"valueWithCGRect:");
if ([self respondsToSelector:selector]) {
typedef NSValue *(*Func)(id, SEL, CGRect);
Func func = (Func)class_getMethodImplementation(object_getClass(self), selector);
if (func != nil) {
return func(self, selector, rect);
}
}
return [self valueWithBytes:&rect objCType:@encode(CGRect)];
}

@end

OPENSWIFTUI_ASSUME_NONNULL_END

#endif /* OPENSWIFTUI_TARGET_OS_DARWIN */
Loading