Post

Replies

Boosts

Views

Activity

Reply to Is it possible to use SwiftUI in iMessage app?
Yes, you have to Delete the storyboard file and delete the NSExtensionMainStoryboard property and add NSExtensionPrincipalClass that will be the class MessagesViewController and this your MSMessagesAppViewController. Add to your code @objc(MessagesViewController) In viewDidLoadMethod insert // Get the UIKit view of your SwiftUI View let child = UIHostingController(rootView: SwiftUIView()) self.view.addSubview(child.view) // Set the place where your view will be displayed let constraints = [             child.view.topAnchor.constraint(equalTo: view.topAnchor),             child.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),             child.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),             child.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),             child.view.widthAnchor.constraint(equalTo: view.widthAnchor),             child.view.heightAnchor.constraint(equalTo: view.heightAnchor) ] view.addConstraints(constraints) Hope it will help you !
Jan ’23