SwiftUI Force Portrait On All Except One View
问题 I have a SwiftUI project. For all but one of the views, I want to allow portrait and only portrait mode. For only one view, I want to allow both portrait and landscape. There are some resources on Swift but I couldn't find any on SwiftUI. Did anyone find a way to accomplish this? 回答1: I had to do something similar to this. Here's our approach. We set the project orientation to only support Portrait mode. Then in your AppDelegate add an instance variable for orientation and conform to the