From 909fb8471b5f8544ec4228e6fd5f8d98192ede6c Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 11 Mar 2024 01:37:37 +0800 Subject: [PATCH 1/4] [Optimize] Update LinkDestination location --- .../View/Control/Link/{internal => }/LinkDestination.swift | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Sources/OpenSwiftUI/View/Control/Link/{internal => }/LinkDestination.swift (100%) diff --git a/Sources/OpenSwiftUI/View/Control/Link/internal/LinkDestination.swift b/Sources/OpenSwiftUI/View/Control/Link/LinkDestination.swift similarity index 100% rename from Sources/OpenSwiftUI/View/Control/Link/internal/LinkDestination.swift rename to Sources/OpenSwiftUI/View/Control/Link/LinkDestination.swift From 02d363f001f663553514732266c2c5d18126c2ab Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 11 Mar 2024 01:38:21 +0800 Subject: [PATCH 2/4] Fix warnings in CoreServices.xcframework --- .../Headers/Private/LSApplicationWorkspace.h | 5 +++-- .../Headers/Private/_LSOpenConfiguration.h | 8 +++++--- .../Headers/Private/LSApplicationWorkspace.h | 5 +++-- .../Headers/Private/_LSOpenConfiguration.h | 8 +++++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/PrivateFrameworks/CoreServices.xcframework/ios-arm64-arm64e/CoreServices.framework/Headers/Private/LSApplicationWorkspace.h b/PrivateFrameworks/CoreServices.xcframework/ios-arm64-arm64e/CoreServices.framework/Headers/Private/LSApplicationWorkspace.h index a69115b7..9ccdc846 100644 --- a/PrivateFrameworks/CoreServices.xcframework/ios-arm64-arm64e/CoreServices.framework/Headers/Private/LSApplicationWorkspace.h +++ b/PrivateFrameworks/CoreServices.xcframework/ios-arm64-arm64e/CoreServices.framework/Headers/Private/LSApplicationWorkspace.h @@ -9,8 +9,9 @@ #import #import "_LSOpenConfiguration.h" +NS_ASSUME_NONNULL_BEGIN @interface LSApplicationWorkspace : NSObject +(nullable instancetype)defaultWorkspace; --(void)openURL:(nonnull NSURL *)url configuration:(nonnull _LSOpenConfiguration *)config completionHandler:(void (^ _Nonnull)(BOOL))completion; - +-(void)openURL:(NSURL *)url configuration:(_LSOpenConfiguration *)config completionHandler:(void (^)(BOOL))completion; @end +NS_ASSUME_NONNULL_END diff --git a/PrivateFrameworks/CoreServices.xcframework/ios-arm64-arm64e/CoreServices.framework/Headers/Private/_LSOpenConfiguration.h b/PrivateFrameworks/CoreServices.xcframework/ios-arm64-arm64e/CoreServices.framework/Headers/Private/_LSOpenConfiguration.h index a05ed0f4..b3e5ec96 100644 --- a/PrivateFrameworks/CoreServices.xcframework/ios-arm64-arm64e/CoreServices.framework/Headers/Private/_LSOpenConfiguration.h +++ b/PrivateFrameworks/CoreServices.xcframework/ios-arm64-arm64e/CoreServices.framework/Headers/Private/_LSOpenConfiguration.h @@ -8,12 +8,14 @@ #import +NS_ASSUME_NONNULL_BEGIN @interface _LSOpenConfiguration : NSObject @property(assign, getter=isSensitive,nonatomic) BOOL sensitive; @property(nonatomic, retain, nullable) id targetConnectionEndpoint; --(nonnull instancetype)init; +-(instancetype)init; -(BOOL)isSensitive; -(void)setSensitive:(BOOL)sensitive; --(void)setTargetConnectionEndpoint:(id)endpoint ; --(id)targetConnectionEndpoint; +-(void)setTargetConnectionEndpoint:(nullable id)endpoint ; +-(nullable id)targetConnectionEndpoint; @end +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/PrivateFrameworks/CoreServices.xcframework/ios-arm64-x86_64-simulator/CoreServices.framework/Headers/Private/LSApplicationWorkspace.h b/PrivateFrameworks/CoreServices.xcframework/ios-arm64-x86_64-simulator/CoreServices.framework/Headers/Private/LSApplicationWorkspace.h index a69115b7..9ccdc846 100644 --- a/PrivateFrameworks/CoreServices.xcframework/ios-arm64-x86_64-simulator/CoreServices.framework/Headers/Private/LSApplicationWorkspace.h +++ b/PrivateFrameworks/CoreServices.xcframework/ios-arm64-x86_64-simulator/CoreServices.framework/Headers/Private/LSApplicationWorkspace.h @@ -9,8 +9,9 @@ #import #import "_LSOpenConfiguration.h" +NS_ASSUME_NONNULL_BEGIN @interface LSApplicationWorkspace : NSObject +(nullable instancetype)defaultWorkspace; --(void)openURL:(nonnull NSURL *)url configuration:(nonnull _LSOpenConfiguration *)config completionHandler:(void (^ _Nonnull)(BOOL))completion; - +-(void)openURL:(NSURL *)url configuration:(_LSOpenConfiguration *)config completionHandler:(void (^)(BOOL))completion; @end +NS_ASSUME_NONNULL_END diff --git a/PrivateFrameworks/CoreServices.xcframework/ios-arm64-x86_64-simulator/CoreServices.framework/Headers/Private/_LSOpenConfiguration.h b/PrivateFrameworks/CoreServices.xcframework/ios-arm64-x86_64-simulator/CoreServices.framework/Headers/Private/_LSOpenConfiguration.h index a05ed0f4..b3e5ec96 100644 --- a/PrivateFrameworks/CoreServices.xcframework/ios-arm64-x86_64-simulator/CoreServices.framework/Headers/Private/_LSOpenConfiguration.h +++ b/PrivateFrameworks/CoreServices.xcframework/ios-arm64-x86_64-simulator/CoreServices.framework/Headers/Private/_LSOpenConfiguration.h @@ -8,12 +8,14 @@ #import +NS_ASSUME_NONNULL_BEGIN @interface _LSOpenConfiguration : NSObject @property(assign, getter=isSensitive,nonatomic) BOOL sensitive; @property(nonatomic, retain, nullable) id targetConnectionEndpoint; --(nonnull instancetype)init; +-(instancetype)init; -(BOOL)isSensitive; -(void)setSensitive:(BOOL)sensitive; --(void)setTargetConnectionEndpoint:(id)endpoint ; --(id)targetConnectionEndpoint; +-(void)setTargetConnectionEndpoint:(nullable id)endpoint ; +-(nullable id)targetConnectionEndpoint; @end +NS_ASSUME_NONNULL_END \ No newline at end of file From c24926bfd084eec7a2aa97882185f7fa00394082 Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 11 Mar 2024 01:38:34 +0800 Subject: [PATCH 3/4] Add _UIGraphicsView implementation --- .../COpenSwiftUI/include/OpenSwiftUI_SPI.h | 38 ++++++++++++++++++- .../Integration/UIKit/_UIGraphicsView.swift | 21 ++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 Sources/OpenSwiftUI/Integration/UIKit/_UIGraphicsView.swift diff --git a/Sources/COpenSwiftUI/include/OpenSwiftUI_SPI.h b/Sources/COpenSwiftUI/include/OpenSwiftUI_SPI.h index fa28bc2c..f29b2fff 100644 --- a/Sources/COpenSwiftUI/include/OpenSwiftUI_SPI.h +++ b/Sources/COpenSwiftUI/include/OpenSwiftUI_SPI.h @@ -1,27 +1,61 @@ // // OpenSwiftUI_SPI.h -// +// OpenSwiftUI // // #ifndef OpenSwiftUI_SPI_h #define OpenSwiftUI_SPI_h +#include "OpenSwiftUIBase.h" + +#if __has_include() + +#import + +OPENSWIFTUI_ASSUME_NONNULL_BEGIN + +@interface CALayer (OpenSwiftUI_SPI) +- (BOOL)hasBeenCommitted; +@end + +OPENSWIFTUI_ASSUME_NONNULL_END + +#endif /* CoreAnimation.h */ + #if __has_include() + #import + +OPENSWIFTUI_ASSUME_NONNULL_BEGIN + @interface UIApplication (OpenSwiftUI_SPI) - (void)startedTest:(nullable NSString *)name; - (void)finishedTest:(nullable NSString *)name; - (void)failedTest:(nullable NSString *)name withFailure:(nullable NSError*)failure; - (nullable NSString *)_launchTestName; @end + +@interface UIView (OpenSwiftUI_SPI) +- (BOOL)_shouldAnimatePropertyWithKey:(NSString *)key; +@end + +OPENSWIFTUI_ASSUME_NONNULL_END + #elif __has_include() + #import + +OPENSWIFTUI_ASSUME_NONNULL_BEGIN + @interface NSApplication (OpenSwiftUI_SPI) - (void)startedTest:(nullable NSString *)name; - (void)finishedTest:(nullable NSString *)name; - (void)failedTest:(nullable NSString *)name withFailure:(nullable NSError*)failure; @end -#endif + +OPENSWIFTUI_ASSUME_NONNULL_END + +#endif /* UIKit.h / AppKit.h */ #endif /* OpenSwiftUI_SPI_h */ diff --git a/Sources/OpenSwiftUI/Integration/UIKit/_UIGraphicsView.swift b/Sources/OpenSwiftUI/Integration/UIKit/_UIGraphicsView.swift new file mode 100644 index 00000000..0790c641 --- /dev/null +++ b/Sources/OpenSwiftUI/Integration/UIKit/_UIGraphicsView.swift @@ -0,0 +1,21 @@ +// +// _UIGraphicsView.swift +// OpenSwiftUI +// +// Audited for RELEASE_2021 +// Status: Complete + +#if os(iOS) +internal import COpenSwiftUI +import UIKit + +class _UIGraphicsView: UIView { + override func _shouldAnimateProperty(withKey key: String) -> Bool { + if layer.hasBeenCommitted() { + super._shouldAnimateProperty(withKey: key) + } else { + false + } + } +} +#endif From c91d9b826b41106d9f97aaff25e9256e478071cc Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 11 Mar 2024 01:40:41 +0800 Subject: [PATCH 4/4] Update header file's header information --- Sources/COpenSwiftUI/include/LockedPointer.h | 5 +++-- Sources/COpenSwiftUI/include/OpenSwiftUIBase.h | 5 +++-- Sources/COpenSwiftUI/include/OpenSwiftUI_SPI.h | 3 ++- Sources/COpenSwiftUI/include/ProtocolDescriptor.h | 5 +++-- Sources/COpenSwiftUI/include/TLS.h | 5 +++-- Sources/COpenSwiftUI/include/dyld_Private.h | 5 +++-- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Sources/COpenSwiftUI/include/LockedPointer.h b/Sources/COpenSwiftUI/include/LockedPointer.h index 19462741..caf4fefd 100644 --- a/Sources/COpenSwiftUI/include/LockedPointer.h +++ b/Sources/COpenSwiftUI/include/LockedPointer.h @@ -1,8 +1,9 @@ // // LockedPointer.h -// -// +// OpenSwiftUI // +// Audited for RELEASE_2021 +// Status: Complete #ifndef LockedPointer_h #define LockedPointer_h diff --git a/Sources/COpenSwiftUI/include/OpenSwiftUIBase.h b/Sources/COpenSwiftUI/include/OpenSwiftUIBase.h index fd0876d8..245a789c 100644 --- a/Sources/COpenSwiftUI/include/OpenSwiftUIBase.h +++ b/Sources/COpenSwiftUI/include/OpenSwiftUIBase.h @@ -1,8 +1,9 @@ // // OpenSwiftUIBase.h -// -// +// OpenSwiftUI // +// Audited for RELEASE_2021 +// Status: Complete #ifndef OpenSwiftUIBase_h #define OpenSwiftUIBase_h diff --git a/Sources/COpenSwiftUI/include/OpenSwiftUI_SPI.h b/Sources/COpenSwiftUI/include/OpenSwiftUI_SPI.h index f29b2fff..28030a5d 100644 --- a/Sources/COpenSwiftUI/include/OpenSwiftUI_SPI.h +++ b/Sources/COpenSwiftUI/include/OpenSwiftUI_SPI.h @@ -2,7 +2,8 @@ // OpenSwiftUI_SPI.h // OpenSwiftUI // -// +// Audited for RELEASE_2021 +// Status: WIP #ifndef OpenSwiftUI_SPI_h #define OpenSwiftUI_SPI_h diff --git a/Sources/COpenSwiftUI/include/ProtocolDescriptor.h b/Sources/COpenSwiftUI/include/ProtocolDescriptor.h index 9827fc13..ab4adcfc 100644 --- a/Sources/COpenSwiftUI/include/ProtocolDescriptor.h +++ b/Sources/COpenSwiftUI/include/ProtocolDescriptor.h @@ -1,8 +1,9 @@ // // ProtocolDescriptor_h +// OpenSwiftUI // -// -// +// Audited for RELEASE_2021 +// Status: WIP #ifndef ProtocolDescriptor_h #define ProtocolDescriptor_h diff --git a/Sources/COpenSwiftUI/include/TLS.h b/Sources/COpenSwiftUI/include/TLS.h index ae10c112..c2d54e18 100644 --- a/Sources/COpenSwiftUI/include/TLS.h +++ b/Sources/COpenSwiftUI/include/TLS.h @@ -1,8 +1,9 @@ // // TLS.h -// -// +// OpenSwiftUI // +// Audited for RELEASE_2021 +// Status: Complete #ifndef TLS_h #define TLS_h diff --git a/Sources/COpenSwiftUI/include/dyld_Private.h b/Sources/COpenSwiftUI/include/dyld_Private.h index 4a823c11..5da6b716 100644 --- a/Sources/COpenSwiftUI/include/dyld_Private.h +++ b/Sources/COpenSwiftUI/include/dyld_Private.h @@ -1,8 +1,9 @@ // // dyld_Private.h +// OpenSwiftUI // -// -// +// Audited for RELEASE_2021 +// Status: Complete #ifndef dyld_Private_h #define dyld_Private_h