-
Notifications
You must be signed in to change notification settings - Fork 29
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
11 changed files
with
104 additions
and
12 deletions.
There are no files selected for viewing
12 changes: 0 additions & 12 deletions
12
Sources/OpenSwiftUI/FrameworkIntegration/TODO/_UIHostingView.swift
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
Sources/OpenSwiftUI/FrameworkIntegration/UIKit/UIHostingController.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,12 @@ | ||
#if os(iOS) | ||
import UIKit | ||
|
||
@available(macOS, unavailable) | ||
@available(watchOS, unavailable) | ||
@MainActor(unsafe) | ||
open class UIHostingController<Content> : UIViewController where Content : View { | ||
override open dynamic var keyCommands: [UIKeyCommand]? { | ||
fatalError("Unimplemented") | ||
} | ||
} | ||
#endif |
15 changes: 15 additions & 0 deletions
15
Sources/OpenSwiftUI/FrameworkIntegration/UIKit/_UIHostingView.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,15 @@ | ||
#if os(iOS) | ||
import UIKit | ||
|
||
@available(macOS, unavailable) | ||
@available(watchOS, unavailable) | ||
@MainActor(unsafe) | ||
open class _UIHostingView<Content>: UIView where Content: View { | ||
@available(macOS, unavailable) | ||
@available(watchOS, unavailable) | ||
final public func _viewDebugData() -> [_ViewDebug.Data] { | ||
// TODO | ||
[] | ||
} | ||
} | ||
#endif |
29 changes: 29 additions & 0 deletions
29
Sources/OpenSwiftUI/FrameworkIntegration/UIKit/_UIHostingViewable.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,29 @@ | ||
#if os(iOS) | ||
import CoreGraphics | ||
|
||
@available(macOS, unavailable) | ||
public protocol _UIHostingViewable: AnyObject { | ||
var rootView: AnyView { get set } | ||
func _render(seconds: Swift.Double) | ||
func _forEachIdentifiedView(body: (_IdentifiedViewProxy) -> Void) | ||
func sizeThatFits(in size: CGSize) -> CGSize | ||
var _disableSafeArea: Bool { get set } | ||
// var _rendererConfiguration: _RendererConfiguration { get set } | ||
var _rendererObject: AnyObject? { get } | ||
} | ||
|
||
//@available(macOS, unavailable) | ||
//extension UIHostingController : _UIHostingViewable where Content == AnyView { | ||
//} | ||
|
||
@available(macOS, unavailable) | ||
public func _makeUIHostingController(_ view: AnyView) -> NSObject & _UIHostingViewable { | ||
fatalError("TODO") | ||
|
||
} | ||
|
||
@available(macOS, unavailable) | ||
public func _makeUIHostingController(_ view: AnyView, tracksContentSize: Swift.Bool) -> NSObject & _UIHostingViewable { | ||
fatalError("TODO") | ||
} | ||
#endif |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,34 @@ | ||
// ID: CE19A3CEA6B9730579C42CE4C3071E74 | ||
|
||
#if canImport(Darwin) | ||
import CoreGraphics | ||
#elseif os(Linux) | ||
import Foundation | ||
#endif | ||
|
||
struct ViewTransform { | ||
private var chunks: ContiguousArray<Chunk> | ||
var positionAdjustment: CGSize | ||
} | ||
|
||
extension ViewTransform { | ||
private class Chunk { | ||
var tags: [Tag] | ||
var values: [CGFloat] | ||
var spaces: [AnyHashable] | ||
init() { | ||
fatalError() | ||
} | ||
|
||
enum Tag { | ||
case translation | ||
case affine | ||
case affine_inverse | ||
case projection | ||
case projection_inverse | ||
case space | ||
case sized_space | ||
case scroll_layout | ||
} | ||
} | ||
} |
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,14 @@ | ||
#if canImport(Darwin) | ||
import CoreGraphics | ||
#elseif os(Linux) | ||
import Foundation | ||
#endif | ||
|
||
public struct _IdentifiedViewProxy { | ||
var identifier: AnyHashable | ||
var size: CGSize | ||
var position: CGPoint | ||
var transform: ViewTransform | ||
var adjustment: (inout CGRect) -> ()? | ||
// var accessibilityNodeStorage: AccessibilityNodeProxy? | ||
} |