-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Showing
7 changed files
with
105 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// AirQualityIndex.swift | ||
// DatWeatherDoe | ||
// | ||
// Created by Inder Dhir on 7/1/24. | ||
// Copyright © 2024 Inder Dhir. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
// US - EPA standard | ||
enum AirQualityIndex: Int, Decodable { | ||
case good = 1 | ||
case moderate = 2 | ||
case unhealthyForSensitive = 3 | ||
case unhealthy = 4 | ||
case veryUnhealthy = 5 | ||
case hazardous = 6 | ||
|
||
var description: String { | ||
switch self { | ||
case .good: | ||
return NSLocalizedString( | ||
"Good", | ||
comment: "Air quality index: Good" | ||
) | ||
case .moderate: | ||
return NSLocalizedString( | ||
"Moderate", | ||
comment: "Air quality index: Moderate" | ||
) | ||
case .unhealthyForSensitive: | ||
return NSLocalizedString( | ||
"Unhealthy for sensitive groups", | ||
comment: "Air quality index: Unhealthy for sensitive groups" | ||
) | ||
case .unhealthy: | ||
return NSLocalizedString( | ||
"Unhealthy", | ||
comment: "Air quality index: Unhealthy" | ||
) | ||
case .veryUnhealthy: | ||
return NSLocalizedString( | ||
"Very unhealthy", | ||
comment: "Air quality index: Very unhealthy" | ||
) | ||
case .hazardous: | ||
return NSLocalizedString( | ||
"Hazardous", | ||
comment: "Air quality index: Hazardous" | ||
) | ||
} | ||
} | ||
} |
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