-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,61 @@ | ||
// | ||
// OpenSwiftUI_SPI.h | ||
// | ||
// OpenSwiftUI | ||
// | ||
// | ||
|
||
#ifndef OpenSwiftUI_SPI_h | ||
#define OpenSwiftUI_SPI_h | ||
|
||
#include "OpenSwiftUIBase.h" | ||
|
||
#if __has_include(<QuartzCore/CoreAnimation.h>) | ||
|
||
#import <QuartzCore/CoreAnimation.h> | ||
|
||
OPENSWIFTUI_ASSUME_NONNULL_BEGIN | ||
|
||
@interface CALayer (OpenSwiftUI_SPI) | ||
- (BOOL)hasBeenCommitted; | ||
@end | ||
|
||
OPENSWIFTUI_ASSUME_NONNULL_END | ||
|
||
#endif /* CoreAnimation.h */ | ||
|
||
#if __has_include(<UIKit/UIKit.h>) | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
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(<AppKit/AppKit.h>) | ||
|
||
#import <AppKit/AppKit.h> | ||
|
||
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 */ |
21 changes: 21 additions & 0 deletions
21
Sources/OpenSwiftUI/Integration/UIKit/_UIGraphicsView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |