summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLWeatherServiceData.m
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLink/SDLWeatherServiceData.m')
-rw-r--r--SmartDeviceLink/SDLWeatherServiceData.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLWeatherServiceData.m b/SmartDeviceLink/SDLWeatherServiceData.m
index 785a7f990..2932c1688 100644
--- a/SmartDeviceLink/SDLWeatherServiceData.m
+++ b/SmartDeviceLink/SDLWeatherServiceData.m
@@ -15,6 +15,22 @@ NS_ASSUME_NONNULL_BEGIN
@implementation SDLWeatherServiceData
+- (instancetype)initWithLocation:(SDLLocationDetails *)location currentForecast:(nullable SDLWeatherData *)currentForecast minuteForecast:(nullable NSArray<SDLWeatherData *> *)minuteForecast hourlyForecast:(NSArray<SDLWeatherData *> *)hourlyForecast multidayForecast:(nullable NSArray<SDLWeatherData *> *)multidayForecast alerts:(NSArray<SDLWeatherAlert *> *)alerts {
+ self = [self init];
+ if (!self) {
+ return nil;
+ }
+
+ self.location = location;
+ self.currentForecast = currentForecast;
+ self.minuteForecast = minuteForecast;
+ self.hourlyForecast = hourlyForecast;
+ self.multidayForecast = multidayForecast;
+ self.alerts = alerts;
+
+ return self;
+}
+
- (void)setLocation:(SDLLocationDetails *)location {
[store sdl_setObject:location forName:SDLNameLocation];
}