How to use a SwiftUI view in place of table view cell

Thanks for answering your own question here. Your solution helped me make a generic HostingTableViewCell class. I’ll post it here if anyone finds this question on Google like I did. import SwiftUI class HostingTableViewCell<Content: View>: UITableViewCell { private weak var controller: UIHostingController<Content>? func host(_ view: Content, parent: UIViewController) { if let controller = controller { … Read more

Mac-catalyst – minimum window size for Mac catalyst app

Just add the following chunk of code to your application:didFinishLaunchingWithOptions method (for UIKit projects) or to scene(_:willConnectTo:options:) (for SwiftUI projects): UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }.forEach { windowScene in windowScene.sizeRestrictions?.minimumSize = CGSize(width: 480, height: 640) } PS: you can also set the maximumSize property there PS2: If you set both minimumSize and maximumSize to the … Read more