Skip to content
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
40 changes: 19 additions & 21 deletions DatWeatherDoe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
20459C641C5C50DA004D0DC1 /* ConfigManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20459C631C5C50DA004D0DC1 /* ConfigManager.swift */; };
206523C826597B120026C506 /* WeatherError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 206523C726597B120026C506 /* WeatherError.swift */; };
206523D62659A92B0026C506 /* WeatherDataBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 206523D52659A92B0026C506 /* WeatherDataBuilder.swift */; };
206523DD265ABDF30026C506 /* ConfigManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 206523DC265ABDF30026C506 /* ConfigManagerTests.swift */; };
206523FB265AD5730026C506 /* WeatherSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 206523FA265AD5730026C506 /* WeatherSource.swift */; };
206523FD265AF03E0026C506 /* RefreshInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 206523FC265AF03E0026C506 /* RefreshInterval.swift */; };
206E15252A7C4C5C0096D33C /* ConfigOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 206E15242A7C4C5C0096D33C /* ConfigOptions.swift */; };
Expand Down Expand Up @@ -122,7 +121,6 @@
20459C631C5C50DA004D0DC1 /* ConfigManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigManager.swift; sourceTree = "<group>"; };
206523C726597B120026C506 /* WeatherError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherError.swift; sourceTree = "<group>"; };
206523D52659A92B0026C506 /* WeatherDataBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherDataBuilder.swift; sourceTree = "<group>"; };
206523DC265ABDF30026C506 /* ConfigManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigManagerTests.swift; sourceTree = "<group>"; };
206523FA265AD5730026C506 /* WeatherSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherSource.swift; sourceTree = "<group>"; };
206523FC265AF03E0026C506 /* RefreshInterval.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RefreshInterval.swift; sourceTree = "<group>"; };
206E15242A7C4C5C0096D33C /* ConfigOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigOptions.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -445,14 +443,6 @@
path = Coordinates;
sourceTree = "<group>";
};
20B9CDC827B8316000C42508 /* Config */ = {
isa = PBXGroup;
children = (
206523DC265ABDF30026C506 /* ConfigManagerTests.swift */,
);
path = Config;
sourceTree = "<group>";
};
20B9CDC927B8323900C42508 /* UI */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -517,7 +507,6 @@
children = (
207E989B26838D0D00DC2162 /* DatWeatherDoe.xctestplan */,
2074949627A09263002AA589 /* API */,
20B9CDC827B8316000C42508 /* Config */,
20B9CDC927B8323900C42508 /* UI */,
);
path = DatWeatherDoeTests;
Expand Down Expand Up @@ -583,7 +572,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1330;
LastUpgradeCheck = 1600;
LastUpgradeCheck = 2600;
ORGANIZATIONNAME = "Inder Dhir";
TargetAttributes = {
2023EDA21C4ED09C0087FD67 = {
Expand Down Expand Up @@ -725,7 +714,6 @@
files = (
2074949927A09278002AA589 /* WeatherURLBuilderTests.swift in Sources */,
20B9CDCF27B8335A00C42508 /* TemperatureUnitTests.swift in Sources */,
206523DD265ABDF30026C506 /* ConfigManagerTests.swift in Sources */,
20B3845F27A1CFE800F85482 /* LocationValidatorTests.swift in Sources */,
20B9CDD127B833EE00C42508 /* RefreshIntervalTests.swift in Sources */,
20B9CDCD27B8325900C42508 /* WeatherSourceTests.swift in Sources */,
Expand Down Expand Up @@ -799,6 +787,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
Expand Down Expand Up @@ -852,6 +841,7 @@
MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O";
Expand All @@ -867,19 +857,22 @@
CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 52;
CURRENT_PROJECT_VERSION = 53;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"DatWeatherDoe/Resources/DevelopmentAssets\" \"DatWeatherDoe/Resources/DevelopmentAssets/TestData.swift\"";
DEVELOPMENT_TEAM = Q8X4D3A8MT;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_RESOURCE_ACCESS_LOCATION = YES;
INFOPLIST_FILE = "$(SRCROOT)/DatWeatherDoe/Resources/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = DatWeatherDoe;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.weather";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 5.4.0;
MARKETING_VERSION = 5.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.inderdhir.DatWeatherDoe.debug;
PRODUCT_NAME = DatWeatherDoe;
PROVISIONING_PROFILE = "";
Expand All @@ -896,19 +889,22 @@
CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 52;
CURRENT_PROJECT_VERSION = 53;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"DatWeatherDoe/Resources/DevelopmentAssets\" \"DatWeatherDoe/Resources/DevelopmentAssets/TestData.swift\"";
DEVELOPMENT_TEAM = Q8X4D3A8MT;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_RESOURCE_ACCESS_LOCATION = YES;
INFOPLIST_FILE = "$(SRCROOT)/DatWeatherDoe/Resources/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = DatWeatherDoe;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.weather";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 5.4.0;
MARKETING_VERSION = 5.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.inderdhir.DatWeatherDoe;
PRODUCT_NAME = DatWeatherDoe;
PROVISIONING_PROFILE = "";
Expand All @@ -927,6 +923,7 @@
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = Q8X4D3A8MT;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.inderdhir.DefaultsTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -945,6 +942,7 @@
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.inderdhir.DefaultsTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -991,31 +989,31 @@
repositoryURL = "https://github.com/nicklockwood/SwiftFormat";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.54.0;
minimumVersion = 0.57.2;
};
};
20012FA4267980EE00553B60 /* XCRemoteSwiftPackageReference "Reachability" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/ashleymills/Reachability.swift";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.2.3;
minimumVersion = 5.2.4;
};
};
2039B4052C2920BF006A6B6D /* XCRemoteSwiftPackageReference "MenuBarExtraAccess" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/orchetect/MenuBarExtraAccess";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.5;
minimumVersion = 1.2.2;
};
};
20CB68BC2A2D9029001C73B9 /* XCRemoteSwiftPackageReference "SwiftLint" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/realm/SwiftLint";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.55.1;
minimumVersion = 0.61.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1600"
LastUpgradeVersion = "2600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions DatWeatherDoe/API/Response/ForecastData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ struct Forecast: Decodable {
}

struct ForecastDayData: Decodable {
let temp: ForecastTemperatureData
let temperatureData: ForecastTemperatureData
let astro: SunriseSunsetData
let hour: [HourlyUVIndex]

private enum CodingKeys: String, CodingKey {
case temp = "day"
case temperatureData = "day"
case astro
case hour
}
Expand Down
4 changes: 0 additions & 4 deletions DatWeatherDoe/API/Response/SunriseSunsetData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,4 @@ import Foundation
struct SunriseSunsetData: Decodable {
let sunrise: String
let sunset: String

private enum CodingKeys: String, CodingKey {
case sunrise, sunset
}
}
8 changes: 4 additions & 4 deletions DatWeatherDoe/API/WeatherError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ enum WeatherError: LocalizedError {
var errorDescription: String? {
switch self {
case .unableToConstructUrl:
return "Unable to construct URL"
"Unable to construct URL"
case .locationError:
return NSLocalizedString("❗️Location", comment: "Location error when fetching weather")
NSLocalizedString("❗️Location", comment: "Location error when fetching weather")
case .latLongIncorrect:
return NSLocalizedString("❗️Lat/Long", comment: "Lat/Long error when fetching weather")
NSLocalizedString("❗️Lat/Long", comment: "Lat/Long error when fetching weather")
case .networkError:
return "🖧"
"🖧"
}
}
}
1 change: 1 addition & 0 deletions DatWeatherDoe/DatWeatherDoeApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ struct DatWeatherDoeApp: App {
statusItem?.togglePresented()
}
}

4 changes: 2 additions & 2 deletions DatWeatherDoe/Reachability/WeatherReachability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ final class NetworkReachability {
) {
self.logger = logger

setupWith(callback: onBecomingReachable)
setup(callback: onBecomingReachable)
}

private func setupWith(callback: @escaping () -> Void) {
private func setup(callback: @escaping () -> Void) {
do {
reachability = try Reachability()
try reachability?.startNotifier()
Expand Down
9 changes: 1 addition & 8 deletions DatWeatherDoe/Resources/DatWeatherDoe.entitlements
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.personal-information.location</key>
<true/>
</dict>
<dict/>
</plist>
2 changes: 1 addition & 1 deletion DatWeatherDoe/Resources/DevelopmentAssets/TestData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let response = WeatherAPIResponse(
windData: .init(speedMph: 12.3, degrees: 305, direction: "NW"),
uvIndex: 7.0,
forecastDayData: .init(
temp: .init(
temperatureData: .init(
maxTempC: 32.8, maxTempF: 91.0, minTempC: 20.6, minTempF: 69.2
),
astro: .init(sunrise: "05:26 AM", sunset: "08:31 PM"),
Expand Down
12 changes: 5 additions & 7 deletions DatWeatherDoe/UI/Configure/ConfigureOptionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,9 @@ struct ConfigureOptionsView: View {
}
}

struct ConfigureOptionsView_Previews: PreviewProvider {
static var previews: some View {
ConfigureOptionsView(
viewModel: .init(configManager: ConfigManager())
)
.frame(width: 380)
}
#Preview {
ConfigureOptionsView(
viewModel: .init(configManager: ConfigManager())
)
.frame(width: 380)
}
12 changes: 5 additions & 7 deletions DatWeatherDoe/UI/Configure/ConfigureUnitOptionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ struct ConfigureUnitOptionsView: View {
}
}

struct ConfigureUnitOptionsView_Previews: PreviewProvider {
static var previews: some View {
Grid {
ConfigureUnitOptionsView(
viewModel: .init(configManager: ConfigManager())
)
}
#Preview {
Grid {
ConfigureUnitOptionsView(
viewModel: .init(configManager: ConfigManager())
)
}
}
Loading