Skip to content

Commit

Permalink
added US customary / imperial units to mac app
Browse files Browse the repository at this point in the history
  • Loading branch information
DarraghRogan committed Oct 12, 2020
1 parent 4d8b066 commit dc0758e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Miasma.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "Miasma iOS/Miasma iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_ASSET_PATHS = "\"Miasma iOS/Preview Content\"";
DEVELOPMENT_TEAM = VDLCQ62KZH;
ENABLE_PREVIEWS = YES;
Expand All @@ -606,7 +606,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "Miasma iOS/Miasma iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_ASSET_PATHS = "\"Miasma iOS/Preview Content\"";
DEVELOPMENT_TEAM = VDLCQ62KZH;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -750,7 +750,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 18;
DEVELOPMENT_TEAM = VDLCQ62KZH;
ENABLE_HARDENED_RUNTIME = YES;
EXCLUDED_ARCHS = "";
Expand All @@ -760,7 +760,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.10;
MARKETING_VERSION = 1.11;
PRODUCT_BUNDLE_IDENTIFIER = "Darragh-Rogan.Miasma";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -776,7 +776,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 17;
CURRENT_PROJECT_VERSION = 18;
DEVELOPMENT_TEAM = VDLCQ62KZH;
ENABLE_HARDENED_RUNTIME = YES;
EXCLUDED_ARCHS = "";
Expand All @@ -786,7 +786,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 1.10;
MARKETING_VERSION = 1.11;
PRODUCT_BUNDLE_IDENTIFIER = "Darragh-Rogan.Miasma";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
12 changes: 10 additions & 2 deletions Miasma/Menu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,19 @@ class menuFunctions: NSObject {
windDirection_acronymn = ""
}

self.climaCellWeather.title = "🌦: Will be \(climaCellData[0].weatherCode?.value ?? ""), feel like \(String(format: "%.1f", locale: Locale.current, climaCellData[0].feelsLike?.value ?? 0))℃, with wind from \(windDirection_acronymn)° @ \(String(format: "%.1f", locale: Locale.current, climaCellData[0].windSpeed?.value ?? 0))m/s"
let ClimaCellCelcius = climaCellData[0].feelsLike?.value ?? 0
func calculateFahrenheit(celcius: Double) -> String {
var fahrenheit: Double
fahrenheit = (celcius * 9 / 5) + 32
let fahrenheitRoundedString = String(format: "%.1f", locale: Locale.current, fahrenheit)
return fahrenheitRoundedString
}

self.climaCellWeather.title = "🌦: Will be \(climaCellData[0].weatherCode?.value ?? ""), \(String(format: "%.1f", locale: Locale.current, climaCellData[0].feelsLike?.value ?? 0))℃ / \(calculateFahrenheit(celcius: Double(ClimaCellCelcius)))℉, with wind from \(windDirection_acronymn) @ \(String(format: "%.1f", locale: Locale.current, Double(climaCellData[0].windSpeed?.value ?? 0)))m/s / \(String(format: "%.1f", locale: Locale.current, Double(climaCellData[0].windSpeed?.value ?? 0)*3.6))km/h / \(String(format: "%.1f", locale: Locale.current, Double(climaCellData[0].windSpeed?.value ?? 0)*2.23694))mph"

self.climaCellAirQuality.title = "☁️: Air Quality will be \(round(climaCellData[0].epaAqi?.value ?? 0)) US EPA AQI PM₂.₅, with primary pollutant of: \(climaCellData[0].epaPrimaryPollutant?.value ?? "")"

self.climaCellPollen.title = "🌳: Pollen Index [0-5] will be: Trees: \(climaCellData[0].pollenTree?.value ?? 0), Grass: \(climaCellData[0].pollenGrass?.value ?? 0), Weeds: \(climaCellData[0].pollenWeed?.value ?? 0)"
self.climaCellPollen.title = "🌳: Pollen Index [0-5] will be: Trees: \(String(format: "%.1f", locale: Locale.current, climaCellData[0].pollenTree?.value ?? 0)), Grass: \(String(format: "%.1f", locale: Locale.current, climaCellData[0].pollenGrass?.value ?? 0)), Weeds: \(String(format: "%.1f", locale: Locale.current, climaCellData[0].pollenWeed?.value ?? 0))"

})
}
Expand Down

0 comments on commit dc0758e

Please sign in to comment.