From 4b241f9e714c777af0c09ad4ecb87975a8a0dd47 Mon Sep 17 00:00:00 2001 From: Alex Liu Date: Thu, 27 Jun 2019 02:59:51 -0400 Subject: [PATCH] Added a project. --- .../project.pbxproj | 611 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../Currency-SwiftUI/AddCurrencyView.swift | 62 ++ .../Currency-SwiftUI/AppDelegate.swift | 58 ++ .../AppIcon.appiconset/Contents.json | 98 +++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 + .../Currency-SwiftUI/ConverterView.swift | 158 +++++ .../Currency-SwiftUI/CurrencyData.swift | 59 ++ .../Currency-SwiftUI/CurrencyItemView.swift | 82 +++ .../Currency-SwiftUI/CurrencyList.swift | 69 ++ .../Currency-SwiftUI/Info.plist | 62 ++ .../Preview Assets.xcassets/Contents.json | 6 + .../Currency-SwiftUI/SceneDelegate.swift | 78 +++ .../Currency-SwiftUI/UserData.swift | 78 +++ .../Currency_SwiftUITests.swift | 51 ++ .../Currency-SwiftUITests/Info.plist | 22 + .../Currency_SwiftUIUITests.swift | 51 ++ .../Currency-SwiftUIUITests/Info.plist | 22 + README.md | 2 +- .../{Currency.png => SwiftUICurrency.png} | Bin 22 files changed, 1614 insertions(+), 1 deletion(-) create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.pbxproj create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/AddCurrencyView.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/AppDelegate.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/Assets.xcassets/Contents.json create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/Base.lproj/LaunchScreen.storyboard create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyData.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyItemView.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyList.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/Info.plist create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/SceneDelegate.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUI/UserData.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUITests/Currency_SwiftUITests.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUITests/Info.plist create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUIUITests/Currency_SwiftUIUITests.swift create mode 100644 Other Projects/Currency-SwiftUI/Currency-SwiftUIUITests/Info.plist rename Resources/{Currency.png => SwiftUICurrency.png} (100%) diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.pbxproj b/Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1e2ce73 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.pbxproj @@ -0,0 +1,611 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 5FFA056822C48D0F009057CC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA056722C48D0F009057CC /* AppDelegate.swift */; }; + 5FFA056A22C48D0F009057CC /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA056922C48D0F009057CC /* SceneDelegate.swift */; }; + 5FFA056E22C48D11009057CC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5FFA056D22C48D11009057CC /* Assets.xcassets */; }; + 5FFA057122C48D11009057CC /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5FFA057022C48D11009057CC /* Preview Assets.xcassets */; }; + 5FFA057422C48D11009057CC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5FFA057222C48D11009057CC /* LaunchScreen.storyboard */; }; + 5FFA057F22C48D11009057CC /* Currency_SwiftUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA057E22C48D11009057CC /* Currency_SwiftUITests.swift */; }; + 5FFA058A22C48D11009057CC /* Currency_SwiftUIUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA058922C48D11009057CC /* Currency_SwiftUIUITests.swift */; }; + 5FFA059E22C48D7A009057CC /* ConverterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA059722C48D7A009057CC /* ConverterView.swift */; }; + 5FFA059F22C48D7A009057CC /* AddCurrencyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA059822C48D7A009057CC /* AddCurrencyView.swift */; }; + 5FFA05A122C48D7A009057CC /* CurrencyList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA059A22C48D7A009057CC /* CurrencyList.swift */; }; + 5FFA05A222C48D7A009057CC /* CurrencyItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA059B22C48D7A009057CC /* CurrencyItemView.swift */; }; + 5FFA05A322C48D7A009057CC /* CurrencyData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA059C22C48D7A009057CC /* CurrencyData.swift */; }; + 5FFA05A422C48D7A009057CC /* UserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FFA059D22C48D7A009057CC /* UserData.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 5FFA057B22C48D11009057CC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5FFA055C22C48D0F009057CC /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5FFA056322C48D0F009057CC; + remoteInfo = "Currency-SwiftUI"; + }; + 5FFA058622C48D11009057CC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5FFA055C22C48D0F009057CC /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5FFA056322C48D0F009057CC; + remoteInfo = "Currency-SwiftUI"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 5FFA056422C48D0F009057CC /* Currency-SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Currency-SwiftUI.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 5FFA056722C48D0F009057CC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 5FFA056922C48D0F009057CC /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 5FFA056D22C48D11009057CC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 5FFA057022C48D11009057CC /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 5FFA057322C48D11009057CC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 5FFA057522C48D11009057CC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5FFA057A22C48D11009057CC /* Currency-SwiftUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Currency-SwiftUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 5FFA057E22C48D11009057CC /* Currency_SwiftUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Currency_SwiftUITests.swift; sourceTree = ""; }; + 5FFA058022C48D11009057CC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5FFA058522C48D11009057CC /* Currency-SwiftUIUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Currency-SwiftUIUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 5FFA058922C48D11009057CC /* Currency_SwiftUIUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Currency_SwiftUIUITests.swift; sourceTree = ""; }; + 5FFA058B22C48D11009057CC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5FFA059722C48D7A009057CC /* ConverterView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConverterView.swift; sourceTree = ""; }; + 5FFA059822C48D7A009057CC /* AddCurrencyView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddCurrencyView.swift; sourceTree = ""; }; + 5FFA059A22C48D7A009057CC /* CurrencyList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CurrencyList.swift; sourceTree = ""; }; + 5FFA059B22C48D7A009057CC /* CurrencyItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CurrencyItemView.swift; sourceTree = ""; }; + 5FFA059C22C48D7A009057CC /* CurrencyData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CurrencyData.swift; sourceTree = ""; }; + 5FFA059D22C48D7A009057CC /* UserData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserData.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5FFA056122C48D0F009057CC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5FFA057722C48D11009057CC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5FFA058222C48D11009057CC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5FFA055B22C48D0F009057CC = { + isa = PBXGroup; + children = ( + 5FFA056622C48D0F009057CC /* Currency-SwiftUI */, + 5FFA057D22C48D11009057CC /* Currency-SwiftUITests */, + 5FFA058822C48D11009057CC /* Currency-SwiftUIUITests */, + 5FFA056522C48D0F009057CC /* Products */, + ); + sourceTree = ""; + }; + 5FFA056522C48D0F009057CC /* Products */ = { + isa = PBXGroup; + children = ( + 5FFA056422C48D0F009057CC /* Currency-SwiftUI.app */, + 5FFA057A22C48D11009057CC /* Currency-SwiftUITests.xctest */, + 5FFA058522C48D11009057CC /* Currency-SwiftUIUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 5FFA056622C48D0F009057CC /* Currency-SwiftUI */ = { + isa = PBXGroup; + children = ( + 5FFA059822C48D7A009057CC /* AddCurrencyView.swift */, + 5FFA059722C48D7A009057CC /* ConverterView.swift */, + 5FFA059C22C48D7A009057CC /* CurrencyData.swift */, + 5FFA059B22C48D7A009057CC /* CurrencyItemView.swift */, + 5FFA059A22C48D7A009057CC /* CurrencyList.swift */, + 5FFA059D22C48D7A009057CC /* UserData.swift */, + 5FFA056722C48D0F009057CC /* AppDelegate.swift */, + 5FFA056922C48D0F009057CC /* SceneDelegate.swift */, + 5FFA056D22C48D11009057CC /* Assets.xcassets */, + 5FFA057222C48D11009057CC /* LaunchScreen.storyboard */, + 5FFA057522C48D11009057CC /* Info.plist */, + 5FFA056F22C48D11009057CC /* Preview Content */, + ); + path = "Currency-SwiftUI"; + sourceTree = ""; + }; + 5FFA056F22C48D11009057CC /* Preview Content */ = { + isa = PBXGroup; + children = ( + 5FFA057022C48D11009057CC /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 5FFA057D22C48D11009057CC /* Currency-SwiftUITests */ = { + isa = PBXGroup; + children = ( + 5FFA057E22C48D11009057CC /* Currency_SwiftUITests.swift */, + 5FFA058022C48D11009057CC /* Info.plist */, + ); + path = "Currency-SwiftUITests"; + sourceTree = ""; + }; + 5FFA058822C48D11009057CC /* Currency-SwiftUIUITests */ = { + isa = PBXGroup; + children = ( + 5FFA058922C48D11009057CC /* Currency_SwiftUIUITests.swift */, + 5FFA058B22C48D11009057CC /* Info.plist */, + ); + path = "Currency-SwiftUIUITests"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 5FFA056322C48D0F009057CC /* Currency-SwiftUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5FFA058E22C48D11009057CC /* Build configuration list for PBXNativeTarget "Currency-SwiftUI" */; + buildPhases = ( + 5FFA056022C48D0F009057CC /* Sources */, + 5FFA056122C48D0F009057CC /* Frameworks */, + 5FFA056222C48D0F009057CC /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Currency-SwiftUI"; + productName = "Currency-SwiftUI"; + productReference = 5FFA056422C48D0F009057CC /* Currency-SwiftUI.app */; + productType = "com.apple.product-type.application"; + }; + 5FFA057922C48D11009057CC /* Currency-SwiftUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5FFA059122C48D11009057CC /* Build configuration list for PBXNativeTarget "Currency-SwiftUITests" */; + buildPhases = ( + 5FFA057622C48D11009057CC /* Sources */, + 5FFA057722C48D11009057CC /* Frameworks */, + 5FFA057822C48D11009057CC /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 5FFA057C22C48D11009057CC /* PBXTargetDependency */, + ); + name = "Currency-SwiftUITests"; + productName = "Currency-SwiftUITests"; + productReference = 5FFA057A22C48D11009057CC /* Currency-SwiftUITests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 5FFA058422C48D11009057CC /* Currency-SwiftUIUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5FFA059422C48D11009057CC /* Build configuration list for PBXNativeTarget "Currency-SwiftUIUITests" */; + buildPhases = ( + 5FFA058122C48D11009057CC /* Sources */, + 5FFA058222C48D11009057CC /* Frameworks */, + 5FFA058322C48D11009057CC /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 5FFA058722C48D11009057CC /* PBXTargetDependency */, + ); + name = "Currency-SwiftUIUITests"; + productName = "Currency-SwiftUIUITests"; + productReference = 5FFA058522C48D11009057CC /* Currency-SwiftUIUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 5FFA055C22C48D0F009057CC /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = "Alex Liu"; + TargetAttributes = { + 5FFA056322C48D0F009057CC = { + CreatedOnToolsVersion = 11.0; + }; + 5FFA057922C48D11009057CC = { + CreatedOnToolsVersion = 11.0; + TestTargetID = 5FFA056322C48D0F009057CC; + }; + 5FFA058422C48D11009057CC = { + CreatedOnToolsVersion = 11.0; + TestTargetID = 5FFA056322C48D0F009057CC; + }; + }; + }; + buildConfigurationList = 5FFA055F22C48D0F009057CC /* Build configuration list for PBXProject "Currency-SwiftUI" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 5FFA055B22C48D0F009057CC; + productRefGroup = 5FFA056522C48D0F009057CC /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 5FFA056322C48D0F009057CC /* Currency-SwiftUI */, + 5FFA057922C48D11009057CC /* Currency-SwiftUITests */, + 5FFA058422C48D11009057CC /* Currency-SwiftUIUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 5FFA056222C48D0F009057CC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5FFA057422C48D11009057CC /* LaunchScreen.storyboard in Resources */, + 5FFA057122C48D11009057CC /* Preview Assets.xcassets in Resources */, + 5FFA056E22C48D11009057CC /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5FFA057822C48D11009057CC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5FFA058322C48D11009057CC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5FFA056022C48D0F009057CC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5FFA05A322C48D7A009057CC /* CurrencyData.swift in Sources */, + 5FFA059F22C48D7A009057CC /* AddCurrencyView.swift in Sources */, + 5FFA056822C48D0F009057CC /* AppDelegate.swift in Sources */, + 5FFA05A122C48D7A009057CC /* CurrencyList.swift in Sources */, + 5FFA059E22C48D7A009057CC /* ConverterView.swift in Sources */, + 5FFA056A22C48D0F009057CC /* SceneDelegate.swift in Sources */, + 5FFA05A222C48D7A009057CC /* CurrencyItemView.swift in Sources */, + 5FFA05A422C48D7A009057CC /* UserData.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5FFA057622C48D11009057CC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5FFA057F22C48D11009057CC /* Currency_SwiftUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5FFA058122C48D11009057CC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5FFA058A22C48D11009057CC /* Currency_SwiftUIUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5FFA057C22C48D11009057CC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5FFA056322C48D0F009057CC /* Currency-SwiftUI */; + targetProxy = 5FFA057B22C48D11009057CC /* PBXContainerItemProxy */; + }; + 5FFA058722C48D11009057CC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5FFA056322C48D0F009057CC /* Currency-SwiftUI */; + targetProxy = 5FFA058622C48D11009057CC /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 5FFA057222C48D11009057CC /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5FFA057322C48D11009057CC /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 5FFA058C22C48D11009057CC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 5FFA058D22C48D11009057CC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 5FFA058F22C48D11009057CC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Currency-SwiftUI/Preview\\ Content"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "Currency-SwiftUI/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "alex.liu.Currency-SwiftUI"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 5FFA059022C48D11009057CC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Currency-SwiftUI/Preview\\ Content"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "Currency-SwiftUI/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "alex.liu.Currency-SwiftUI"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 5FFA059222C48D11009057CC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Currency-SwiftUITests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "alex.liu.Currency-SwiftUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Currency-SwiftUI.app/Currency-SwiftUI"; + }; + name = Debug; + }; + 5FFA059322C48D11009057CC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Currency-SwiftUITests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "alex.liu.Currency-SwiftUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Currency-SwiftUI.app/Currency-SwiftUI"; + }; + name = Release; + }; + 5FFA059522C48D11009057CC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Currency-SwiftUIUITests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "alex.liu.Currency-SwiftUIUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "Currency-SwiftUI"; + }; + name = Debug; + }; + 5FFA059622C48D11009057CC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Currency-SwiftUIUITests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "alex.liu.Currency-SwiftUIUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "Currency-SwiftUI"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5FFA055F22C48D0F009057CC /* Build configuration list for PBXProject "Currency-SwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5FFA058C22C48D11009057CC /* Debug */, + 5FFA058D22C48D11009057CC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5FFA058E22C48D11009057CC /* Build configuration list for PBXNativeTarget "Currency-SwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5FFA058F22C48D11009057CC /* Debug */, + 5FFA059022C48D11009057CC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5FFA059122C48D11009057CC /* Build configuration list for PBXNativeTarget "Currency-SwiftUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5FFA059222C48D11009057CC /* Debug */, + 5FFA059322C48D11009057CC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5FFA059422C48D11009057CC /* Build configuration list for PBXNativeTarget "Currency-SwiftUIUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5FFA059522C48D11009057CC /* Debug */, + 5FFA059622C48D11009057CC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 5FFA055C22C48D0F009057CC /* Project object */; +} diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3871dcd --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AddCurrencyView.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AddCurrencyView.swift new file mode 100644 index 0000000..5e5033a --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AddCurrencyView.swift @@ -0,0 +1,62 @@ +// +// AddCurrencyView.swift +// Currency-SwiftUI +// +// Created by Alex Liu on 2019-06-20. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import Foundation +import SwiftUI + +struct AddCurrencyView : View { + @EnvironmentObject var userData: UserData + + var body: some View { + List { + ForEach(userData.allCurrencies) { currency in + return HStack { + Button(action: { self.select(currency) }) { + Text("\(currency.code) - \(currency.name)") + } + Spacer() + if self.isSelected(currency) { + Image(systemName: "checkmark").foregroundColor(.blue) + } + } + } + }.navigationBarItem(title: Text("Add Currency")) + } + + private func select(_ currency: Currency) { + if userData.userCurrency.map({ $0.code }).contains(currency.code) { + userData.userCurrency.removeAll{$0.code == currency.code} + } + else { + userData.userCurrency.append(currency) + } + } + + private func isSelected(_ currency: Currency) -> Bool { + return userData.userCurrency.map({ $0.code }).contains(currency.code) + } +} + + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AppDelegate.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AppDelegate.swift new file mode 100644 index 0000000..4b393e5 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AppDelegate.swift @@ -0,0 +1,58 @@ +// +// AppDelegate.swift +// Currency-SwiftUI +// +// Created by Alex Liu on 2019-06-27. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Assets.xcassets/Contents.json b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Base.lproj/LaunchScreen.storyboard b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift new file mode 100644 index 0000000..1b0f1c1 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift @@ -0,0 +1,158 @@ +// +// ContentView.swift +// Currency-SwiftUI +// +// Created by Alex Liu on 2019-06-20. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import Foundation +import SwiftUI + +struct ConverterView : View { + @EnvironmentObject var userData: UserData + @State var baseAmount: String = "1.0" + @State var isEditing: Bool = false + @State var lastUpdated: String = "" + + var body: some View { + let inset = EdgeInsets(top: -8, leading: -20, bottom: -7, trailing: 5) + let doubleValue: Double = Double(self.$baseAmount.value) ?? 1.0 + + return ZStack(alignment: .bottomTrailing) { + VStack(alignment: .leading){ + Text("From:").bold().color(.gray) + HStack{ + // Flag + Text("\(userData.baseCurrency.flag)").padding(5) + // Code and name + VStack(alignment: .leading){ + Text(userData.baseCurrency.code).color(.white) + Text(userData.baseCurrency.name).color(.white) + } + Spacer() + // Amount and conversion + TextField($baseAmount, placeholder: Text("1.0"), onCommit: { + // TODO: update all currencies on the following list + }).foregroundColor(.white) + .background( + RoundedRectangle(cornerRadius: 5) + .fill(Color.clear) + .border(Color(red: 0.7, green: 0.7, blue: 0.7), width: 1 / UIScreen.main.scale, cornerRadius: 5) + .padding(inset) + ) + }.background(Color.blue).cornerRadius(5) + Text("To:").bold().color(.gray) + List { + // TODO: should filter out BaseCurrency from list + ForEach(userData.userCurrency) { currency in + CurrencyItemView(currency: currency, baseAmount: doubleValue, isEditing: self.$isEditing).tapAction { + // Swap this and base + self.userData.baseCurrency = currency + } + } + }.onAppear(perform: loadCurrencies) + .navigationBarItem(title: Text("Currenceis 💱")) + .navigationBarItems(trailing: Button(action: { self.isEditing.toggle() }) { + if !self.isEditing { + Text("Edit") + } else { + Text("Done").bold() + } + }) + Text("Last updated: \(self.lastUpdated)").color(.gray).bold() + } + NavigationButton(destination: AddCurrencyView().environmentObject(self.userData)) { + Text("💰") + }.frame(width: 46, height: 46, alignment: .center) + .background( + RoundedRectangle(cornerRadius: 23) + .fill(Color.blue) + .border(Color(red: 0.7, green: 0.7, blue: 0.7), width: 1 / UIScreen.main.scale, cornerRadius: 23)) + .foregroundColor(.white).font(.largeTitle) + }.padding() + } + + private func loadCurrencies() { + // Check if last updated is the same date + // if not the same pull from remote with base currency + let url = URL(string: "https://api.exchangeratesapi.io/latest?base=USD")! + + let task = URLSession.shared.dataTask(with: url, completionHandler: { data, _, _ in + if let data = data { + if let decoded: CurrencyList = self.decodeData(CurrencyList.self, data){ + // + self.lastUpdated = decoded.date + + // generate currency data + var newCurrencies = [Currency]() + for key in decoded.rates.keys { + let newCurrency = Currency(name: supportedCurrencies[key]?[0] ?? "Unknown", rate: 1.0 / (decoded.rates[key] ?? 1.0), symbol: supportedCurrencies[key]?[1] ?? "", code: key) + newCurrencies.append(newCurrency) + } + + DispatchQueue.main.async { + self.userData.allCurrencies = newCurrencies + + if let base = self.userData.allCurrencies.filter({ $0.symbol == self.userData.baseCurrency.symbol }).first { + self.userData.baseCurrency = base + } + + var tempNewUserCurrency = [Currency]() + let userCurrencies = self.userData.userCurrency.map{ $0.code } + for c in self.userData.allCurrencies { + if userCurrencies.contains(c.code){ + tempNewUserCurrency.append(c) + } + } + + self.userData.userCurrency = tempNewUserCurrency + } + } + } + }) + task.resume() + } +} + +extension ConverterView +{ + private func decodeData(_ decodeObject: T.Type, _ data: Data) -> T? where T: Codable + { + let decoder = JSONDecoder() + do + { + return try decoder.decode(decodeObject.self, from: data) + } + catch let jsonErr + { + print("Error decoding Json ", jsonErr) + return nil + } + } +} + +#if DEBUG +struct ContentView_Previews : PreviewProvider { + static var previews: some View { + ConverterView().environmentObject(UserData()) + } +} +#endif diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyData.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyData.swift new file mode 100644 index 0000000..05c4f57 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyData.swift @@ -0,0 +1,59 @@ +// +// CurrencyData.swift +// Currency-SwiftUI +// +// Created by Alex Liu on 2019-06-20. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import Foundation +import SwiftUI + +struct Currency: Equatable, Hashable, Codable, Identifiable{ + let id: UUID + let name: String + + // This is a rate to USD + let rate: Double + let symbol: String + let code: String + + init(name: String, rate: Double, symbol: String = "", code: String) { + self.id = UUID() + self.name = name + self.rate = rate + self.symbol = symbol + self.code = code + } + + // Get unicode flag by currency symbol + var flag: String { + // Hard-code EU for now + if self.symbol == "EU" { return "🇪🇺" } + let base : UInt32 = 127397 + var s = "" + for v in self.symbol.uppercased().unicodeScalars { + s.unicodeScalars.append(UnicodeScalar(base + v.value)!) + } + + return s + } +} + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyItemView.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyItemView.swift new file mode 100644 index 0000000..7dd5b0d --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyItemView.swift @@ -0,0 +1,82 @@ +// +// CurrencyItem.swift +// Currency-SwiftUI +// +// Created by Alex Liu on 2019-06-20. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import SwiftUI + +struct CurrencyItemView: View { + @EnvironmentObject var userData: UserData + let currency: Currency + let baseAmount: Double + @Binding var isEditing: Bool + + var body: some View { + let currency = self.currency + let converstionRate = String(format: "%.4f", currency.rate / userData.baseCurrency.rate) + let totalAmount = String(format: "%.3f", baseAmount * ( userData.baseCurrency.rate / currency.rate)) + + return HStack { + if self.isEditing { + // This is for delete mode + HStack(alignment: .center){ + Image(systemName: "minus.circle") + .foregroundColor(.red) + .tapAction(count: 1) { + self.delete() + } + + Text(currency.flag).font(.title) + VStack(alignment: .leading){ + Text(currency.code) + Text(currency.name).color(.gray) + } + } + } + else { + // This is normal mode + HStack{ + // Flag + Text(currency.flag).font(.largeTitle) + // Code and name + VStack(alignment: .leading){ + Text(currency.code).font(.headline) + Text(currency.name).font(.footnote).color(.gray) + } + Spacer() + // Amount and conversion + VStack(alignment: .trailing){ + Text("\(totalAmount)") + // Would be 1 this currency = xxx base currency + Text("1 \(currency.code) = \(converstionRate) \(userData.baseCurrency.code)").color(.gray) + } + } + } + } + } + + // TODO: need to implement + private func delete() { + } +} + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyList.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyList.swift new file mode 100644 index 0000000..3891161 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/CurrencyList.swift @@ -0,0 +1,69 @@ +// +// CurrencyList.swift +// Currency-SwiftUI +// +// Created by Alex Liu on 2019-06-21. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import Foundation + +struct CurrencyList: Codable{ + let base: String + let date: String + let rates: [String: Double] +} + +/// All supported currencies +let supportedCurrencies: [String: [String]] = [ + "THB": ["Thai baht", "TH"], + "PHP": ["Philippine peso", "PH"], + "CZK": ["Czech koruna", "CZ"], + "BRL": ["Brazilian real", "BR"], + "CHF": ["Swiss franc", "CH"], + "INR": ["Indian rupee", "IN"], + "ISK": ["Icelandic króna", "IS"], + "HRK": ["Croatian kuna", "HR"], + "PLN": ["Polish złoty", "PL"], + "NOK": ["Norwegian krone", "NO"], + "USD": ["US Dollar", "US"], + "CNY": ["Chinese Renminbi", "CN"], + "RUB": ["Russian ruble", "RU"], + "SEK": ["Swedish krona", "SE"], + "MYR": ["Malaysian ringgit", "MY"], + "SGD": ["Singapore dollar", "SG"], + "ILS": ["Israeli new shekel", "IL"], + "TRY": ["Turkish lira", "TR"], + "BGN": ["Bulgarian lev", "BG"], + "NZD": ["New Zealand dollar", "NZ"], + "HKD": ["Hong Kong dollar", "HK"], + "RON": ["Romanian leu", "RO"], + "EUR": ["Euro", "EU"], + "MXN": ["Mexican peso", "MX"], + "CAD": ["Canadian Dollar", "CA"], + "AUD": ["Australian dollar", "AU"], + "GBP": ["Pound sterling", "GB"], + "KRW": ["South Korean won", "KR"], + "IDR": ["Indonesian rupiah", "ID"], + "JPY": ["Japanese yen", "JP"], + "DKK": ["Danish krone", "DK"], + "ZAR": ["South African rand", "ZA"], + "HUF": ["Hungarian forint", "HU"] +] diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Info.plist b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Info.plist new file mode 100644 index 0000000..e8bb4c6 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UILaunchStoryboardName + LaunchScreen + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/SceneDelegate.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/SceneDelegate.swift new file mode 100644 index 0000000..ed872a7 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/SceneDelegate.swift @@ -0,0 +1,78 @@ +// +// SceneDelegate.swift +// Currency-SwiftUI +// +// Created by Alex Liu on 2019-06-27. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Use a UIHostingController as window root view controller + let window = UIWindow(frame: UIScreen.main.bounds) + window.rootViewController = UIHostingController(rootView: NavigationView { + ConverterView().environmentObject(UserData()) + }) + self.window = window + window.makeKeyAndVisible() + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/UserData.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/UserData.swift new file mode 100644 index 0000000..f2fe47d --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/UserData.swift @@ -0,0 +1,78 @@ +// +// UserData.swift +// Currency-SwiftUI +// +// Created by Alex Liu on 2019-06-20. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import Combine +import SwiftUI +import Foundation + +private let defaultCurrencies: [Currency] = [ + Currency(name: "US dollar", rate: 1.0, symbol: "US", code: "USD"), + Currency(name: "Canadian dollar", rate: 1.0, symbol: "CA", code: "CAD") +] + +@propertyDelegate +struct UserDefaultValue { + + let key: String + let defaultValue: Value + + var value: Value { + get { + let data = UserDefaults.standard.data(forKey: key) + let value = data.flatMap { try? JSONDecoder().decode(Value.self, from: $0) } + return value ?? defaultValue + } + set { + let data = try? JSONEncoder().encode(newValue) + UserDefaults.standard.set(data, forKey: key) + } + } +} + +final class UserData: BindableObject { + let didChange = PassthroughSubject() + + @UserDefaultValue(key: "allCurrencies", defaultValue: defaultCurrencies) + var allCurrencies: [Currency] { + didSet { + didChange.send(self) + } + } + + @UserDefaultValue(key: "baseCurrency", defaultValue: defaultCurrencies[0]) + var baseCurrency: Currency { + didSet { + didChange.send(self) + } + } + + @UserDefaultValue(key: "userCurrency", defaultValue: defaultCurrencies) + var userCurrency: [Currency] { + didSet { + didChange.send(self) + } + } +} + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUITests/Currency_SwiftUITests.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUITests/Currency_SwiftUITests.swift new file mode 100644 index 0000000..c93495b --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUITests/Currency_SwiftUITests.swift @@ -0,0 +1,51 @@ +// +// Currency_SwiftUITests.swift +// Currency-SwiftUITests +// +// Created by Alex Liu on 2019-06-27. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import XCTest +@testable import Currency_SwiftUI + +class Currency_SwiftUITests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUITests/Info.plist b/Other Projects/Currency-SwiftUI/Currency-SwiftUITests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUIUITests/Currency_SwiftUIUITests.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUIUITests/Currency_SwiftUIUITests.swift new file mode 100644 index 0000000..2445296 --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUIUITests/Currency_SwiftUIUITests.swift @@ -0,0 +1,51 @@ +// +// Currency_SwiftUIUITests.swift +// Currency-SwiftUIUITests +// +// Created by Alex Liu on 2019-06-27. +// Copyright © 2018 Alex Liu All rights reserved. +// +// 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. + +import XCTest + +class Currency_SwiftUIUITests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +} diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUIUITests/Info.plist b/Other Projects/Currency-SwiftUI/Currency-SwiftUIUITests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUIUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/README.md b/README.md index 9226e2c..060181f 100644 --- a/README.md +++ b/README.md @@ -225,7 +225,7 @@ Size of area attach to state of property `show`: ### SwiftUI Currency - +[Source](https://github.com/alexliubj/SwiftUI-Currency-Converter) ### Authors diff --git a/Resources/Currency.png b/Resources/SwiftUICurrency.png similarity index 100% rename from Resources/Currency.png rename to Resources/SwiftUICurrency.png