unity-swiftui-example icon indicating copy to clipboard operation
unity-swiftui-example copied to clipboard

How to mark NavigationView as Passthrough

Open JakobWitsch opened this issue 3 years ago • 4 comments
trafficstars

Hello! If I add a NavigationView the touch Event does not get forwarded to Unity. Do you know a way how to solve this?

ZStack { NavigationView { } Text("Hello World").onAppear { let api = UnityBridge.getInstance() api.show() } }

JakobWitsch avatar Apr 04 '22 09:04 JakobWitsch

Got the same issue I was about to post an issue to know if someone has a solution. Did you find something? For me the Navigation View also hide the Unity view...

Thanks for your helps :)

Akhu avatar Jun 13 '22 14:06 Akhu

Hi. No found no way because Unity lays in the background and the navigation view can not be transparent. I wrote my own navigation bar and it works pretty good this way

Holen Sie sich Outlook für iOShttps://aka.ms/o0ukef


Von: Anthony Da Cruz @.> Gesendet: Monday, June 13, 2022 4:42:49 PM An: DavidPeicho/unity-swiftui-example @.> Cc: JakobWitsch @.>; Author @.> Betreff: Re: [DavidPeicho/unity-swiftui-example] How to mark NavigationView as Passthrough (Issue #10)

Got the same issue I was about to post an issue to know if someone has a solution. Did you find something? For me the Navigation View also hide the Unity view...

Thanks for your helps :)

— Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDavidPeicho%2Funity-swiftui-example%2Fissues%2F10%23issuecomment-1154012123&data=05%7C01%7C%7C08b1bfaeff6843f8825408da4d4afd03%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637907281714125900%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8tDS4pCFVB6T09TQjuYDqD9C7zQWhLFBS%2BG8ziH2p%2FM%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKYUME3KGD4R3W6ISPQFDTLVO5CGTANCNFSM5SO2NYVQ&data=05%7C01%7C%7C08b1bfaeff6843f8825408da4d4afd03%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637907281714282120%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mvX%2Btb2j1jeGJZOAnOS%2BO6FSTUBbwlKu9uG74j0GXdg%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.***>

JakobWitsch avatar Jun 14 '22 13:06 JakobWitsch

Ok I see thanks for the answer.

On a side note for the futur people who struggle : I managed to make your solution working for an already existing complex project with SwiftUI.

But using SceneDelegate is breaking some SwiftUI features like Universal Link, and incoming data from the outside of the app. So I ended up by integrating Unity in a UIViewRepresentable which generate other problems but in the end it working by playing with UIWindows.

Warning message from SwiftUI

Cannot use Scene methods for URL, NSUserActivity, and other External Events without using SwiftUI Lifecycle

I will make a repository to treat this case, because not many resources can be found on internet, your blog post was a lighthouse in the dark. Thanks for your work !

Akhu avatar Jun 14 '22 19:06 Akhu

Any update on this? Making a navigationview a passthrough?

Phantom-Addy avatar May 25 '23 23:05 Phantom-Addy