File tree 11 files changed +117
-15
lines changed
AppStructure/AppOrganization
11 files changed +117
-15
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 7
7
// Status: WIP
8
8
// ID: 4475FD12FD59DEBA453321BD91F6EA04
9
9
10
- #if os(iOS) || os(tvOS)
10
+ #if os(iOS)
11
11
import UIKit
12
- class AppDelegate : UIResponder {
12
+ typealias DelegateBaseClass = UIResponder
13
+ #elseif os(macOS)
14
+ import AppKit
15
+ typealias DelegateBaseClass = NSResponder
16
+ #else
17
+ import Foundation
18
+ // FIXME: Temporarily use NSObject as a placeholder
19
+ typealias DelegateBaseClass = NSObject
20
+ #endif
21
+
22
+ class AppDelegate : DelegateBaseClass {
23
+ #if os(iOS)
13
24
var fallbackDelegate : UIApplicationDelegate ?
14
25
15
26
// WIP
@@ -26,14 +37,5 @@ class AppDelegate: UIResponder {
26
37
let canSelfRespond = AppDelegate . instancesRespond ( to: aSelector)
27
38
return canDelegateRespond || canSelfRespond
28
39
}
40
+ #endif
29
41
}
30
- #elseif os(watchOS)
31
- import WatchKit
32
- class AppDelegate {
33
-
34
- }
35
- #elseif os(macOS)
36
- import AppKit
37
- class AppDelegate {
38
- }
39
- #endif
Load Diff This file was deleted.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #if os(iOS)
2
+ import UIKit
3
+ #elseif os(macOS)
4
+ import AppKit
5
+ #endif
6
+
7
+ class TestingAppDelegate : DelegateBaseClass {
8
+ static var performanceTests : [ _PerformanceTest ] ?
9
+
10
+ #if os(iOS)
11
+ static var connectCallback : ( ( UIWindow ) -> Void ) ?
12
+ #endif
13
+ }
Original file line number Diff line number Diff line change
1
+ public protocol _Benchmark : _Test {
2
+ func measure( host: _BenchmarkHost ) -> [ Double ]
3
+ }
4
+
5
+ extension _TestApp {
6
+ public func runBenchmarks( _ benchmarks: [ _Benchmark ] ) -> Never {
7
+ let _ = RootView ( )
8
+ fatalError ( " TODO " )
9
+ }
10
+ }
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ //
2
+ // _PerformanceTest.swift
3
+ // OpenSwiftUI
4
+ //
5
+ // Created by Kyle on 2023/1/9.
6
+ // Lastest Version: iOS 15.5
7
+ // Status: WIP
8
+
9
+ #if os(iOS)
10
+ import UIKit
11
+ #elseif os(macOS)
12
+ import AppKit
13
+ #endif
14
+
15
+ internal import OpenSwiftUIShims
16
+
17
+ public protocol _PerformanceTest : _Test {
18
+ var name : String { get }
19
+ func runTest( host: _BenchmarkHost , options: [ AnyHashable : Any ] )
20
+ }
21
+
22
+ extension __App {
23
+ public static func _registerPerformanceTests( _ tests: [ _PerformanceTest ] ) {
24
+ TestingAppDelegate . performanceTests = tests
25
+ }
26
+ }
27
+
28
+ extension _TestApp {
29
+ public func runPerformanceTests( _ tests: [ _PerformanceTest ] ) -> Never {
30
+ fatalError ( " TODO " )
31
+ }
32
+ }
33
+
34
+ extension _BenchmarkHost {
35
+ public func _started( test: _PerformanceTest ) {
36
+ #if os(iOS)
37
+ UIApplication . shared. startedTest ( test. name)
38
+ #else
39
+ fatalError ( " TODO " )
40
+ #endif
41
+ }
42
+
43
+ public func _finished( test: _PerformanceTest ) {
44
+ #if os(iOS)
45
+ UIApplication . shared. finishedTest ( test. name)
46
+ #else
47
+ fatalError ( " TODO " )
48
+ #endif
49
+ }
50
+
51
+ public func _failed( test: _PerformanceTest ) {
52
+ #if os(iOS)
53
+ UIApplication . shared. failedTest ( test. name, withFailure: nil )
54
+ #else
55
+ fatalError ( " TODO " )
56
+ #endif
57
+ }
58
+ }
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ //
2
+ // OpenSwiftUI_SPI.h
3
+ //
4
+ //
5
+ // Created by Kyle on 2024/1/9.
6
+ //
7
+
8
+ #ifndef OpenSwiftUI_SPI_h
9
+ #define OpenSwiftUI_SPI_h
10
+
11
+ #if __has_include(<UIKit/UIKit.h>)
12
+ #import < UIKit/UIKit.h>
13
+ @interface UIApplication (OpenSwiftUI_SPI)
14
+ - (void )startedTest : (nullable NSString *)name ;
15
+ - (void )finishedTest : (nullable NSString *)name ;
16
+ - (void )failedTest : (nullable NSString *)name withFailure : (nullable NSError *)failure ;
17
+ @end
18
+ #else
19
+
20
+ #endif
21
+
22
+ #endif /* OpenSwiftUI_SPI_h */
You can’t perform that action at this time.
0 commit comments