diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..330d167 --- /dev/null +++ b/.gitignore @@ -0,0 +1,90 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ +# +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ diff --git a/Covid-19 Status.xcodeproj/project.pbxproj b/Covid-19 Status.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e20b837 --- /dev/null +++ b/Covid-19 Status.xcodeproj/project.pbxproj @@ -0,0 +1,389 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + D3C1A3552427BF8900B69DCB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3C1A3542427BF8900B69DCB /* AppDelegate.swift */; }; + D3C1A3592427BF8B00B69DCB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D3C1A3582427BF8B00B69DCB /* Assets.xcassets */; }; + D3C1A35C2427BF8B00B69DCB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D3C1A35A2427BF8B00B69DCB /* Main.storyboard */; }; + D3C1A3672429904F00B69DCB /* Types.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3C1A3662429904F00B69DCB /* Types.swift */; }; + D3C1A3692429908300B69DCB /* StatsFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3C1A3682429908300B69DCB /* StatsFormatter.swift */; }; + D3C1A36B2429921800B69DCB /* fetchData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3C1A36A2429921800B69DCB /* fetchData.swift */; }; + D3C1A36E2429942200B69DCB /* Notificator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3C1A36D2429942200B69DCB /* Notificator.swift */; }; + D3C1A372242AE35700B69DCB /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3C1A371242AE35700B69DCB /* AboutViewController.swift */; }; + D3C1A377242BD81700B69DCB /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D3C1A379242BD81700B69DCB /* Localizable.strings */; }; + D3EB91C224303D1000514AB3 /* screenshots in Resources */ = {isa = PBXBuildFile; fileRef = D3EB91C124303D0F00514AB3 /* screenshots */; }; + D3EB91C524303F0C00514AB3 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = D3EB91C424303F0C00514AB3 /* LICENSE */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D3C1A3512427BF8900B69DCB /* Covid-19 Status.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Covid-19 Status.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + D3C1A3542427BF8900B69DCB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + D3C1A3582427BF8B00B69DCB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D3C1A35B2427BF8B00B69DCB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D3C1A35D2427BF8B00B69DCB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D3C1A35E2427BF8B00B69DCB /* Covid_19_Poland.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Covid_19_Poland.entitlements; sourceTree = ""; }; + D3C1A3662429904F00B69DCB /* Types.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Types.swift; sourceTree = ""; }; + D3C1A3682429908300B69DCB /* StatsFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsFormatter.swift; sourceTree = ""; }; + D3C1A36A2429921800B69DCB /* fetchData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = fetchData.swift; sourceTree = ""; }; + D3C1A36D2429942200B69DCB /* Notificator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Notificator.swift; sourceTree = ""; }; + D3C1A371242AE35700B69DCB /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; + D3C1A373242BD0E000B69DCB /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + D3C1A378242BD81700B69DCB /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; + D3C1A37B242BD90E00B69DCB /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + D3C1A383242FDA5B00B69DCB /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Main.strings; sourceTree = ""; }; + D3EB91C124303D0F00514AB3 /* screenshots */ = {isa = PBXFileReference; lastKnownFileType = folder; path = screenshots; sourceTree = ""; }; + D3EB91C424303F0C00514AB3 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D3C1A34E2427BF8900B69DCB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D3C1A3482427BF8900B69DCB = { + isa = PBXGroup; + children = ( + D3EB91C424303F0C00514AB3 /* LICENSE */, + D3EB91C124303D0F00514AB3 /* screenshots */, + D3C1A373242BD0E000B69DCB /* README.md */, + D3C1A3532427BF8900B69DCB /* Covid-19 Status */, + D3C1A3522427BF8900B69DCB /* Products */, + ); + sourceTree = ""; + }; + D3C1A3522427BF8900B69DCB /* Products */ = { + isa = PBXGroup; + children = ( + D3C1A3512427BF8900B69DCB /* Covid-19 Status.app */, + ); + name = Products; + sourceTree = ""; + }; + D3C1A3532427BF8900B69DCB /* Covid-19 Status */ = { + isa = PBXGroup; + children = ( + D3C1A36C2429934700B69DCB /* src */, + D3C1A3582427BF8B00B69DCB /* Assets.xcassets */, + D3C1A35A2427BF8B00B69DCB /* Main.storyboard */, + D3C1A35D2427BF8B00B69DCB /* Info.plist */, + D3C1A35E2427BF8B00B69DCB /* Covid_19_Poland.entitlements */, + D3C1A379242BD81700B69DCB /* Localizable.strings */, + ); + path = "Covid-19 Status"; + sourceTree = ""; + }; + D3C1A36C2429934700B69DCB /* src */ = { + isa = PBXGroup; + children = ( + D3C1A371242AE35700B69DCB /* AboutViewController.swift */, + D3C1A3542427BF8900B69DCB /* AppDelegate.swift */, + D3C1A3662429904F00B69DCB /* Types.swift */, + D3C1A3682429908300B69DCB /* StatsFormatter.swift */, + D3C1A36A2429921800B69DCB /* fetchData.swift */, + D3C1A36D2429942200B69DCB /* Notificator.swift */, + ); + path = src; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D3C1A3502427BF8900B69DCB /* Covid-19 Status */ = { + isa = PBXNativeTarget; + buildConfigurationList = D3C1A3612427BF8B00B69DCB /* Build configuration list for PBXNativeTarget "Covid-19 Status" */; + buildPhases = ( + D3C1A34D2427BF8900B69DCB /* Sources */, + D3C1A34E2427BF8900B69DCB /* Frameworks */, + D3C1A34F2427BF8900B69DCB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Covid-19 Status"; + productName = "Covid-19 Poland"; + productReference = D3C1A3512427BF8900B69DCB /* Covid-19 Status.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D3C1A3492427BF8900B69DCB /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1130; + LastUpgradeCheck = 1130; + ORGANIZATIONNAME = "Marcin Gajda"; + TargetAttributes = { + D3C1A3502427BF8900B69DCB = { + CreatedOnToolsVersion = 11.3.1; + }; + }; + }; + buildConfigurationList = D3C1A34C2427BF8900B69DCB /* Build configuration list for PBXProject "Covid-19 Status" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + pl, + ); + mainGroup = D3C1A3482427BF8900B69DCB; + productRefGroup = D3C1A3522427BF8900B69DCB /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D3C1A3502427BF8900B69DCB /* Covid-19 Status */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D3C1A34F2427BF8900B69DCB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D3EB91C224303D1000514AB3 /* screenshots in Resources */, + D3C1A3592427BF8B00B69DCB /* Assets.xcassets in Resources */, + D3C1A377242BD81700B69DCB /* Localizable.strings in Resources */, + D3C1A35C2427BF8B00B69DCB /* Main.storyboard in Resources */, + D3EB91C524303F0C00514AB3 /* LICENSE in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D3C1A34D2427BF8900B69DCB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D3C1A36E2429942200B69DCB /* Notificator.swift in Sources */, + D3C1A3692429908300B69DCB /* StatsFormatter.swift in Sources */, + D3C1A36B2429921800B69DCB /* fetchData.swift in Sources */, + D3C1A3672429904F00B69DCB /* Types.swift in Sources */, + D3C1A3552427BF8900B69DCB /* AppDelegate.swift in Sources */, + D3C1A372242AE35700B69DCB /* AboutViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + D3C1A35A2427BF8B00B69DCB /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D3C1A35B2427BF8B00B69DCB /* Base */, + D3C1A383242FDA5B00B69DCB /* pl */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + D3C1A379242BD81700B69DCB /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + D3C1A378242BD81700B69DCB /* pl */, + D3C1A37B242BD90E00B69DCB /* en */, + ); + name = Localizable.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + D3C1A35F2427BF8B00B69DCB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + D3C1A3602427BF8B00B69DCB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + D3C1A3622427BF8B00B69DCB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Covid-19 Status/Covid_19_Status.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 5; + DEVELOPMENT_TEAM = RGC8BFYMY4; + ENABLE_HARDENED_RUNTIME = YES; + INFOPLIST_FILE = "Covid-19 Status/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = "pl.mgdevelop.covid-19-status"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + D3C1A3632427BF8B00B69DCB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Covid-19 Status/Covid_19_Status.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 5; + DEVELOPMENT_TEAM = RGC8BFYMY4; + ENABLE_HARDENED_RUNTIME = YES; + INFOPLIST_FILE = "Covid-19 Status/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = "pl.mgdevelop.covid-19-status"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D3C1A34C2427BF8900B69DCB /* Build configuration list for PBXProject "Covid-19 Status" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D3C1A35F2427BF8B00B69DCB /* Debug */, + D3C1A3602427BF8B00B69DCB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D3C1A3612427BF8B00B69DCB /* Build configuration list for PBXNativeTarget "Covid-19 Status" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D3C1A3622427BF8B00B69DCB /* Debug */, + D3C1A3632427BF8B00B69DCB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D3C1A3492427BF8900B69DCB /* Project object */; +} diff --git a/Covid-19 Status.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Covid-19 Status.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..d0bf06f --- /dev/null +++ b/Covid-19 Status.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,11 @@ + + + + + + + diff --git a/Covid-19 Status.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Covid-19 Status.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Covid-19 Status.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Covid-19 Status.xcodeproj/xcshareddata/xcschemes/Covid-19 Status.xcscheme b/Covid-19 Status.xcodeproj/xcshareddata/xcschemes/Covid-19 Status.xcscheme new file mode 100644 index 0000000..413d226 --- /dev/null +++ b/Covid-19 Status.xcodeproj/xcshareddata/xcschemes/Covid-19 Status.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/1024.png b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100755 index 0000000..6d527af Binary files /dev/null and b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/128.png b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/128.png new file mode 100755 index 0000000..03f7a1a Binary files /dev/null and b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/128.png differ diff --git a/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/16.png b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/16.png new file mode 100755 index 0000000..cc72752 Binary files /dev/null and b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/16.png differ diff --git a/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/256.png b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/256.png new file mode 100755 index 0000000..002c920 Binary files /dev/null and b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/256.png differ diff --git a/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/32.png b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/32.png new file mode 100755 index 0000000..e9a1d9e Binary files /dev/null and b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/32.png differ diff --git a/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/512.png b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/512.png new file mode 100755 index 0000000..834be7e Binary files /dev/null and b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/512.png differ diff --git a/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/64.png b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/64.png new file mode 100755 index 0000000..417ceb5 Binary files /dev/null and b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/64.png differ diff --git a/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/Contents.json b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..2003d5b --- /dev/null +++ b/Covid-19 Status/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1 @@ +{"images":[{"size":"128x128","expected-size":"128","filename":"128.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"256x256","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"128x128","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"256x256","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"512x512","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"16","filename":"16.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"64","filename":"64.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"512x512","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"}]} \ No newline at end of file diff --git a/Covid-19 Status/Assets.xcassets/Contents.json b/Covid-19 Status/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Covid-19 Status/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Covid-19 Status/Assets.xcassets/logo.imageset/Contents.json b/Covid-19 Status/Assets.xcassets/logo.imageset/Contents.json new file mode 100644 index 0000000..13df9ef --- /dev/null +++ b/Covid-19 Status/Assets.xcassets/logo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon7.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Covid-19 Status/Assets.xcassets/logo.imageset/icon7.png b/Covid-19 Status/Assets.xcassets/logo.imageset/icon7.png new file mode 100644 index 0000000..cbfe0c3 Binary files /dev/null and b/Covid-19 Status/Assets.xcassets/logo.imageset/icon7.png differ diff --git a/Covid-19 Status/Base.lproj/Main.storyboard b/Covid-19 Status/Base.lproj/Main.storyboard new file mode 100644 index 0000000..9db8e35 --- /dev/null +++ b/Covid-19 Status/Base.lproj/Main.storyboard @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Covid-19 Status/Covid_19_Status.entitlements b/Covid-19 Status/Covid_19_Status.entitlements new file mode 100644 index 0000000..625af03 --- /dev/null +++ b/Covid-19 Status/Covid_19_Status.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + com.apple.security.network.client + + + diff --git a/Covid-19 Status/Info.plist b/Covid-19 Status/Info.plist new file mode 100644 index 0000000..43fcff7 --- /dev/null +++ b/Covid-19 Status/Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSApplicationCategoryType + public.app-category.utilities + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + LSUIElement + + NSHumanReadableCopyright + Copyright © 2020 Marcin Gajda. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/Covid-19 Status/en.lproj/Localizable.strings b/Covid-19 Status/en.lproj/Localizable.strings new file mode 100644 index 0000000..3c43453 --- /dev/null +++ b/Covid-19 Status/en.lproj/Localizable.strings @@ -0,0 +1,60 @@ + +/* Class = "NSMenuItem"; title = "Covid-19 Status"; ObjectID = "1Xt-HY-uBw"; */ +"1Xt-HY-uBw.title" = "Covid-19 Status"; + +/* Class = "NSMenuItem"; title = "Quit"; ObjectID = "4sb-4s-VLi"; */ +"4sb-4s-VLi.title" = "Zamknij"; + +/* Class = "NSMenuItem"; title = "Loading"; ObjectID = "5kV-Vb-QxS"; */ +"5kV-Vb-QxS.title" = "Ładowanie"; + +/* Class = "NSMenuItem"; title = "Retry now"; ObjectID = "6jx-Ii-JOn"; */ +"6jx-Ii-JOn.title" = "Spróbuj ponownie"; + +/* Class = "NSMenuItem"; title = "About..."; ObjectID = "8AQ-8p-cQP"; */ +"8AQ-8p-cQP.title" = "O aplikacji..."; + +/* Class = "NSMenu"; title = "Main Menu"; ObjectID = "AYu-sK-qS6"; */ +"AYu-sK-qS6.title" = "Menu główne"; + +/* Class = "NSButtonCell"; title = "Close"; ObjectID = "E40-p5-Mjh"; */ +"E40-p5-Mjh.title" = "Zamknij"; + +/* Class = "NSWindow"; title = "About"; ObjectID = "EIX-4g-u9N"; */ +"EIX-4g-u9N.title" = "O programie"; + +/* Class = "NSMenuItem"; title = "Select region"; ObjectID = "MAg-rl-DVH"; */ +"MAg-rl-DVH.title" = "Wybierz region"; + +/* Class = "NSTextFieldCell"; title = "version: 1.0.0"; ObjectID = "OSg-Ed-kOh"; */ +"OSg-Ed-kOh.title" = "wersja: 1.0.0"; + +/* Class = "NSMenu"; title = "Select region"; ObjectID = "URq-Fm-ggV"; */ +"URq-Fm-ggV.title" = "Wybierz region"; + +/* Class = "NSTextFieldCell"; title = "COVID-19 Status"; ObjectID = "YJw-ga-rD7"; */ +"YJw-ga-rD7.title" = "COVID-19 Status"; + +/* Class = "NSBox"; title = "Box"; ObjectID = "dPt-xi-xGS"; */ +"dPt-xi-xGS.title" = "Box"; + +/* Class = "NSTextFieldCell"; title = "https://iconmonstr.com/virus-2-svg/"; ObjectID = "er1-QF-EuT"; */ +"er1-QF-EuT.title" = "https://iconmonstr.com/virus-2-svg/"; + +/* Class = "NSMenuItem"; title = "Brak"; ObjectID = "i8c-sB-7Tp"; */ +"i8c-sB-7Tp.title" = "Brak"; + +/* Class = "NSTextFieldCell"; title = "https://corona-stats.online/?source=2"; ObjectID = "lhY-fZ-nQY"; */ +"lhY-fZ-nQY.title" = "https://corona-stats.online/?source=2"; + +/* Class = "NSMenuItem"; title = "Show notifications"; ObjectID = "ljG-1J-Upa"; */ +"ljG-1J-Upa.title" = "Pokazuj powiadomienia"; + +/* Class = "NSTextFieldCell"; title = "Data source"; ObjectID = "spg-XS-UDd"; */ +"spg-XS-UDd.title" = "Źródło danych"; + +/* Class = "NSMenu"; title = "Covid-19 Status"; ObjectID = "uQy-DD-JDr"; */ +"uQy-DD-JDr.title" = "Covid-19 Status"; + +/* Class = "NSTextFieldCell"; title = "Logo icon"; ObjectID = "uop-yu-b1c"; */ +"uop-yu-b1c.title" = "Ikona logo"; diff --git a/Covid-19 Status/pl.lproj/Localizable.strings b/Covid-19 Status/pl.lproj/Localizable.strings new file mode 100644 index 0000000..16d97a3 --- /dev/null +++ b/Covid-19 Status/pl.lproj/Localizable.strings @@ -0,0 +1,214 @@ +/* + Localizable.strings" + Covid-19 Status" + + Created by Marcin Gajda on 25/03/2020." + Copyright © 2020 Marcin Gajda. All rights reserved." +*/ + +"COVID-19 (%@): Confirmed | Deaths | Recured" = "COVID-19 (%@): Przypadki | Zgony | Wyzdrowienia"; +"Today: +%@ confirmed +%@ deaths" = "Dzisiaj: +%@ przypadki +%@ zgony"; +"version %@" = "wesja %@"; +"COVID-19 Status: Error" = "COVID-19 Status: Błąd"; +"unknown cause" = "powód nieznany"; + +"World" = "Świat"; +"Afghanistan" = "Afganistan"; +"Albania" = "Albania"; +"Algeria" = "Algieria"; +"Andorra" = "Andora"; +"Angola" = "Angola"; +"Antigua and Barbuda" = "Antigua i Barbuda"; +"Saudi Arabia" = "Arabia Saudyjska"; +"Argentina" = "Argentyna"; +"Armenia" = "Armenia"; +"Aruba" = "Aruba"; +"Australia" = "Australia"; +"Austria" = "Austria"; +"Azerbaijan" = "Azerbejdżan"; +"Bahamas" = "Bahamas"; +"Bahrain" = "Bahrajn"; +"Bangladesh" = "Bangladesz"; +"Barbados" = "Barbados"; +"Belgium" = "Belgia"; +"Belize" = "Belize"; +"Benin" = "Benin"; +"Bermuda" = "Bermudy"; +"Bhutan" = "Bhutan"; +"Belarus" = "Białoruś"; +"Bolivia" = "Boliwia"; +"Bosnia" = "Bośnia"; +"Brazil" = "Brazylia"; +"British Virgin Islands" = "Brytyjskie Wyspy Dziewicze"; +"Brunei" = "Brunei"; +"Burkina Faso" = "Burkina Faso"; +"Bulgaria" = "Bułgaria"; +"Chile" = "Chile"; +"China" = "Chiny"; +"Croatia" = "Chorwacja"; +"Coast D'Ivoire" = "Wybrzeże Kości Słoniowej"; +"Colombia" = "Kolumbia"; +"Congo" = "Kongo"; +"Congo, the Democratic Republic of the" = "Kongo, Republika Demokratyczna"; +"Curaçao" = "Curaçao"; +"Cyprus" = "Cypr"; +"Chad" = "Czad"; +"Montenegro" = "Czarnogóra"; +"Czechia" = "Czechy"; +"Denmark" = "Dania"; +"Dominica" = "Dominika"; +"Dominican Republic" = "Republika Dominikany"; +"Djibouti" = "Dżibuti"; +"Ecuador" = "Ekwador"; +"Egypt" = "Egipt"; +"Eritrea" = "Erytrea"; +"Estonia" = "Estonia"; +"Ethiopia" = "Etiopia"; +"Faroe Islands" = "Wyspy Owcze"; +"Fiji" = "Fidżi"; +"Philippines" = "Filipiny"; +"Finland" = "Finlandia"; +"France" = "Francja"; +"Gabon" = "Gabon"; +"Gambia" = "Gambia"; +"Ghana" = "Ghana"; +"Gibraltar" = "Gibraltar"; +"Greece" = "Grecja"; +"Greenland" = "Grenlandia"; +"Grenada" = "Grenada"; +"Georgia" = "Gruzja"; +"Guadeloupe" = "Gwadelupa"; +"French Guiana" = "Gujana Francuska"; +"Guyana" = "Gujana"; +"Guatemala" = "Gwatemala"; +"Guinea" = "Gwinea"; +"Guinea-Bissau" = "Gwinea Bissau"; +"Equatorial Guinea" = "Gwinea Równikowa"; +"Haiti" = "Haiti"; +"Spain" = "Hiszpania"; +"Netherlands" = "Holandia"; +"Holy See (Vatican City State)" = "Stolica Apostolska (Państwo Watykańskie)"; +"Honduras" = "Honduras"; +"Hong Kong" = "Hongkong"; +"India" = "Indie"; +"Indonesia" = "Indonezja"; +"Iraq" = "Irak"; +"Iran, Islamic Republic of" = "Iran, Islamska Republika"; +"Ireland" = "Irlandia"; +"Iceland" = "Islandia"; +"Israel" = "Izrael"; +"Jamaica" = "Jamajka"; +"Japan" = "Japonia"; +"Jordan" = "Jordania"; +"Cayman Islands" = "Kajmany"; +"Cambodia" = "Kambodża"; +"Cameroon" = "Kamerun"; +"Canada" = "Kanada"; +"Qatar" = "Katar"; +"Kazakhstan" = "Kazachstan"; +"Kenya" = "Kenia"; +"Kyrgyzstan" = "Kirgistan"; +"S. Korea" = "Korea Południowa"; +"Costa Rica" = "Kostaryka"; +"Cuba" = "Kuba"; +"Kuwait" = "Kuwejt"; +"Lao People's Democratic Republic" = "Laotańska Republika Ludowo-Demokratyczna"; +"Lebanon" = "Liban"; +"Liberia" = "Liberia"; +"Libyan Arab Jamahiriya" = "Libia"; +"Liechtenstein" = "Liechtenstein"; +"Lithuania" = "Litwa"; +"Latvia" = "Łotwa"; +"Luxembourg" = "Luksemburg"; +"Macedonia, the former Yugoslav Republic of" = "Macedonia, Była Jugosłowiańska Republika"; +"Madagascar" = "Madagaskar"; +"Mayotte" = "Majotta"; +"Macao" = "Makao"; +"Malaysia" = "Malezja"; +"Maldives" = "Malediwy"; +"Mali" = "Mali"; +"Malta" = "Malta"; +"Morocco" = "Maroko"; +"Martinique" = "Martynika"; +"Mauritania" = "Mauretania"; +"Mauritius" = "Mauritius"; +"Mexico" = "Meksyk"; +"Moldova, Republic of" = "Mołdawia, Republika"; +"Monaco" = "Monaco"; +"Mongolia" = "Mongolia"; +"Montserrat" = "Montserrat"; +"Mozambique" = "Mozambik"; +"Myanmar" = "Myanmar"; +"Namibia" = "Namibia"; +"Nepal" = "Nepal"; +"Germany" = "Niemcy"; +"Niger" = "Niger"; +"Nigeria" = "Nigeria"; +"Nicaragua" = "Nikaragua"; +"Norway" = "Norwegia"; +"New Caledonia" = "Nowa Kaledonia"; +"New Zealand" = "Nowa Zelandia"; +"Oman" = "Oman"; +"Pakistan" = "Pakistan"; +"Palestinian Territory, Occupied" = "Teretorium Paleństynskie, Okupowane"; +"Panama" = "Panama"; +"Papua New Guinea" = "Papua Nowa Gwinea"; +"Paraguay" = "Paragwaj"; +"Peru" = "Peru"; +"French Polynesia" = "Polinezja Francuska"; +"Poland" = "Polska"; +"Portugal" = "Portugalia"; +"South Africa" = "Afryka Południowa"; +"Central African Republic" = "Republika Środkowoafrykańska"; +"Réunion" = "Réunion"; +"Russia" = "Rosja"; +"Romania" = "Rumunia"; +"Rwanda" = "Rwanda"; +"Saint Kitts and Nevis" = "Saint Kitts i Nevis"; +"Saint Lucia" = "Saint Lucia"; +"Saint Martin" = "Sint Maarten"; +"Saint Vincent and the Grenadines" = "Saint Vincent i Grenadyny"; +"El Salvador" = "Salwador"; +"San Marino" = "San Marino"; +"Senegal" = "Senegal"; +"Serbia" = "Serbia"; +"Seychelles" = "Seszele"; +"Singapore" = "Singapur"; +"Sint Maarten" = "Sint Maarten"; +"Somalia" = "Somali"; +"Sri Lanka" = "Sri Lanka"; +"USA" = "USA"; +"Diamond Princess" = "Statek Diamond Princess"; +"Swaziland" = "Suazi"; +"Sudan" = "Sudan"; +"Suriname" = "Surinam"; +"Syrian Arab Republic" = "Republika Syryjsko-Arabska"; +"Switzerland" = "Szwajcaria"; +"Sweden" = "Szwecja"; +"Slovakia" = "Słowacja"; +"Slovenia" = "Słowenia"; +"Taiwan" = "Tajwan"; +"Thailand" = "Tajlandia"; +"Tanzania, United Republic of" = "Tanzania, Zjednoczona Republika"; +"Timor-Leste" = "Timor Wschodni"; +"Togo" = "Togo"; +"Trinidad and Tobago" = "Trynidad i Tobago"; +"Tunisia" = "Tunezja"; +"Turkey" = "Turcja"; +"Turks and Caicos Islands" = "Wyspy Turks i Caicos"; +"Uganda" = "Uganda"; +"Ukraine" = "Ukraina"; +"Uruguay" = "Urugwaj"; +"Uzbekistan" = "Uzbekistan"; +"Venezuela, Bolivarian Republic of" = "Wenezuela, Boliwariańska Republika"; +"Viet Nam" = "Wietnam"; +"UK" = "Wielka Brytania"; +"St. Barth" = "St Barth"; +"Isle of Man" = "Isle of Man"; +"Channel Islands" = "Wyspy Normandzkie"; +"Cabo Verde" = "Cabo Verde"; +"Hungary" = "Węgry"; +"Italy" = "Włochy"; +"Zambia" = "Zambia"; +"Zimbabwe" = "Zimbabwe"; +"UAE" = "ZEA"; diff --git a/Covid-19 Status/pl.lproj/Main.strings b/Covid-19 Status/pl.lproj/Main.strings new file mode 100644 index 0000000..81b33c4 --- /dev/null +++ b/Covid-19 Status/pl.lproj/Main.strings @@ -0,0 +1,60 @@ + +/* Class = "NSMenuItem"; title = "Covid-19 Status"; ObjectID = "1Xt-HY-uBw"; */ +"1Xt-HY-uBw.title" = "Covid-19 Status"; + +/* Class = "NSMenuItem"; title = "Quit"; ObjectID = "4sb-4s-VLi"; */ +"4sb-4s-VLi.title" = "Zamknij"; + +/* Class = "NSMenuItem"; title = "Loading"; ObjectID = "5kV-Vb-QxS"; */ +"5kV-Vb-QxS.title" = "Ładowanie"; + +/* Class = "NSMenuItem"; title = "Retry now"; ObjectID = "6jx-Ii-JOn"; */ +"6jx-Ii-JOn.title" = "Spróbuj ponownie"; + +/* Class = "NSMenuItem"; title = "About..."; ObjectID = "8AQ-8p-cQP"; */ +"8AQ-8p-cQP.title" = "O programie..."; + +/* Class = "NSMenu"; title = "Main Menu"; ObjectID = "AYu-sK-qS6"; */ +"AYu-sK-qS6.title" = "Menu główne"; + +/* Class = "NSButtonCell"; title = "Close"; ObjectID = "E40-p5-Mjh"; */ +"E40-p5-Mjh.title" = "Zamknij"; + +/* Class = "NSWindow"; title = "About"; ObjectID = "EIX-4g-u9N"; */ +"EIX-4g-u9N.title" = "O programie"; + +/* Class = "NSMenuItem"; title = "Select region"; ObjectID = "MAg-rl-DVH"; */ +"MAg-rl-DVH.title" = "Wybierz region"; + +/* Class = "NSTextFieldCell"; title = "version: 1.0.0"; ObjectID = "OSg-Ed-kOh"; */ +"OSg-Ed-kOh.title" = "version: 1.0.0"; + +/* Class = "NSMenu"; title = "Select region"; ObjectID = "URq-Fm-ggV"; */ +"URq-Fm-ggV.title" = "Wybierz region"; + +/* Class = "NSMenuItem"; title = "sdfsdf"; ObjectID = "VOq-y0-SEH"; */ +"VOq-y0-SEH.title" = "sdfsdf"; + +/* Class = "NSTextFieldCell"; title = "COVID-19 Status"; ObjectID = "YJw-ga-rD7"; */ +"YJw-ga-rD7.title" = "COVID-19 Status"; + +/* Class = "NSBox"; title = "Box"; ObjectID = "dPt-xi-xGS"; */ +"dPt-xi-xGS.title" = "Box"; + +/* Class = "NSMenuItem"; title = "None"; ObjectID = "i8c-sB-7Tp"; */ +"i8c-sB-7Tp.title" = "Brak"; + +/* Class = "NSTextFieldCell"; title = "https://corona-stats.online/?source=2"; ObjectID = "lhY-fZ-nQY"; */ +"lhY-fZ-nQY.title" = "https://corona-stats.online/?source=2"; + +/* Class = "NSMenuItem"; title = "Show notifications"; ObjectID = "ljG-1J-Upa"; */ +"ljG-1J-Upa.title" = "Pokaż powiadomienia"; + +/* Class = "NSTextFieldCell"; title = "Data source"; ObjectID = "spg-XS-UDd"; */ +"spg-XS-UDd.title" = "Źródło danych"; + +/* Class = "NSMenu"; title = "Covid-19 Status"; ObjectID = "uQy-DD-JDr"; */ +"uQy-DD-JDr.title" = "Covid-19 Status"; + +/* Class = "NSTextFieldCell"; title = "Daily data resets at midnight GMT+0"; ObjectID = "uop-yu-b1c"; */ +"uop-yu-b1c.title" = "Dane dzienne resetują się o północy GMT+0"; diff --git a/Covid-19 Status/src/AboutViewController.swift b/Covid-19 Status/src/AboutViewController.swift new file mode 100644 index 0000000..b500dbe --- /dev/null +++ b/Covid-19 Status/src/AboutViewController.swift @@ -0,0 +1,36 @@ +// +// AboutViewController.swift +// Covid-19 Status +// +// Created by Marcin Gajda on 25/03/2020. +// Copyright © 2020 Marcin Gajda. All rights reserved. +// + +import Cocoa +import Foundation + +class AboutViewController: NSViewController { + @IBOutlet weak var sourceLink: NSTextField! + @IBOutlet weak var version: NSTextField! + + + override func viewDidLoad() { + super.viewDidLoad(); + + let versionNumber = (Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String)!; + version.stringValue = String(format: NSLocalizedString("version %@", comment: ""), versionNumber); + + let sourceClick = NSClickGestureRecognizer(target: self, action: #selector(self.sourceLinkHandler(sender:))); + sourceLink.addGestureRecognizer(sourceClick); + + NSApplication.shared.activate(ignoringOtherApps: true); + } + + @IBAction func sourceLinkHandler(sender: NSClickGestureRecognizer) { + NSWorkspace.shared.open(URL(string:sourceLink.stringValue )!); + } + + @IBAction func dismissAboutWindow(_ sender: NSButton) { + view.window?.close(); + } +} diff --git a/Covid-19 Status/src/AppDelegate.swift b/Covid-19 Status/src/AppDelegate.swift new file mode 100644 index 0000000..355e7f2 --- /dev/null +++ b/Covid-19 Status/src/AppDelegate.swift @@ -0,0 +1,193 @@ +// +// AppDelegate.swift +// Covid-19 Poland +// +// Created by Marcin Gajda on 22/03/2020. +// Copyright © 2020 Marcin Gajda. All rights reserved. +// + +import Cocoa +import Foundation + +var WORLD = "World"; + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + let settings = UserDefaults.standard; + + var statusBarItem: NSStatusItem!; + var button: NSStatusBarButton!; + var notificator: Notificator = Notificator(); + var aboutWindowController: NSWindowController!; + + var lastCoronaStats: CoronaStats!; + var timer: Timer!; + + @IBOutlet weak var menu: NSMenu? + @IBOutlet weak var regionMenu: NSMenu? + @IBOutlet weak var retryMenuItem: NSMenuItem? + @IBOutlet weak var deltaMenuItem: NSMenuItem? + @IBOutlet weak var alertsMenuItem: NSMenuItem? + + var currentRegion: String = WORLD; + var alertsEnabled: Bool = false; + + func findRegionMenuItem(regionName: String) -> NSMenuItem? { + return regionMenu?.item(withTitle: NSLocalizedString(regionName, comment: "")); + } + + func setCurrentRegion(newRegion: String) { + findRegionMenuItem(regionName: currentRegion)?.state = .off; + findRegionMenuItem(regionName: newRegion)?.state = .on; + + currentRegion = newRegion; + settings.set(newRegion, forKey: "country"); + } + + func setAlertsEnabled(enabled: Bool) { + alertsEnabled = enabled; + notificator.isEnabled = enabled; + alertsMenuItem?.state = enabled ? .on : .off; + settings.set(enabled, forKey: "alerts"); + } + + func getCurrentRegionStats() -> RegionStats { + return currentRegion == WORLD + ? lastCoronaStats.worldStats + : lastCoronaStats.data.first(where: { (countryStats) -> Bool in + countryStats.country == self.currentRegion; + }) ?? lastCoronaStats.worldStats; + } + + func sortCountries(data: [RegionStats]) -> [RegionStats] { + return data.sorted(by: { + let name1 = NSLocalizedString($0.country, comment: ""); + let name2 = NSLocalizedString($1.country, comment: ""); + + return name1.localizedCompare(name2) == .orderedAscending; + }) + } + + func updateRegionMenu(coronaStats: CoronaStats) { + self.regionMenu?.removeAllItems(); + + let worldItem = NSMenuItem(); + worldItem.title = NSLocalizedString(WORLD, comment: "menu"); + worldItem.action = #selector(self.changeRegionHandler(sender:)); + worldItem.representedObject = WORLD; + self.regionMenu?.addItem(worldItem); + + self.regionMenu?.addItem(NSMenuItem.separator()); + + for countryStats in sortCountries(data: coronaStats.data) { +// print(countryStats.country); + let countryItem = NSMenuItem(); + countryItem.title = NSLocalizedString(countryStats.country, comment: "menu"); + countryItem.action = #selector(self.changeRegionHandler(sender:)); + countryItem.representedObject = countryStats.country; + self.regionMenu?.addItem(countryItem); + } + + findRegionMenuItem(regionName: currentRegion)?.state = .on; + } + + func refreshView() { + if lastCoronaStats == nil { + return; + } + + let formatter = StatsFormatter(stats: getCurrentRegionStats()); + + DispatchQueue.main.async { + self.button.attributedTitle = formatter.getRegionStatus(); + self.deltaMenuItem?.title = formatter.getRegionDelta(); + self.button.toolTip = formatter.getTooltip(); + } + } + + @IBAction func alertsSwitchHandler(_ sender: NSMenuItem) { + setAlertsEnabled(enabled: !alertsEnabled); + } + + @objc func changeRegionHandler(sender: NSMenuItem) { + setCurrentRegion(newRegion: sender.representedObject as! String); + refreshView(); + } + + func showError(message: String) { + DispatchQueue.main.async { + self.button.attributedTitle = menuBarTextFormatter( + label: NSLocalizedString("COVID-19 Status: Error", comment: "") + ); + self.deltaMenuItem?.title = message; + self.button.toolTip = message; + } + } + + @objc func doUpdate() { + print("Updating data") + fetchData() { coronaStats, error in + guard let coronaStats = coronaStats else { + self.showError(message: error ?? NSLocalizedString("unknown cause", comment: "")); + self.retryMenuItem?.isHidden = false; + return; + } + + if self.regionMenu?.items.count != coronaStats.data.count + 2 { + print("Updating region menu"); + self.updateRegionMenu(coronaStats: coronaStats); + } + + self.retryMenuItem?.isHidden = true; + self.lastCoronaStats = coronaStats; + self.refreshView(); + self.notificator.handle(newStats: self.getCurrentRegionStats()) + }; + } + + func applicationDidFinishLaunching(_ aNotification: Notification) { + let statusBar = NSStatusBar.system + statusBarItem = statusBar.statusItem(withLength: NSStatusItem.variableLength); + button = statusBarItem.button; + + guard button !== nil else { + print("Status bar item failed. Try removing some menu bar item."); + NSApp.terminate(nil) + return + } + + if let menu = menu { + statusBarItem?.menu = menu + } + + setCurrentRegion(newRegion: settings.string(forKey: "country") ?? WORLD) + setAlertsEnabled(enabled: settings.bool(forKey: "alerts")) + + doUpdate(); + + timer = Timer.scheduledTimer( + timeInterval: 3 * 60, + target: self, + selector: #selector(self.doUpdate), + userInfo: nil, + repeats: true + ) + } + + @IBAction func showAboutWindow(_ sender: AnyObject) { + let storyboard = NSStoryboard(name: "Main", bundle: nil) + + if aboutWindowController != nil { + aboutWindowController.close(); + } + + aboutWindowController = storyboard.instantiateController(withIdentifier: "About Window Controller") as? NSWindowController + aboutWindowController.showWindow(self) + } + + + @IBAction func retryHandler(_ sender: AnyObject) { + doUpdate(); + } +} + diff --git a/Covid-19 Status/src/Notificator.swift b/Covid-19 Status/src/Notificator.swift new file mode 100644 index 0000000..e71020b --- /dev/null +++ b/Covid-19 Status/src/Notificator.swift @@ -0,0 +1,48 @@ +// +// Notificator.swift +// Covid-19 Status +// +// Created by Marcin Gajda on 24/03/2020. +// Copyright © 2020 Marcin Gajda. All rights reserved. +// + +import Foundation + +class Notificator { + var lastUpdates: Dictionary = [:]; + var isEnabled = false; + + func showNotification(stats: RegionStats) { + let formatter = StatsFormatter(stats: stats); + + let notification = NSUserNotification(); + notification.identifier = formatter.getUniqueId(); + notification.title = "COVID-19 Update (\(stats.country))"; + notification.subtitle = formatter.getRegionStatus().string; + notification.informativeText = formatter.getRegionDelta(); + notification.soundName = NSUserNotificationDefaultSoundName; + + let notificationCenter = NSUserNotificationCenter.default + notificationCenter.deliver(notification); + } + + func isUpdated(nextStats: RegionStats) -> Bool { + guard let previousStats = lastUpdates[nextStats.country] else { + return false; + } + + return ( + previousStats.cases != nextStats.cases || + previousStats.deaths != nextStats.deaths || + previousStats.recovered != nextStats.recovered + ); + } + + func handle(newStats: RegionStats) { + if (isUpdated(nextStats: newStats) && isEnabled) { + showNotification(stats: newStats); + } + + lastUpdates[newStats.country] = newStats; + } +} diff --git a/Covid-19 Status/src/StatsFormatter.swift b/Covid-19 Status/src/StatsFormatter.swift new file mode 100644 index 0000000..be7cea2 --- /dev/null +++ b/Covid-19 Status/src/StatsFormatter.swift @@ -0,0 +1,64 @@ +// +// Format.swift +// Covid-19 Status +// +// Created by Marcin Gajda on 24/03/2020. +// Copyright © 2020 Marcin Gajda. All rights reserved. +// + +import Cocoa +import Foundation + +func menuBarTextFormatter(label: String) -> NSMutableAttributedString { + let text = NSMutableAttributedString() + + text.append(NSAttributedString( + string: label, + attributes:[ + .font: NSFont.menuBarFont(ofSize: 12), + .baselineOffset: -1.5 + ] + )) + + return text; +} + +class StatsFormatter { + var stats: RegionStats; + + init(stats: RegionStats) { + self.stats = stats; + } + + func formatStatistic(value: Int) -> String { + let numberFormatter = NumberFormatter() + numberFormatter.numberStyle = NumberFormatter.Style.decimal + numberFormatter.groupingSeparator = " " + return numberFormatter.string(from: NSNumber(value: value)) ?? "??" + } + + func getUniqueId() -> String { + return "\(stats.country) \(stats.cases) \(stats.deaths) \(stats.recovered)"; + } + + func getRegionStatus() -> NSMutableAttributedString { + let value1 = formatStatistic(value: stats.cases); + let value2 = formatStatistic(value: stats.deaths); + let value3 = formatStatistic(value: stats.recovered); + + return menuBarTextFormatter(label: "😷 \(value1) 💀 \(value2) ❤️ \(value3)"); + } + + func getRegionDelta() -> String { + let value1 = formatStatistic(value: stats.todayCases ?? 0); + let value2 = formatStatistic(value: stats.todayDeaths ?? 0); + + return String(format: NSLocalizedString("Today: +%@ confirmed +%@ deaths", comment: ""), value1, value2); + } + + func getTooltip() -> String { + let countryName = NSLocalizedString(stats.country, comment: ""); + return String(format: NSLocalizedString("COVID-19 (%@): Confirmed | Deaths | Recured", comment: ""), countryName); + } + +} diff --git a/Covid-19 Status/src/Types.swift b/Covid-19 Status/src/Types.swift new file mode 100644 index 0000000..678a953 --- /dev/null +++ b/Covid-19 Status/src/Types.swift @@ -0,0 +1,23 @@ +// +// Types.swift +// Covid-19 Status +// +// Created by Marcin Gajda on 24/03/2020. +// Copyright © 2020 Marcin Gajda. All rights reserved. +// + +struct RegionStats: Decodable { + let country: String; + let cases: Int; + let todayCases: Int?; + let deaths: Int; + let todayDeaths: Int?; + let recovered: Int; + let active: Int; + let critical: Int; +} + +struct CoronaStats: Decodable { + let data: [RegionStats]; + let worldStats: RegionStats; +} diff --git a/Covid-19 Status/src/fetchData.swift b/Covid-19 Status/src/fetchData.swift new file mode 100644 index 0000000..2566b17 --- /dev/null +++ b/Covid-19 Status/src/fetchData.swift @@ -0,0 +1,45 @@ +// +// fetchData.swift +// Covid-19 Status +// +// Created by Marcin Gajda on 24/03/2020. +// Copyright © 2020 Marcin Gajda. All rights reserved. +// + +import Foundation + +var API = "https://corona-stats.online?format=json&source=2"; + +func fetchData(completion: @escaping ((CoronaStats?, String?) -> Void)) { + let request = NSMutableURLRequest( + url: NSURL(string: API)! as URL, + cachePolicy: .useProtocolCachePolicy, + timeoutInterval: 10.0 + ) + + request.httpMethod = "GET" + let session = URLSession.shared + + let dataTask = session.dataTask( + with: request as URLRequest, + completionHandler: { + (data, response, error) -> Void in + if let error = error { + completion(nil, error.localizedDescription); + return; + } + + if let data = data { + do { + let response = try JSONDecoder().decode(CoronaStats.self, from: data) + completion(response, nil); + } catch let error { + completion(nil, error.localizedDescription); + print(error) + } + } + } + ); + + dataTask.resume() +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b96dcb0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Facebook, Inc. and its affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3e47b19 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# COVID-19 Status + +A small widget that shows the ongoing COVID-19 pandemic stats in your MacOS computer menu bar + +## Features + +* Allow to choose between global and region specific stats +* Shows daily change in chosen statistic +* Displays notifications when followed statistic updates +* Has english and polish localisations + +## Data source + +All data is fetched from [corona-stats.online REST API](https://corona-stats.online/?source=2) every three minutes. + +## Screenshots + +![Menu screenshot](./screenshots/menu.png "Widget menu") + +![Region select screenshot](./screenshots/regions.png "Selecting a region") + +![Notification screenshot](./screenshots/alert.png "Example notification") + +## Help and contribution + +Feel free to send pull requests and to creat issues. + +## Disclaimer + +This a project was started by a person who never wrote in Swift or used Xcode before. + +The code may be messy and far from Swift coding standards. + +## License + +[MIT licensed](./LICENSE) diff --git a/screenshots/alert.png b/screenshots/alert.png new file mode 100644 index 0000000..d8de44b Binary files /dev/null and b/screenshots/alert.png differ diff --git a/screenshots/menu.png b/screenshots/menu.png new file mode 100644 index 0000000..b99667f Binary files /dev/null and b/screenshots/menu.png differ diff --git a/screenshots/regions.png b/screenshots/regions.png new file mode 100644 index 0000000..239ee13 Binary files /dev/null and b/screenshots/regions.png differ