Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions Camera.MAUI/Apple/MauiCameraView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -679,13 +679,25 @@
if (cameraView.MirroredImage == (cameraView.Camera?.Position == CameraPosition.Back))
transform = transform.Scale(-1, 1, 1);

UIInterfaceOrientation orientation;
if (OperatingSystem.IsIOSVersionAtLeast(15))
orientation = (UIApplication.SharedApplication.ConnectedScenes.ToArray().First(s => s is UIWindowScene) as UIWindowScene).InterfaceOrientation;
else if (OperatingSystem.IsIOSVersionAtLeast(13))
orientation = UIApplication.SharedApplication.Windows.First().WindowScene.InterfaceOrientation;
else
UIInterfaceOrientation orientation = UIInterfaceOrientation.Unknown;
if (OperatingSystem.IsIOSVersionAtLeast(13))
{
UIWindowScene windowScene = null;
if (OperatingSystem.IsIOSVersionAtLeast(15))
windowScene = UIApplication.SharedApplication.ConnectedScenes.ToArray().FirstOrDefault(s => s is UIWindowScene) as UIWindowScene;
else
windowScene = UIApplication.SharedApplication.Windows.FirstOrDefault()?.WindowScene;

if (windowScene != null)
{
if (OperatingSystem.IsIOSVersionAtLeast(26))
orientation = windowScene.EffectiveGeometry.InterfaceOrientation;
else
orientation = windowScene.InterfaceOrientation;

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 696 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIWindowScene.InterfaceOrientation' is only supported on: 'ios' 13.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
}
}
if (orientation == UIInterfaceOrientation.Unknown)
orientation = UIApplication.SharedApplication.StatusBarOrientation;

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / winBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 700 in Camera.MAUI/Apple/MauiCameraView.cs

View workflow job for this annotation

GitHub Actions / macBuild

This call site is reachable on: 'iOS' 12.2 and later, 'maccatalyst' 12.2 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

switch (orientation)
{
Expand Down