Post

Replies

Boosts

Views

Activity

largeTitleDisplayMode doesn't work when using UIHostingController
When using a UIHostingController to host my SwiftUI content, I can't get the navigation title to start large and shift to inline as the user scrolls. Is this a known problem with using the UIHostingController? var viewModel: DashboardViewModel! lazy var contentView = UIHostingController(rootView: DashboardView(viewModel: viewModel)) override func viewDidLoad() { super.viewDidLoad() addChild(contentView) view.addSubview(contentView.view) setupConstraints() navigationItem.title = "Test Title" navigationItem.largeTitleDisplayMode = .automatic } The title in the navigation controller shows inline
4
1
2.1k
Apr ’23
SwiftUI image from Bundle.main not working
I have a project with a single asset image. In the dependency package, I am attempting to preview using the image in the project using Bundle.main. I just get a blank. How can I get this to work? Sample project here: https://github.com/AaronBratcher/SwiftUIPreviewProblem
Replies
6
Boosts
1
Views
1.3k
Activity
Oct ’24
Swift Data in Background Processing?
Is it possible to do Swift Data operations on a background processing event?
Replies
0
Boosts
2
Views
544
Activity
Aug ’23
Xcode 16 preview not working
I want to add SwiftUI to an existing package. Super simple to get started. It previews with Xcode 15.4, but gives an error on Xcode 16.0: JITError: Runtime linking failure Anyone have an idea on what may be failing? Full SwiftUI code: import SwiftUI struct Dashboard: View { var body: some View { Text("hello") } } #Preview { Dashboard() }
Replies
4
Boosts
3
Views
4k
Activity
Sep ’24
largeTitleDisplayMode doesn't work when using UIHostingController
When using a UIHostingController to host my SwiftUI content, I can't get the navigation title to start large and shift to inline as the user scrolls. Is this a known problem with using the UIHostingController? var viewModel: DashboardViewModel! lazy var contentView = UIHostingController(rootView: DashboardView(viewModel: viewModel)) override func viewDidLoad() { super.viewDidLoad() addChild(contentView) view.addSubview(contentView.view) setupConstraints() navigationItem.title = "Test Title" navigationItem.largeTitleDisplayMode = .automatic } The title in the navigation controller shows inline
Replies
4
Boosts
1
Views
2.1k
Activity
Apr ’23
Associated Code?
When showing an ImageDownloader actor, the presenter said a solution on avoiding duplicate downloads is shown with the code associated with this video. When will this code be available? I don't see it on the video page.
Replies
6
Boosts
0
Views
2.9k
Activity
Jan ’22