I am attempting to make use of Compose Multiplatform UI in an iOS Share Extension, however the Compose content material solely exhibits a clean white display screen. This is what I’ve noticed:
The UIViewController is sized accurately (the display screen background is black with out Compose).
My composable works positive in the primary iOS app (it is simply fullscreen pink Field).
I’m embedding the Compose view like this:
class ShareViewController: UIViewController {
override func viewDidLoad() {
tremendous.viewDidLoad()
print("ShareViewController loaded")
view.backgroundColor = UIColor.systemBackground
let debugLabel = UILabel()
debugLabel.textual content = "UIKit Label: Debugging Structure"
debugLabel.textAlignment = .heart
debugLabel.backgroundColor = UIColor.systemYellow
debugLabel.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(debugLabel)
NSLayoutConstraint.activate([
debugLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
debugLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor),
debugLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor),
debugLabel.heightAnchor.constraint(equalToConstant: 150)
])
let composeVC = MainViewControllerKt.ShareExtensionViewController()
addChild(composeVC)
view.addSubview(composeVC.view)
composeVC.view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
composeVC.view.topAnchor.constraint(equalTo: debugLabel.bottomAnchor),
composeVC.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
composeVC.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
composeVC.view.bottomAnchor.constraint(equalTo: view.bottomAnchor)
])
composeVC.didMove(toParent: self)
}
}
Sooo, i used to be wandering is that this some sort of rendering limitation in extension or I’m lacking one thing. Perhaps someone managed to get this working.
Thanks for any insights!
