I want to set an image in the titleView of NavigationBar using SwiftUI. We can do this by using UIKit as below:
navigationItem.titleView = UIImageView(image: UIImage(named: "logo"))
This is how we do it in UIKit.
How can I use SwiftUI to achieve this?
In SwiftUI 2 you can create a
ToolbarItem
with theprincipal
placement: