-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Team Mobile Schorsch
committed
Nov 22, 2023
1 parent
22c4068
commit 6d38680
Showing
16 changed files
with
148 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// UIWindow.swift | ||
// | ||
// | ||
// Copyright © 2023 Gini GmbH. All rights reserved | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIWindow { | ||
static var orientation: UIInterfaceOrientation { | ||
if #available(iOS 13.0, *) { | ||
return UIApplication.shared.windows | ||
.first? | ||
.windowScene? | ||
.interfaceOrientation ?? .portrait | ||
} else { | ||
return UIApplication.shared.statusBarOrientation | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Sources/GiniCaptureSDK/Core/Helpers/DeviceOrientation.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// DeviceOrientation.swift | ||
// | ||
// | ||
// Copyright © 2023 Gini GmbH. All rights reserved | ||
// | ||
|
||
import UIKit | ||
|
||
enum Device { | ||
|
||
/** | ||
* This property tries to get 4 orientations: | ||
* landscapeLeft, landscapeRight, portrait, portraitUpsideDown | ||
* as defined by UIDeviceOrientation enum. | ||
* It can return also unknown orientation (which is rare case) | ||
*/ | ||
static var orientation: UIDeviceOrientation { | ||
|
||
// otherwise if there is flat (faceUp, faceDown), unknown orientation | ||
// try to get orientation from UIInterfaceOrientation | ||
// Notice that: | ||
// UIDeviceOrientationLandscapeRight => UIInterfaceOrientationLandscapeLeft | ||
// UIDeviceOrientationLandscapeLeft => UIInterfaceOrientationLandscapeRight | ||
|
||
let interfaceOrientation = UIWindow.orientation | ||
switch interfaceOrientation { | ||
case .landscapeLeft: | ||
return UIDeviceOrientation.landscapeRight | ||
case .landscapeRight: | ||
return UIDeviceOrientation.landscapeLeft | ||
case .portrait: | ||
return .portrait | ||
case .portraitUpsideDown: | ||
return .portraitUpsideDown | ||
case .unknown: | ||
break | ||
@unknown default: | ||
break | ||
} | ||
|
||
return .unknown | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/chevron.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "chevron.pdf", | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"filename" : "chevron-dark.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.34 KB
Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/chevron.imageset/chevron-dark.pdf
Binary file not shown.
Binary file added
BIN
+1.29 KB
Sources/GiniCaptureSDK/Resources/GiniImages.xcassets/chevron.imageset/chevron.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters