Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unknown orientation variant #411

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion Source/Device.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1900,17 +1900,21 @@ extension Device {
This enum describes the state of the orientation.
- Landscape: The device is in Landscape Orientation
- Portrait: The device is in Portrait Orientation
- Unknown: The device orientation is unknown.
*/
public enum Orientation {
case landscape
case portrait
case unknown
}

public var orientation: Orientation {
if UIDevice.current.orientation.isLandscape {
return .landscape
} else {
} else if UIDevice.current.orientation.isPortrait {
return .portrait
} else {
return .unknown
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion Source/Device.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -1180,17 +1180,21 @@ extension Device {
This enum describes the state of the orientation.
- Landscape: The device is in Landscape Orientation
- Portrait: The device is in Portrait Orientation
- Unknown: The device orientation is unknown.
*/
public enum Orientation {
case landscape
case portrait
case unknown
}

public var orientation: Orientation {
if UIDevice.current.orientation.isLandscape {
return .landscape
} else {
} else if UIDevice.current.orientation.isPortrait {
return .portrait
} else {
return .unknown
}
}
}
Expand Down
Loading