Commit 6056866e by Demid Merzlyakov

CoreData Model created.

parent 63a87a9a
......@@ -159,6 +159,9 @@
CEF959982600C88100975FAA /* AnalyticsParameter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEF959972600C88100975FAA /* AnalyticsParameter.swift */; };
CEF9599F2601DF3300975FAA /* AdLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEF9599E2601DF3300975FAA /* AdLogger.swift */; };
CEF959A626035A2600975FAA /* DeviceLocationMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEF959A526035A2600975FAA /* DeviceLocationMonitor.swift */; };
CEFB857226174F7A00C5CDD2 /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEFB857126174F7A00C5CDD2 /* Storage.swift */; };
CEFB85752617506100C5CDD2 /* CoreDataStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEFB85742617506100C5CDD2 /* CoreDataStorage.swift */; };
CEFB857A2617510700C5CDD2 /* 1WModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = CEFB85782617510700C5CDD2 /* 1WModel.xcdatamodeld */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
......@@ -318,6 +321,9 @@
CEF959972600C88100975FAA /* AnalyticsParameter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsParameter.swift; sourceTree = "<group>"; };
CEF9599E2601DF3300975FAA /* AdLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdLogger.swift; sourceTree = "<group>"; };
CEF959A526035A2600975FAA /* DeviceLocationMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceLocationMonitor.swift; sourceTree = "<group>"; };
CEFB857126174F7A00C5CDD2 /* Storage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = "<group>"; };
CEFB85742617506100C5CDD2 /* CoreDataStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataStorage.swift; sourceTree = "<group>"; };
CEFB85792617510700C5CDD2 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
DF826CF4702D9DCCB9A9DD71 /* Pods-1Weather.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-1Weather.release.xcconfig"; path = "Target Support Files/Pods-1Weather/Pods-1Weather.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -403,6 +409,7 @@
87C171E725FF79CC00DA3464 /* Configuration */,
CE9D181425ECB8370028D9D7 /* Common */,
CEAFF09925DFC78200DF4EBF /* Network */,
CEFB856B26174F2E00C5CDD2 /* Storage */,
CEAFF08125DFC66F00DF4EBF /* Model */,
CD647D0025ED07AF0034578B /* ViewModels */,
CD17C5F925D15B5500EE884E /* Coordinators */,
......@@ -928,6 +935,24 @@
path = Helpers;
sourceTree = "<group>";
};
CEFB856B26174F2E00C5CDD2 /* Storage */ = {
isa = PBXGroup;
children = (
CEFB857126174F7A00C5CDD2 /* Storage.swift */,
CEFB8577261750DF00C5CDD2 /* CoreData */,
);
path = Storage;
sourceTree = "<group>";
};
CEFB8577261750DF00C5CDD2 /* CoreData */ = {
isa = PBXGroup;
children = (
CEFB85742617506100C5CDD2 /* CoreDataStorage.swift */,
CEFB85782617510700C5CDD2 /* 1WModel.xcdatamodeld */,
);
path = CoreData;
sourceTree = "<group>";
};
DBFD169AA2AA6A3CB5B68BB5 /* Frameworks */ = {
isa = PBXGroup;
children = (
......@@ -1131,6 +1156,7 @@
CD37D3FE260DF726002669D6 /* SettingsCellFactory.swift in Sources */,
CD8E041625F8F91B001785B6 /* ForecastCellFactory.swift in Sources */,
87C1720D25FF870600DA3464 /* GeoNamesPlace.swift in Sources */,
CEFB857A2617510700C5CDD2 /* 1WModel.xcdatamodeld in Sources */,
CDC70833260FBFD4004A1974 /* UnitPressure+Atmosphere.swift in Sources */,
CDC6125325E79C8F00188DA7 /* DayTimeView.swift in Sources */,
CD251EDC26036E5400ED7A65 /* DayTimePrecipitationView.swift in Sources */,
......@@ -1160,6 +1186,7 @@
CDE2BF252609D9140085C930 /* ForecastWindButton.swift in Sources */,
CD32CE16260C77C600235081 /* MenuHeaderButton.swift in Sources */,
CD251ED82603633800ED7A65 /* ForecastPrecipitationCell.swift in Sources */,
CEFB85752617506100C5CDD2 /* CoreDataStorage.swift in Sources */,
CDF9BF8E26133D050037847D /* LocationSearchCoordinator.swift in Sources */,
CD86246125E662BC0097F3FB /* SunUvLineView.swift in Sources */,
CD32CE0B260C744A00235081 /* MenuCoordinator.swift in Sources */,
......@@ -1186,6 +1213,7 @@
CD86245E25E646350097F3FB /* SunUvView.swift in Sources */,
CEAFF08325DFC67F00DF4EBF /* Location.swift in Sources */,
87C171EC25FF79CC00DA3464 /* EnvironmentManager.swift in Sources */,
CEFB857226174F7A00C5CDD2 /* Storage.swift in Sources */,
CD82300725D6A73F00A05501 /* TodayConditionButton.swift in Sources */,
CDC6126A25E90C8800188DA7 /* GraphLineSettings.swift in Sources */,
CDA5542D25EF7C9700A2E08C /* ReusableCellProtocol.swift in Sources */,
......@@ -1397,6 +1425,19 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCVersionGroup section */
CEFB85782617510700C5CDD2 /* 1WModel.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
CEFB85792617510700C5CDD2 /* Model.xcdatamodel */,
);
currentVersion = CEFB85792617510700C5CDD2 /* Model.xcdatamodel */;
path = 1WModel.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = CD1237B7255D5C5900C98139 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="17709" systemVersion="19H524" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="CoreAirQuality" representedClassName="CoreAirQuality" syncable="YES">
<attribute name="advice" attributeType="String"/>
<attribute name="index" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<relationship name="health" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="CoreHealth" inverseName="airQuality" inverseEntity="CoreHealth"/>
</entity>
<entity name="CoreCurrentWeather" representedClassName="CoreCurrentWeather" syncable="YES">
<attribute name="apparentTemp" optional="YES" attributeType="Binary"/>
<attribute name="approximateMoonrise" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="date" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="humidity" optional="YES" attributeType="Integer 16" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="isDay" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="lastTimeUpdated" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="maxTemp" optional="YES" attributeType="Binary"/>
<attribute name="minTemp" optional="YES" attributeType="Binary"/>
<attribute name="moonPhase" optional="YES" attributeType="String"/>
<attribute name="moonrise" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="moonset" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="moonState" optional="YES" attributeType="String"/>
<attribute name="precipitationProbability" optional="YES" attributeType="Integer 16" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="pressure" optional="YES" attributeType="Binary"/>
<attribute name="sunrise" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="sunset" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="sunState" optional="YES" attributeType="String"/>
<attribute name="temp" optional="YES" attributeType="Binary"/>
<attribute name="timeZone" attributeType="String"/>
<attribute name="type" attributeType="String"/>
<attribute name="visibility" optional="YES" attributeType="Binary"/>
<attribute name="weekDay" attributeType="String"/>
<attribute name="windDirection" optional="YES" attributeType="String"/>
<attribute name="windSpeed" optional="YES" attributeType="Binary"/>
<relationship name="location" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="CoreLocation" inverseName="today" inverseEntity="CoreLocation"/>
</entity>
<entity name="CoreDailyWeather" representedClassName="CoreDailyWeather" syncable="YES">
<attribute name="date" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="lastTimeUpdated" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="maxTemp" optional="YES" attributeType="Binary"/>
<attribute name="minTemp" optional="YES" attributeType="Binary"/>
<attribute name="moonPhase" optional="YES" attributeType="String"/>
<attribute name="moonrise" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="moonset" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="moonState" optional="YES" attributeType="String"/>
<attribute name="precipitationProbability" optional="YES" attributeType="Integer 16" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="sunrise" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="sunset" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="sunState" optional="YES" attributeType="String"/>
<attribute name="timeZone" attributeType="String"/>
<attribute name="type" attributeType="String"/>
<attribute name="weekDay" attributeType="String"/>
<attribute name="windDirection" optional="YES" attributeType="String"/>
<attribute name="windSpeed" optional="YES" attributeType="Binary"/>
<relationship name="location" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="CoreLocation" inverseName="daily" inverseEntity="CoreLocation"/>
</entity>
<entity name="CoreDayTimeWeather" representedClassName="CoreDayTimeWeather" syncable="YES">
<attribute name="date" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="dayTime" attributeType="Integer 16" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="isDay" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="lastTimeUpdated" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="temp" optional="YES" attributeType="Binary"/>
<attribute name="timeZone" attributeType="String"/>
<attribute name="type" attributeType="String"/>
<attribute name="weekDay" attributeType="String"/>
<relationship name="location" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="CoreLocation" inverseName="dayTimeForecast" inverseEntity="CoreLocation"/>
</entity>
<entity name="CoreHealth" representedClassName="CoreHealth" syncable="YES">
<attribute name="lastUpdateTime" attributeType="Date" usesScalarValueType="NO"/>
<relationship name="airQuality" optional="YES" maxCount="1" deletionRule="Cascade" destinationEntity="CoreAirQuality" inverseName="health" inverseEntity="CoreAirQuality"/>
<relationship name="location" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="CoreLocation" inverseName="health" inverseEntity="CoreLocation"/>
<relationship name="pollutants" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="CorePollutant" inverseName="health" inverseEntity="CorePollutant"/>
</entity>
<entity name="CoreHourlyWeather" representedClassName="CoreHourlyWeather" syncable="YES">
<attribute name="apparentTemp" optional="YES" attributeType="Binary"/>
<attribute name="date" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="humidity" optional="YES" attributeType="Integer 16" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="isDay" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="lastTimeUpdated" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="precipitationProbability" optional="YES" attributeType="Integer 16" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="temp" optional="YES" attributeType="Binary"/>
<attribute name="timeZone" attributeType="String"/>
<attribute name="type" attributeType="String"/>
<attribute name="weekDay" attributeType="String"/>
<attribute name="windDirection" optional="YES" attributeType="String"/>
<attribute name="windSpeed" optional="YES" attributeType="Binary"/>
<relationship name="location" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="CoreLocation" inverseName="hourly" inverseEntity="CoreLocation"/>
</entity>
<entity name="CoreLocation" representedClassName="CoreLocation" syncable="YES">
<attribute name="cityName" optional="YES" attributeType="String"/>
<attribute name="countryCode" optional="YES" attributeType="String"/>
<attribute name="countryName" optional="YES" attributeType="String"/>
<attribute name="deviceLocation" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="fipsCode" optional="YES" attributeType="String"/>
<attribute name="lastWeatherUpdateDate" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="latitude" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="longitude" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
<attribute name="nickname" optional="YES" attributeType="String"/>
<attribute name="region" optional="YES" attributeType="String"/>
<attribute name="timeZone" attributeType="String"/>
<attribute name="zip" optional="YES" attributeType="String"/>
<relationship name="daily" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="CoreDailyWeather" inverseName="location" inverseEntity="CoreDailyWeather"/>
<relationship name="dayTimeForecast" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="CoreDayTimeWeather" inverseName="location" inverseEntity="CoreDayTimeWeather"/>
<relationship name="health" optional="YES" maxCount="1" deletionRule="Cascade" destinationEntity="CoreHealth" inverseName="location" inverseEntity="CoreHealth"/>
<relationship name="hourly" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="CoreHourlyWeather" inverseName="location" inverseEntity="CoreHourlyWeather"/>
<relationship name="today" optional="YES" maxCount="1" deletionRule="Cascade" destinationEntity="CoreCurrentWeather" inverseName="location" inverseEntity="CoreCurrentWeather"/>
</entity>
<entity name="CorePollutant" representedClassName="CorePollutant" syncable="YES">
<attribute name="name" attributeType="String"/>
<attribute name="value" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<relationship name="health" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="CoreHealth" inverseName="pollutants" inverseEntity="CoreHealth"/>
</entity>
<elements>
<element name="CoreCurrentWeather" positionX="-63" positionY="-18" width="128" height="418"/>
<element name="CoreDailyWeather" positionX="-36" positionY="9" width="128" height="313"/>
<element name="CoreDayTimeWeather" positionX="0" positionY="45" width="128" height="178"/>
<element name="CoreHealth" positionX="18" positionY="63" width="128" height="103"/>
<element name="CoreHourlyWeather" positionX="-18" positionY="27" width="128" height="238"/>
<element name="CoreLocation" positionX="-54" positionY="-9" width="128" height="298"/>
<element name="CoreAirQuality" positionX="-27" positionY="135" width="128" height="88"/>
<element name="CorePollutant" positionX="-18" positionY="144" width="128" height="88"/>
</elements>
</model>
\ No newline at end of file
//
// CoreDataStorage.swift
// 1Weather
//
// Created by Demid Merzlyakov on 02.04.2021.
//
import Foundation
public class CoreDataStorage: Storage {
public func save(locations: [Location], selectedIndex: Int) {
}
public func load(completion: StorageCompletion) {
}
}
//
// Storage.swift
// 1Weather
//
// Created by Demid Merzlyakov on 02.04.2021.
//
import Foundation
public typealias StorageCompletion = ([Location]?, selectedIndex: Int, Error?)
public protocol Storage {
func save(locations: [Location], selectedIndex: Int)
func load(completion: StorageCompletion)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment