Commit 1943a4ce by Dmitriy Stepanets

Fnished Core. Integrating WDTWeatherSource.

parent dfa21bff
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<key>OneWeatherNotificationServiceExtension.xcscheme_^#shared#^_</key> <key>OneWeatherNotificationServiceExtension.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>44</integer> <integer>45</integer>
</dict> </dict>
<key>PG (Playground) 1.xcscheme</key> <key>PG (Playground) 1.xcscheme</key>
<dict> <dict>
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:WDTWeatherSource/WDTWeatherSource.xcodeproj">
</FileRef>
<FileRef
location = "group:OneWeatherCore/OneWeatherCore.xcodeproj"> location = "group:OneWeatherCore/OneWeatherCore.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import FBAudienceNetwork import FBAudienceNetwork
import OneWeatherCore
class AdCacheManager: NSObject { class AdCacheManager: NSObject {
......
...@@ -13,6 +13,7 @@ import FBAudienceNetwork ...@@ -13,6 +13,7 @@ import FBAudienceNetwork
import GoogleMobileAds import GoogleMobileAds
import IASDKCore import IASDKCore
import Flurry_iOS_SDK import Flurry_iOS_SDK
import OneWeatherCore
public class AdManager { public class AdManager {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
public class Analytics { public class Analytics {
private let services: [AnalyticsService] private let services: [AnalyticsService]
......
...@@ -13,7 +13,7 @@ import MoEngage ...@@ -13,7 +13,7 @@ import MoEngage
import GoogleMobileAds import GoogleMobileAds
import Swarm import Swarm
import DTBiOSSDK import DTBiOSSDK
import OneWeatherCore
@main @main
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class AppCoordinator: Coordinator { class AppCoordinator: Coordinator {
//Private //Private
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
class DeeplinksRouter { class DeeplinksRouter {
static let urlScheme = "oneweather" static let urlScheme = "oneweather"
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class NWSAlertCoordinator: Coordinator { class NWSAlertCoordinator: Coordinator {
private let parentViewController:UIViewController private let parentViewController:UIViewController
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class NotificationsCoordinator: Coordinator { class NotificationsCoordinator: Coordinator {
private let parentViewController:UIViewController private let parentViewController:UIViewController
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
import UIKit import UIKit
import StoreKit import StoreKit
import OneWeatherCore
// Ported from ObjC // Ported from ObjC
protocol OLInAppStoreManagerUIDelegate: AnyObject { protocol OLInAppStoreManagerUIDelegate: AnyObject {
func viewControllerForPresentation() -> UIViewController func viewControllerForPresentation() -> UIViewController
} }
......
...@@ -18,6 +18,7 @@ import CryptoKit ...@@ -18,6 +18,7 @@ import CryptoKit
import FBAudienceNetwork import FBAudienceNetwork
import PSMLocationSDK import PSMLocationSDK
import DTBiOSSDK import DTBiOSSDK
import OneWeatherCore
fileprivate let APP_NAME = "ONE_WEATHER" fileprivate let APP_NAME = "ONE_WEATHER"
fileprivate let DEVICE_TYPE = "IOS" fileprivate let DEVICE_TYPE = "IOS"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import Foundation import Foundation
import CoreLocation import CoreLocation
import UIKit import UIKit
import OneWeatherCore
internal protocol DeviceLocationMonitorDelegate: AnyObject { internal protocol DeviceLocationMonitorDelegate: AnyObject {
func deviceLocationMonitor(_ monitor: DeviceLocationMonitor, didUpdateLocation newLocation: PartialLocation) func deviceLocationMonitor(_ monitor: DeviceLocationMonitor, didUpdateLocation newLocation: PartialLocation)
......
...@@ -9,6 +9,8 @@ import Foundation ...@@ -9,6 +9,8 @@ import Foundation
import CoreLocation import CoreLocation
import UIKit import UIKit
import MoEngage import MoEngage
import OneWeatherCore
import WDTWeatherSource
public protocol LocationManagerDelegate: AnyObject { public protocol LocationManagerDelegate: AnyObject {
func locationManager(_ locationManager: LocationManager, changedSelectedLocation newLocation: Location?) func locationManager(_ locationManager: LocationManager, changedSelectedLocation newLocation: Location?)
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
private enum Macro: String { private enum Macro: String {
case feelsLikeTemp = "#FEELS_LIKE_TEMP#" case feelsLikeTemp = "#FEELS_LIKE_TEMP#"
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class WeatherImageProvider { class WeatherImageProvider {
private enum DefaultImage: String { private enum DefaultImage: String {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
import Foundation import Foundation
import Firebase import Firebase
import FirebaseRemoteConfig import FirebaseRemoteConfig
import OneWeatherCore
public struct AppConfig: Codable { public struct AppConfig: Codable {
let popularCities: [GeoNamesPlace]? let popularCities: [GeoNamesPlace]?
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
public enum BlendHealthSourceError: Error { public enum BlendHealthSourceError: Error {
case insufficientLocationInfo case insufficientLocationInfo
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import Foundation import Foundation
import UIKit import UIKit
import OneWeatherCore
// MARK: - HealthCenter // MARK: - HealthCenter
struct BlendHealthCenter: Codable { struct BlendHealthCenter: Codable {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
class BlendFIPSSource: FIPSSource { class BlendFIPSSource: FIPSSource {
private let log = Logger(componentName: "BlendFIPSSource") private let log = Logger(componentName: "BlendFIPSSource")
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
struct NWSCurrentEventsReponse: Codable { struct NWSCurrentEventsReponse: Codable {
struct Wrapper: Codable { struct Wrapper: Codable {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
class NWSAlertInfoParser { class NWSAlertInfoParser {
private var strongSelfReference: NWSAlertInfoParser? private var strongSelfReference: NWSAlertInfoParser?
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
public enum NWSError: Error { public enum NWSError: Error {
case insufficientLocationInfo case insufficientLocationInfo
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import Firebase import Firebase
import FirebaseRemoteConfig import FirebaseRemoteConfig
import OneWeatherCore
class PopularCitiesManager { class PopularCitiesManager {
public static let shared = PopularCitiesManager() public static let shared = PopularCitiesManager()
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import Foundation import Foundation
import MoEngage import MoEngage
import OneWeatherCore
public class PushNotificationsManager: NSObject { public class PushNotificationsManager: NSObject {
// MARK: - Private // MARK: - Private
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import Foundation import Foundation
import CoreLocation import CoreLocation
import XMLCoder import XMLCoder
import OneWeatherCore
public enum WdtWeatherSourceError: Error { public enum WdtWeatherSourceError: Error {
case insufficientLocationInfo case insufficientLocationInfo
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
public class CoreDataStorage: Storage { public class CoreDataStorage: Storage {
private var lastSavedAppData: AppData? = nil private var lastSavedAppData: AppData? = nil
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CoreAirQuality) @objc(CoreAirQuality)
open class CoreAirQuality: _CoreAirQuality, CoreDataAppModelConvertable { open class CoreAirQuality: _CoreAirQuality, CoreDataAppModelConvertable {
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CoreAppData) @objc(CoreAppData)
open class CoreAppData: _CoreAppData, CoreDataAppModelConvertable { open class CoreAppData: _CoreAppData, CoreDataAppModelConvertable {
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CoreCurrentWeather) @objc(CoreCurrentWeather)
open class CoreCurrentWeather: _CoreCurrentWeather, CoreDataAppModelConvertable { open class CoreCurrentWeather: _CoreCurrentWeather, CoreDataAppModelConvertable {
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CoreDailyWeather) @objc(CoreDailyWeather)
open class CoreDailyWeather: _CoreDailyWeather, CoreDataAppModelConvertable { open class CoreDailyWeather: _CoreDailyWeather, CoreDataAppModelConvertable {
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CoreHealth) @objc(CoreHealth)
open class CoreHealth: _CoreHealth, CoreDataAppModelConvertable { open class CoreHealth: _CoreHealth, CoreDataAppModelConvertable {
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CoreHourlyWeather) @objc(CoreHourlyWeather)
open class CoreHourlyWeather: _CoreHourlyWeather, CoreDataAppModelConvertable { open class CoreHourlyWeather: _CoreHourlyWeather, CoreDataAppModelConvertable {
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CoreLocation) @objc(CoreLocation)
open class CoreLocation: _CoreLocation, CoreDataAppModelConvertable { open class CoreLocation: _CoreLocation, CoreDataAppModelConvertable {
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CoreNWSAlert) @objc(CoreNWSAlert)
open class CoreNWSAlert: _CoreNWSAlert, CoreDataAppModelConvertable { open class CoreNWSAlert: _CoreNWSAlert, CoreDataAppModelConvertable {
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CoreNotifications) @objc(CoreNotifications)
open class CoreNotifications: _CoreNotifications, CoreDataAppModelConvertable { open class CoreNotifications: _CoreNotifications, CoreDataAppModelConvertable {
......
import Foundation import Foundation
import CoreData import CoreData
import OneWeatherCore
@objc(CorePollutant) @objc(CorePollutant)
open class CorePollutant: _CorePollutant, CoreDataAppModelConvertable { open class CorePollutant: _CorePollutant, CoreDataAppModelConvertable {
......
...@@ -6,10 +6,9 @@ ...@@ -6,10 +6,9 @@
// //
import Foundation import Foundation
import OneWeatherCore
class LegacyMigrationManager { class LegacyMigrationManager {
typealias Completion = ([PartialLocation]?, MigrationError?) -> () typealias Completion = ([PartialLocation]?, MigrationError?) -> ()
private enum MigrationResult: String { private enum MigrationResult: String {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
// Used in Settings and Widget // Used in Settings and Widget
enum LegacyTempUnits: Int { enum LegacyTempUnits: Int {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
/// locations list, selectedIndex, error /// locations list, selectedIndex, error
public typealias StorageCompletion = ([Location]?, Int?, Error?) -> () public typealias StorageCompletion = ([Location]?, Int?, Error?) -> ()
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class NavigationCityButton: UIControl { class NavigationCityButton: UIControl {
//Private //Private
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import SnapKit import SnapKit
import OneWeatherCore
class ForecastDetailPeriodButton: UIControl, PeriodButtonProtocol { class ForecastDetailPeriodButton: UIControl, PeriodButtonProtocol {
private let kGraphInset:CGFloat = 10 private let kGraphInset:CGFloat = 10
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class ForecastPeriodButton: UIControl, PeriodButtonProtocol { class ForecastPeriodButton: UIControl, PeriodButtonProtocol {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class ForecastWindButton: UIControl, PeriodButtonProtocol { class ForecastWindButton: UIControl, PeriodButtonProtocol {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
public protocol PeriodButtonProtocol: UIControl { public protocol PeriodButtonProtocol: UIControl {
init() init()
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
private struct DailyGraphPoints { private struct DailyGraphPoints {
let maxTempPoints: [CGPoint] let maxTempPoints: [CGPoint]
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
public struct ThemeManager { public struct ThemeManager {
public struct Colors { public struct Colors {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class MoonPhaseCell: UITableViewCell { class MoonPhaseCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class PrecipButton: UIControl { class PrecipButton: UIControl {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class PrecipitationCell: UITableViewCell { class PrecipitationCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
private struct CircleSegment { private struct CircleSegment {
let chord:CGFloat let chord:CGFloat
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
protocol ForecastDailyCellDelegate: AnyObject { protocol ForecastDailyCellDelegate: AnyObject {
func timePeriodCell(cell:ForecastDailyCell, didSelectButtonAt index:Int) func timePeriodCell(cell:ForecastDailyCell, didSelectButtonAt index:Int)
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class ForecastDayCell: UITableViewCell { class ForecastDayCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class ForecastHourlyCell: UITableViewCell { class ForecastHourlyCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class ForecastInfoCell: UITableViewCell { class ForecastInfoCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class ForecastWindSpeedCell: UITableViewCell { class ForecastWindSpeedCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
protocol DaysControlViewDelegate: AnyObject { protocol DaysControlViewDelegate: AnyObject {
func didSelectButtonAt(index:Int) func didSelectButtonAt(index:Int)
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import SnapKit import SnapKit
import OneWeatherCore
protocol CityCellDelegate: AnyObject { protocol CityCellDelegate: AnyObject {
func didSelect(location:PartialLocation) func didSelect(location:PartialLocation)
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class LocationCellFactory: CellFactoryProtocol { class LocationCellFactory: CellFactoryProtocol {
//Private //Private
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
// //
import UIKit import UIKit
import OneWeatherCore
//MARK:- Cities View Controller //MARK:- Cities View Controller
class LocationViewController:UIViewController { class LocationViewController:UIViewController {
//Private //Private
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import AlgoliaSearchClient import AlgoliaSearchClient
import OneWeatherCore
public protocol LocationsViewModelDelegate: AnyObject { public protocol LocationsViewModelDelegate: AnyObject {
func viewModelDidChange(model:LocationsViewModel) func viewModelDidChange(model:LocationsViewModel)
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import SafariServices import SafariServices
import OneWeatherCore
class MenuViewController: UIViewController { class MenuViewController: UIViewController {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
fileprivate enum NWSAlertCellType: Int { fileprivate enum NWSAlertCellType: Int {
case header = 0 case header = 0
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class NWSAlertInfoBlockTableViewCell: UITableViewCell { class NWSAlertInfoBlockTableViewCell: UITableViewCell {
let titleLabel = UILabel() let titleLabel = UILabel()
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import SnapKit import SnapKit
import OneWeatherCore
class NWSForecastOfficeTableViewCell: UITableViewCell { class NWSForecastOfficeTableViewCell: UITableViewCell {
var alert: NWSAlert? var alert: NWSAlert?
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class NWSAlertCell: UITableViewCell { class NWSAlertCell: UITableViewCell {
// TODO: we don't have an image for this one? // TODO: we don't have an image for this one?
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class NotificationsViewController: UIViewController { class NotificationsViewController: UIViewController {
private let coordinator: NotificationsCoordinator private let coordinator: NotificationsCoordinator
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class OnboardingViewController: UIViewController { class OnboardingViewController: UIViewController {
private let coordinator: OnboardingCoordinator private let coordinator: OnboardingCoordinator
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
private enum Section { private enum Section {
case weather case weather
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class MapLegendSevereView: UIView { class MapLegendSevereView: UIView {
//Private //Private
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import SnapKit import SnapKit
import OneWeatherCore
private enum LegendType { private enum LegendType {
case weather case weather
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class MapLegendWeatherView: UIView { class MapLegendWeatherView: UIView {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
protocol MapPinnedLayersViewDelegate: AnyObject { protocol MapPinnedLayersViewDelegate: AnyObject {
func didSelectLayer(layerId:String) func didSelectLayer(layerId:String)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import MapKit import MapKit
import Swarm import Swarm
import OneWeatherCore
class RadarViewController: UIViewController { class RadarViewController: UIViewController {
//Private //Private
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import Localize_Swift import Localize_Swift
import CoreLocation import CoreLocation
import OneWeatherCore
public enum SettingsRow { public enum SettingsRow {
case theme case theme
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import Localize_Swift import Localize_Swift
import OneWeatherCore
class SettingsDetailsCellFactory: CellFactoryProtocol { class SettingsDetailsCellFactory: CellFactoryProtocol {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class SettingsThemeCell: UITableViewCell { class SettingsThemeCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class PollutantView: UIView { class PollutantView: UIView {
//Private //Private
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import Cirque import Cirque
import OneWeatherCore
private struct AirQualityDataType: CirqueDataType { private struct AirQualityDataType: CirqueDataType {
var color: UIColor var color: UIColor
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class TodayAlertCell: UITableViewCell { class TodayAlertCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
public enum TodayCellType:Int { public enum TodayCellType:Int {
case alert = 0 case alert = 0
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class TodayConditionButton: UIControl { class TodayConditionButton: UIControl {
//Private //Private
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import SnapKit import SnapKit
import OneWeatherCore
class TodayConditionsCell: UITableViewCell { class TodayConditionsCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class DayTimeView: UIView { class DayTimeView: UIView {
private let dayTimeLabel = UILabel() private let dayTimeLabel = UILabel()
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class TodayDayTimesCell: UITableViewCell { class TodayDayTimesCell: UITableViewCell {
//Private //Private
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import SnapKit import SnapKit
import OneWeatherCore
class TodayForecastCell: UITableViewCell { class TodayForecastCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class TodayForecastTimePeriodCell: UITableViewCell { class TodayForecastTimePeriodCell: UITableViewCell {
//Private //Private
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
protocol ForecastViewModelDelegate:ViewModelDelegate { protocol ForecastViewModelDelegate:ViewModelDelegate {
func selectedWeatherDidChange() func selectedWeatherDidChange()
......
...@@ -9,6 +9,7 @@ import UIKit ...@@ -9,6 +9,7 @@ import UIKit
import StoreKit import StoreKit
import MessageUI import MessageUI
import PKHUD import PKHUD
import OneWeatherCore
protocol MenuViewModelDelegate: ViewModelDelegate { protocol MenuViewModelDelegate: ViewModelDelegate {
func viewControllerForPresentation() -> UIViewController func viewControllerForPresentation() -> UIViewController
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
class NWSAlertViewModel: ViewModelProtocol { class NWSAlertViewModel: ViewModelProtocol {
public weak var delegate: ViewModelDelegate? public weak var delegate: ViewModelDelegate?
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import OneWeatherCore
protocol NotificationsViewModelDelegate: ViewModelDelegate { protocol NotificationsViewModelDelegate: ViewModelDelegate {
func viewModel(_ viewModel: NotificationsViewModel, didSelect alert: NWSAlert) func viewModel(_ viewModel: NotificationsViewModel, didSelect alert: NWSAlert)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import Swarm import Swarm
import CoreLocation import CoreLocation
import OneWeatherCore
protocol RadarViewModelDelegate: ViewModelDelegate { protocol RadarViewModelDelegate: ViewModelDelegate {
func viewModel(model:RadarViewModel, didSelectLayer layer:RadarLayer) func viewModel(model:RadarViewModel, didSelectLayer layer:RadarLayer)
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import Localize_Swift import Localize_Swift
import OneWeatherCore
class SettingsDetailsViewModel: ViewModelProtocol { class SettingsDetailsViewModel: ViewModelProtocol {
//Public //Public
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// //
import UIKit import UIKit
import OneWeatherCore
class SettingsViewModel: ViewModelProtocol { class SettingsViewModel: ViewModelProtocol {
let settings = Settings.shared let settings = Settings.shared
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import PSMLocationSDK import PSMLocationSDK
import OneWeatherCore
protocol TodayViewModelDelegate: ViewModelDelegate { protocol TodayViewModelDelegate: ViewModelDelegate {
func showOnboarding(viewModel: TodayViewModel) func showOnboarding(viewModel: TodayViewModel)
......
...@@ -62,6 +62,11 @@ ...@@ -62,6 +62,11 @@
CD91685B26552FD000EC04EF /* DefaultSettingsMetric.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD615FD1265529DE00B717DB /* DefaultSettingsMetric.swift */; }; CD91685B26552FD000EC04EF /* DefaultSettingsMetric.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD615FD1265529DE00B717DB /* DefaultSettingsMetric.swift */; };
CD91685E26552FEC00EC04EF /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD91685C26552FEB00EC04EF /* Logger.swift */; }; CD91685E26552FEC00EC04EF /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD91685C26552FEB00EC04EF /* Logger.swift */; };
CD91685F26552FEC00EC04EF /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD91685D26552FEC00EC04EF /* Global.swift */; }; CD91685F26552FEC00EC04EF /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD91685D26552FEC00EC04EF /* Global.swift */; };
CDBC243F2656740E00F9F4E2 /* AppData.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDBC243E2656740E00F9F4E2 /* AppData.swift */; };
CDFE458D26566BD50021A29F /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDFE458C26566BD50021A29F /* Storage.swift */; };
CDFE458F26566C5F0021A29F /* DelayedSaveStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDFE458E26566C5E0021A29F /* DelayedSaveStorage.swift */; };
CDFE459426566D7B0021A29F /* HealthSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDFE459326566D7B0021A29F /* HealthSource.swift */; };
CDFE459626566D860021A29F /* FIPSSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDFE459526566D860021A29F /* FIPSSource.swift */; };
CFF31454D7A391AB1E363560 /* Pods_OneWeatherCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6ED82DCC42318CBA9646976 /* Pods_OneWeatherCore.framework */; }; CFF31454D7A391AB1E363560 /* Pods_OneWeatherCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6ED82DCC42318CBA9646976 /* Pods_OneWeatherCore.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -136,6 +141,11 @@ ...@@ -136,6 +141,11 @@
CD91685626552FAE00EC04EF /* MulticastDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MulticastDelegate.swift; sourceTree = "<group>"; }; CD91685626552FAE00EC04EF /* MulticastDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MulticastDelegate.swift; sourceTree = "<group>"; };
CD91685C26552FEB00EC04EF /* Logger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = "<group>"; }; CD91685C26552FEB00EC04EF /* Logger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = "<group>"; };
CD91685D26552FEC00EC04EF /* Global.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Global.swift; sourceTree = "<group>"; }; CD91685D26552FEC00EC04EF /* Global.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Global.swift; sourceTree = "<group>"; };
CDBC243E2656740E00F9F4E2 /* AppData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppData.swift; sourceTree = "<group>"; };
CDFE458C26566BD50021A29F /* Storage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = "<group>"; };
CDFE458E26566C5E0021A29F /* DelayedSaveStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelayedSaveStorage.swift; sourceTree = "<group>"; };
CDFE459326566D7B0021A29F /* HealthSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HealthSource.swift; sourceTree = "<group>"; };
CDFE459526566D860021A29F /* FIPSSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FIPSSource.swift; sourceTree = "<group>"; };
F6ED82DCC42318CBA9646976 /* Pods_OneWeatherCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OneWeatherCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F6ED82DCC42318CBA9646976 /* Pods_OneWeatherCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OneWeatherCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -212,6 +222,8 @@ ...@@ -212,6 +222,8 @@
CD615F65265523A400B717DB /* OneWeatherCore */ = { CD615F65265523A400B717DB /* OneWeatherCore */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
CDFE459026566D4D0021A29F /* Sources */,
CDFE458B26566BC20021A29F /* Storage */,
CD615F852655269100B717DB /* Protocols */, CD615F852655269100B717DB /* Protocols */,
CD615F942655269200B717DB /* ModelObjects */, CD615F942655269200B717DB /* ModelObjects */,
CD615FB72655293100B717DB /* Extensions */, CD615FB72655293100B717DB /* Extensions */,
...@@ -219,7 +231,6 @@ ...@@ -219,7 +231,6 @@
CD91685526552F9900EC04EF /* Common */, CD91685526552F9900EC04EF /* Common */,
CD615FA3265528F000B717DB /* HelperTypes.swift */, CD615FA3265528F000B717DB /* HelperTypes.swift */,
CD615F66265523A400B717DB /* OneWeatherCore.h */, CD615F66265523A400B717DB /* OneWeatherCore.h */,
CD615F802655243C00B717DB /* WeatherSource.swift */,
CD615F67265523A400B717DB /* Info.plist */, CD615F67265523A400B717DB /* Info.plist */,
); );
path = OneWeatherCore; path = OneWeatherCore;
...@@ -281,6 +292,7 @@ ...@@ -281,6 +292,7 @@
CD615F942655269200B717DB /* ModelObjects */ = { CD615F942655269200B717DB /* ModelObjects */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
CDBC243E2656740E00F9F4E2 /* AppData.swift */,
CD615F862655269200B717DB /* GeoNamesPlace.swift */, CD615F862655269200B717DB /* GeoNamesPlace.swift */,
CD615F872655269200B717DB /* Location.swift */, CD615F872655269200B717DB /* Location.swift */,
CD550FB92655318D00257FB5 /* RadarLayers */, CD550FB92655318D00257FB5 /* RadarLayers */,
...@@ -347,6 +359,25 @@ ...@@ -347,6 +359,25 @@
path = Common; path = Common;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
CDFE458B26566BC20021A29F /* Storage */ = {
isa = PBXGroup;
children = (
CDFE458C26566BD50021A29F /* Storage.swift */,
CDFE458E26566C5E0021A29F /* DelayedSaveStorage.swift */,
);
path = Storage;
sourceTree = "<group>";
};
CDFE459026566D4D0021A29F /* Sources */ = {
isa = PBXGroup;
children = (
CD615F802655243C00B717DB /* WeatherSource.swift */,
CDFE459526566D860021A29F /* FIPSSource.swift */,
CDFE459326566D7B0021A29F /* HealthSource.swift */,
);
path = Sources;
sourceTree = "<group>";
};
F74D258AC48F534A8A9B9EDB /* Frameworks */ = { F74D258AC48F534A8A9B9EDB /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -494,9 +525,11 @@ ...@@ -494,9 +525,11 @@
CD2D55D626553384007B70F4 /* UserDefaultsValue.swift in Sources */, CD2D55D626553384007B70F4 /* UserDefaultsValue.swift in Sources */,
CD550FBA265531A100257FB5 /* RadarLayer.swift in Sources */, CD550FBA265531A100257FB5 /* RadarLayer.swift in Sources */,
CD550FBB265531A100257FB5 /* RadarLayerType.swift in Sources */, CD550FBB265531A100257FB5 /* RadarLayerType.swift in Sources */,
CDBC243F2656740E00F9F4E2 /* AppData.swift in Sources */,
CD550FBC265531A100257FB5 /* WeatherLayerType.swift in Sources */, CD550FBC265531A100257FB5 /* WeatherLayerType.swift in Sources */,
CD550FBD265531A100257FB5 /* SevereLayerType.swift in Sources */, CD550FBD265531A100257FB5 /* SevereLayerType.swift in Sources */,
CD91685826552FD000EC04EF /* DefaultSettingsFactory.swift in Sources */, CD91685826552FD000EC04EF /* DefaultSettingsFactory.swift in Sources */,
CDFE459626566D860021A29F /* FIPSSource.swift in Sources */,
CD91685926552FD000EC04EF /* DefaultSettings.swift in Sources */, CD91685926552FD000EC04EF /* DefaultSettings.swift in Sources */,
CD91685A26552FD000EC04EF /* DefaultSettingsImperial.swift in Sources */, CD91685A26552FD000EC04EF /* DefaultSettingsImperial.swift in Sources */,
CD91685B26552FD000EC04EF /* DefaultSettingsMetric.swift in Sources */, CD91685B26552FD000EC04EF /* DefaultSettingsMetric.swift in Sources */,
...@@ -505,6 +538,7 @@ ...@@ -505,6 +538,7 @@
CD2D55E0265537DC007B70F4 /* NWSAlertInfoBlock.swift in Sources */, CD2D55E0265537DC007B70F4 /* NWSAlertInfoBlock.swift in Sources */,
CD91685726552FAE00EC04EF /* MulticastDelegate.swift in Sources */, CD91685726552FAE00EC04EF /* MulticastDelegate.swift in Sources */,
CD615FB92655295C00B717DB /* UIColor+Highlight.swift in Sources */, CD615FB92655295C00B717DB /* UIColor+Highlight.swift in Sources */,
CDFE458D26566BD50021A29F /* Storage.swift in Sources */,
CD615FBA2655295C00B717DB /* UIViewController+Alert.swift in Sources */, CD615FBA2655295C00B717DB /* UIViewController+Alert.swift in Sources */,
CD615FBB2655295C00B717DB /* UITabBarController+Append.swift in Sources */, CD615FBB2655295C00B717DB /* UITabBarController+Append.swift in Sources */,
CD615FBD2655295C00B717DB /* Measurement+String.swift in Sources */, CD615FBD2655295C00B717DB /* Measurement+String.swift in Sources */,
...@@ -529,7 +563,9 @@ ...@@ -529,7 +563,9 @@
CD615F96265526E700B717DB /* UpdatableModelObjectInTime.swift in Sources */, CD615F96265526E700B717DB /* UpdatableModelObjectInTime.swift in Sources */,
CD615F97265526E700B717DB /* PartialLocation.swift in Sources */, CD615F97265526E700B717DB /* PartialLocation.swift in Sources */,
CD615F98265526E700B717DB /* GeoNamesPlace.swift in Sources */, CD615F98265526E700B717DB /* GeoNamesPlace.swift in Sources */,
CDFE458F26566C5F0021A29F /* DelayedSaveStorage.swift in Sources */,
CD615F99265526E700B717DB /* Location.swift in Sources */, CD615F99265526E700B717DB /* Location.swift in Sources */,
CDFE459426566D7B0021A29F /* HealthSource.swift in Sources */,
CD615F9A265526E700B717DB /* CurrentWeather.swift in Sources */, CD615F9A265526E700B717DB /* CurrentWeather.swift in Sources */,
CD615F9B265526E700B717DB /* DailyWeather.swift in Sources */, CD615F9B265526E700B717DB /* DailyWeather.swift in Sources */,
CD615F9C265526E700B717DB /* HourlyWeather.swift in Sources */, CD615F9C265526E700B717DB /* HourlyWeather.swift in Sources */,
......
...@@ -7,9 +7,8 @@ ...@@ -7,9 +7,8 @@
import Foundation import Foundation
/// Does the work on the main thread. If the current thread is the main thread, does the work in place. Otherwise dispatches it asynchronously. /// Does the work on the main thread. If the current thread is the main thread, does the work in place. Otherwise dispatches it asynchronously.
func onMain(_ work: @escaping () -> ()) { public func onMain(_ work: @escaping () -> ()) {
if Thread.isMainThread { if Thread.isMainThread {
work() work()
} }
......
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
import Foundation import Foundation
@propertyWrapper @propertyWrapper
struct UserDefaultsOptionalValue<T> { public struct UserDefaultsOptionalValue<T> {
let key: String public let key: String
init(_ key: String) { public init(_ key: String) {
self.key = key self.key = key
} }
var wrappedValue: T? { public var wrappedValue: T? {
get { get {
return UserDefaults.standard.object(forKey: key) as? T return UserDefaults.standard.object(forKey: key) as? T
} }
......
...@@ -9,16 +9,16 @@ ...@@ -9,16 +9,16 @@
import Foundation import Foundation
@propertyWrapper @propertyWrapper
struct UserDefaultsValue<T> { public struct UserDefaultsValue<T> {
let key: String public let key: String
let defaultValue: T public let defaultValue: T
init(_ key: String, defaultValue: T) { public init(_ key: String, defaultValue: T) {
self.key = key self.key = key
self.defaultValue = defaultValue self.defaultValue = defaultValue
} }
var wrappedValue: T { public var wrappedValue: T {
get { get {
return (UserDefaults.standard.object(forKey: key) as? T) ?? defaultValue return (UserDefaults.standard.object(forKey: key) as? T) ?? defaultValue
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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