diff --git a/Session/Media Viewing & Editing/MessageInfoView.swift b/Session/Media Viewing & Editing/MessageInfoView.swift index 50822724a..dfc8d7350 100644 --- a/Session/Media Viewing & Editing/MessageInfoView.swift +++ b/Session/Media Viewing & Editing/MessageInfoView.swift @@ -475,7 +475,7 @@ final class MessageInfoViewController: SessionHostingViewController: UIHostingController where Content : View { +public class HostWrapper: ObservableObject { + public weak var controller: UIViewController? +} + +public class SessionHostingViewController: UIHostingController>> where Content : View { public override var preferredStatusBarStyle: UIStatusBarStyle { return ThemeManager.currentTheme.statusBarStyle } @@ -28,6 +32,17 @@ public class SessionHostingViewController: UIHostingController return result }() + public init(rootView:Content) { + let container = HostWrapper() + let modified = rootView.environmentObject(container) as! ModifiedContent> + super.init(rootView: modified) + container.controller = self + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + public override func viewDidLoad() { super.viewDidLoad() diff --git a/SessionUIKit/Components/AttributedText.swift b/SessionUIKit/Components/AttributedText.swift index f5f14816c..b5707fd64 100644 --- a/SessionUIKit/Components/AttributedText.swift +++ b/SessionUIKit/Components/AttributedText.swift @@ -33,7 +33,6 @@ public struct AttributedText: View { } public var body: some View { - let _ = print(descriptions) descriptions.map { description in var text: Text = Text(description.content) if let font: Font = description.font { text = text.font(font) } diff --git a/SessionUIKit/Components/SessionTextField.swift b/SessionUIKit/Components/SessionTextField.swift new file mode 100644 index 000000000..346868edc --- /dev/null +++ b/SessionUIKit/Components/SessionTextField.swift @@ -0,0 +1,15 @@ +// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved. + +import SwiftUI + +struct SessionTextField: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct SessionTextField_Previews: PreviewProvider { + static var previews: some View { + SessionTextField() + } +}