Commit 1943a4ce by Dmitriy Stepanets

Fnished Core. Integrating WDTWeatherSource.

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