✨ :: Add notch configuration for iPhone XR (WIP)

This commit is contained in:
Felix Mau committed 2022-03-11 14:04:12 +01:00
1 parent 0e20b0fb0e
commit d97b99ab83
2 files changed
+11 -1

No files matched your search

@@ -227,6 +227,12 @@ private extension NotchGradientLoadingBarViewModel.SafeAreaDevice {
verticalOffsetForLargeCircle: -4.75,
transform: CGAffineTransform(translationX: 0.33, y: 0))
case .iPhoneXR:
return NotchConfig(notchWidth: 232,
largeCircleRadius: 21,
verticalOffsetForLargeCircle: 0,
transform: .identity)
case .iPhone12:
return NotchConfig(notchWidth: 209.5,
largeCircleRadius: 21,
@@ -14,6 +14,7 @@ final class NotchGradientLoadingBarViewModel {
enum SafeAreaDevice {
case unknown
case iPhoneX
case iPhoneXR
case iPhone11
case iPhone12
case iPhone13
@@ -39,9 +40,12 @@ private extension NotchGradientLoadingBarViewModel.SafeAreaDevice {
/// Taken from <https://stackoverflow.com/a/26962452/3532505>
init(deviceIdentifier: String) {
switch deviceIdentifier {
case "iPhone10,3", "iPhone10,6", "iPhone11,2", "iPhone11,4", "iPhone11,6", "iPhone11,8":
case "iPhone10,3", "iPhone10,6", "iPhone11,2", "iPhone11,4", "iPhone11,6":
self = .iPhoneX
case "iPhone11,8":
self = .iPhoneXR
case "iPhone12,1", "iPhone12,3", "iPhone12,5":
self = .iPhone11