uihostingcontroller Questions

8

I'm trying to add a SwiftUI view to UIKit view using UIHostingController and it shows extra spacing(This sample is made to simulate an issue on a production app). Here is the screenshot. Layout ov...
Triiodomethane asked 19/11, 2021 at 9:40

7

Solved

I have a custom UIViewControllerRepresentable (layout-related code shown below). This tries to replicate the native SwiftUI ScrollView, except it scrolls from the bottom except the top. View hierar...
Michelson asked 15/10, 2019 at 16:33

3

Solved

UPDATE: 2022-09-26 This issue has been fixed on iOS 16. Although the issue is still present on iOS 15 even when the project is compiled with the iOS 16 SDK. Original question: On iOS 15, the UIHost...
Kabob asked 21/9, 2021 at 8:44

1

Given: UIHostingController hosted inside UIKit superview. When: Superview transform modified before viewDidAppear. In this example moved 200pts down. Then: Subsequent changes to superview transform...
Fillin asked 10/2, 2021 at 0:30

3

I'm currently trying, to implement a UITableViewController in a UIViewControllerRepresentable, where the contents of the cells are SwiftUI Views again. I cannot use a SwiftUI List, because I want t...
Kosey asked 23/8, 2019 at 13:44

7

Solved

I have a simple SwiftUI view that contains 3 text elements: struct ImageDescriptionView: View { var title: String? var imageDescription: String? var copyright: String? var body: some View { V...
Optimal asked 29/11, 2021 at 14:27

1

I have an issue where I'm trying to insert a SwiftUI view into an existing UIKit view. The SwiftUI view can change height dynamically, but the UIStackView does not adjust to the new size. I've crea...
Tuyettv asked 23/3, 2023 at 12:24

3

Solved

I have SwiftUI page, it's being navigated from UIKit view. I want to set a title to this page, what I'm doing is // code of UIKit view let controller = UIHostingController(rootView: SwiftUIView()) ...
Jard asked 30/4, 2021 at 3:54

4

I have the below series of controllers and views. However, when I use the navigation link on the MoreView it changes the tabBarItem.title value. For instance it will say more, but when the privacy ...
Emeliaemelin asked 30/6, 2020 at 16:47

4

Anyone know how to deal with this? Seems as though when you have a UIHostingController with a NavigationView the following happens: Notice the big grey tab bar safe area. This is primarily a UIKit...
Tadashi asked 12/1, 2021 at 20:29

2

Solved

i have a UIHostingController that is hosting a SwiftUI view called CatalogView. when showing it, an environment object is attached, so basically from UIKit it is shown like this: let rootCatalogVie...
Homeomorphism asked 12/3, 2021 at 19:1

0

I have a large SwiftUI view that contains a bottom menu and some small UI components above it. I want to overlay this view on top of an existing UIViewController instance and therefore using a UIHo...
Spinnaker asked 30/8, 2022 at 17:9

1

Solved

I'm trying to embed a SwiftUI View within a UIKit UIView, within a View again. It will look something like this: View ↓ UIView ↓ View Current code: struct ContentView: View { var body: some View ...
Report asked 15/2, 2022 at 13:37

2

Solved

When I use a UIHostingController to push a new SwiftUI.View to the navigation stack of an existing UIKit UIViewController the animation of the title in the navigation bar is broken. I tested in Xco...
Loireatlantique asked 12/10, 2021 at 8:49

2

Solved

I want to update Swift UI View according to the communication result. But UIHostingController.view is not fit rootView size at iOS 13. The same thing happens when I try with the sample code below...
Greathouse asked 17/2, 2021 at 5:51

2

Solved

I am struggling to hide the navigationBar, which would properly be hidden if the root controller wasn't a SwiftUI UIHostingController. I tried the following: Setting navigationController.isNavigat...

0

I have created a SwiftUI view which I show in a MKMapView's annotation callout. I use UIHostingController to wrap the SwiftUI view, and use annotationView's detailCalloutAccessoryView property to s...
Araarab asked 23/3, 2021 at 23:27

1

Solved

I need to be able to see through my SwiftUI Views as well as the UIHosting Controller presenting them in order to see a background image underneath them. The code below still shows a white rectangl...
Tolle asked 19/8, 2020 at 17:24
1

© 2022 - 2024 — McMap. All rights reserved.