diff --git a/Testing.xcodeproj/project.pbxproj b/Testing.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c55b216 --- /dev/null +++ b/Testing.xcodeproj/project.pbxproj @@ -0,0 +1,416 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 52; + objects = { + +/* Begin PBXBuildFile section */ + 812786D824FA51E300CB5211 /* promotionData.json in Resources */ = {isa = PBXBuildFile; fileRef = 812786D724FA51E300CB5211 /* promotionData.json */; }; + 812786E024FA527200CB5211 /* merchantPromotionData.json in Resources */ = {isa = PBXBuildFile; fileRef = 812786DF24FA527200CB5211 /* merchantPromotionData.json */; }; + 81330FAE24FF639900B44848 /* msgData.json in Resources */ = {isa = PBXBuildFile; fileRef = 81330FAD24FF639900B44848 /* msgData.json */; }; + 8133101F2508E3A100B44848 /* profile.png in Resources */ = {isa = PBXBuildFile; fileRef = 8133101E2508E3A100B44848 /* profile.png */; }; + 8133102D250B249C00B44848 /* CodeScanner in Frameworks */ = {isa = PBXBuildFile; productRef = 8133102C250B249C00B44848 /* CodeScanner */; }; + 813FE7C824F3BE5D001635D9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 813FE7C724F3BE5D001635D9 /* AppDelegate.swift */; }; + 813FE7CA24F3BE5D001635D9 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 813FE7C924F3BE5D001635D9 /* SceneDelegate.swift */; }; + 813FE7CC24F3BE5D001635D9 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 813FE7CB24F3BE5D001635D9 /* ContentView.swift */; }; + 813FE7CE24F3BE6A001635D9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 813FE7CD24F3BE6A001635D9 /* Assets.xcassets */; }; + 813FE7D124F3BE6A001635D9 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 813FE7D024F3BE6A001635D9 /* Preview Assets.xcassets */; }; + 813FE7D424F3BE6A001635D9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 813FE7D224F3BE6A001635D9 /* LaunchScreen.storyboard */; }; + 814064E9251731CB0082EB1F /* FullModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 814064E8251731CB0082EB1F /* FullModal.swift */; }; + 81C842C3250F6F6D00937DA9 /* codeScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81C842C2250F6F6D00937DA9 /* codeScanner.swift */; }; + 81C842C5250F6FA200937DA9 /* select profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81C842C4250F6FA200937DA9 /* select profile.swift */; }; + 81C842C7250F706F00937DA9 /* HideTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81C842C6250F706F00937DA9 /* HideTab.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 812786D724FA51E300CB5211 /* promotionData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = promotionData.json; sourceTree = ""; }; + 812786DF24FA527200CB5211 /* merchantPromotionData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = merchantPromotionData.json; sourceTree = ""; }; + 81330FAD24FF639900B44848 /* msgData.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = msgData.json; sourceTree = ""; }; + 8133101E2508E3A100B44848 /* profile.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = profile.png; sourceTree = ""; }; + 813FE7C424F3BE5D001635D9 /* Testing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Testing.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 813FE7C724F3BE5D001635D9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 813FE7C924F3BE5D001635D9 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 813FE7CB24F3BE5D001635D9 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 813FE7CD24F3BE6A001635D9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 813FE7D024F3BE6A001635D9 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 813FE7D324F3BE6A001635D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 813FE7D524F3BE6A001635D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 814064E8251731CB0082EB1F /* FullModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullModal.swift; sourceTree = ""; }; + 81C842C2250F6F6D00937DA9 /* codeScanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = codeScanner.swift; sourceTree = ""; }; + 81C842C4250F6FA200937DA9 /* select profile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "select profile.swift"; sourceTree = ""; }; + 81C842C6250F706F00937DA9 /* HideTab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HideTab.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 813FE7C124F3BE5D001635D9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8133102D250B249C00B44848 /* CodeScanner in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 812786E724FA52AC00CB5211 /* View */ = { + isa = PBXGroup; + children = ( + 813FE7CB24F3BE5D001635D9 /* ContentView.swift */, + 81330FAD24FF639900B44848 /* msgData.json */, + 8133101E2508E3A100B44848 /* profile.png */, + 81C842C2250F6F6D00937DA9 /* codeScanner.swift */, + 81C842C4250F6FA200937DA9 /* select profile.swift */, + 81C842C6250F706F00937DA9 /* HideTab.swift */, + 814064E8251731CB0082EB1F /* FullModal.swift */, + ); + path = View; + sourceTree = ""; + }; + 813FE7BB24F3BE5D001635D9 = { + isa = PBXGroup; + children = ( + 813FE7C624F3BE5D001635D9 /* Testing */, + 813FE7C524F3BE5D001635D9 /* Products */, + ); + sourceTree = ""; + }; + 813FE7C524F3BE5D001635D9 /* Products */ = { + isa = PBXGroup; + children = ( + 813FE7C424F3BE5D001635D9 /* Testing.app */, + ); + name = Products; + sourceTree = ""; + }; + 813FE7C624F3BE5D001635D9 /* Testing */ = { + isa = PBXGroup; + children = ( + 812786E724FA52AC00CB5211 /* View */, + 813FE7C724F3BE5D001635D9 /* AppDelegate.swift */, + 813FE7C924F3BE5D001635D9 /* SceneDelegate.swift */, + 813FE7CD24F3BE6A001635D9 /* Assets.xcassets */, + 813FE7D224F3BE6A001635D9 /* LaunchScreen.storyboard */, + 812786D724FA51E300CB5211 /* promotionData.json */, + 812786DF24FA527200CB5211 /* merchantPromotionData.json */, + 813FE7D524F3BE6A001635D9 /* Info.plist */, + 813FE7CF24F3BE6A001635D9 /* Preview Content */, + ); + path = Testing; + sourceTree = ""; + }; + 813FE7CF24F3BE6A001635D9 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 813FE7D024F3BE6A001635D9 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 813FE7C324F3BE5D001635D9 /* Testing */ = { + isa = PBXNativeTarget; + buildConfigurationList = 813FE7D824F3BE6A001635D9 /* Build configuration list for PBXNativeTarget "Testing" */; + buildPhases = ( + 813FE7C024F3BE5D001635D9 /* Sources */, + 813FE7C124F3BE5D001635D9 /* Frameworks */, + 813FE7C224F3BE5D001635D9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Testing; + packageProductDependencies = ( + 8133102C250B249C00B44848 /* CodeScanner */, + ); + productName = Testing; + productReference = 813FE7C424F3BE5D001635D9 /* Testing.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 813FE7BC24F3BE5D001635D9 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1160; + LastUpgradeCheck = 1200; + ORGANIZATIONNAME = "Hao Yang Yip"; + TargetAttributes = { + 813FE7C324F3BE5D001635D9 = { + CreatedOnToolsVersion = 11.6; + }; + }; + }; + buildConfigurationList = 813FE7BF24F3BE5D001635D9 /* Build configuration list for PBXProject "Testing" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 813FE7BB24F3BE5D001635D9; + packageReferences = ( + 8133102B250B249C00B44848 /* XCRemoteSwiftPackageReference "CodeScanner" */, + ); + productRefGroup = 813FE7C524F3BE5D001635D9 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 813FE7C324F3BE5D001635D9 /* Testing */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 813FE7C224F3BE5D001635D9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 813FE7D424F3BE6A001635D9 /* LaunchScreen.storyboard in Resources */, + 813FE7D124F3BE6A001635D9 /* Preview Assets.xcassets in Resources */, + 813FE7CE24F3BE6A001635D9 /* Assets.xcassets in Resources */, + 812786E024FA527200CB5211 /* merchantPromotionData.json in Resources */, + 812786D824FA51E300CB5211 /* promotionData.json in Resources */, + 81330FAE24FF639900B44848 /* msgData.json in Resources */, + 8133101F2508E3A100B44848 /* profile.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 813FE7C024F3BE5D001635D9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81C842C3250F6F6D00937DA9 /* codeScanner.swift in Sources */, + 81C842C5250F6FA200937DA9 /* select profile.swift in Sources */, + 81C842C7250F706F00937DA9 /* HideTab.swift in Sources */, + 814064E9251731CB0082EB1F /* FullModal.swift in Sources */, + 813FE7C824F3BE5D001635D9 /* AppDelegate.swift in Sources */, + 813FE7CA24F3BE5D001635D9 /* SceneDelegate.swift in Sources */, + 813FE7CC24F3BE5D001635D9 /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 813FE7D224F3BE6A001635D9 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 813FE7D324F3BE6A001635D9 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 813FE7D624F3BE6A001635D9 /* 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; + }; + 813FE7D724F3BE6A001635D9 /* 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; + }; + 813FE7D924F3BE6A001635D9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"Testing/Preview Content\""; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Testing/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.julytech.Testing; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 813FE7DA24F3BE6A001635D9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"Testing/Preview Content\""; + DEVELOPMENT_TEAM = TW9MAJP3U3; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Testing/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.julytech.Testing; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 813FE7BF24F3BE5D001635D9 /* Build configuration list for PBXProject "Testing" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 813FE7D624F3BE6A001635D9 /* Debug */, + 813FE7D724F3BE6A001635D9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 813FE7D824F3BE6A001635D9 /* Build configuration list for PBXNativeTarget "Testing" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 813FE7D924F3BE6A001635D9 /* Debug */, + 813FE7DA24F3BE6A001635D9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 8133102B250B249C00B44848 /* XCRemoteSwiftPackageReference "CodeScanner" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/twostraws/CodeScanner.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.0.6; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 8133102C250B249C00B44848 /* CodeScanner */ = { + isa = XCSwiftPackageProductDependency; + package = 8133102B250B249C00B44848 /* XCRemoteSwiftPackageReference "CodeScanner" */; + productName = CodeScanner; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 813FE7BC24F3BE5D001635D9 /* Project object */; +} diff --git a/Testing.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Testing.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Testing.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Testing.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Testing.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Testing.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Testing.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Testing.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..b4d1648 --- /dev/null +++ b/Testing.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "CodeScanner", + "repositoryURL": "https://github.com/twostraws/CodeScanner.git", + "state": { + "branch": null, + "revision": "9d902dec616bd70b1a2a1b1e6d821c10c392ba9f", + "version": "1.0.6" + } + } + ] + }, + "version": 1 +} diff --git a/Testing.xcodeproj/xcuserdata/haoyangyip.xcuserdatad/xcschemes/xcschememanagement.plist b/Testing.xcodeproj/xcuserdata/haoyangyip.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..d7d7de8 --- /dev/null +++ b/Testing.xcodeproj/xcuserdata/haoyangyip.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Testing.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Testing/AppDelegate.swift b/Testing/AppDelegate.swift new file mode 100644 index 0000000..78d68fe --- /dev/null +++ b/Testing/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// Testing +// +// Created by Hao Yang Yip on 24/08/2020. +// Copyright © 2020 Hao Yang Yip. All rights reserved. +// + +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 + } + + // 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/Testing/Assets.xcassets/AppIcon.appiconset/Contents.json b/Testing/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/Testing/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Testing/Assets.xcassets/Contents.json b/Testing/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Testing/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Testing/Assets.xcassets/profile.imageset/Contents.json b/Testing/Assets.xcassets/profile.imageset/Contents.json new file mode 100644 index 0000000..962e49c --- /dev/null +++ b/Testing/Assets.xcassets/profile.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "profile.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Testing/Assets.xcassets/profile.imageset/profile.png b/Testing/Assets.xcassets/profile.imageset/profile.png new file mode 100644 index 0000000..31dc931 Binary files /dev/null and b/Testing/Assets.xcassets/profile.imageset/profile.png differ diff --git a/Testing/Base.lproj/LaunchScreen.storyboard b/Testing/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/Testing/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Testing/Info.plist b/Testing/Info.plist new file mode 100644 index 0000000..9742bf0 --- /dev/null +++ b/Testing/Info.plist @@ -0,0 +1,60 @@ + + + + + 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 + + + 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/Testing/Preview Content/Preview Assets.xcassets/Contents.json b/Testing/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Testing/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Testing/SceneDelegate.swift b/Testing/SceneDelegate.swift new file mode 100644 index 0000000..a9a459f --- /dev/null +++ b/Testing/SceneDelegate.swift @@ -0,0 +1,65 @@ +// +// SceneDelegate.swift +// Testing +// +// Created by Hao Yang Yip on 24/08/2020. +// Copyright © 2020 Hao Yang Yip. All rights reserved. +// + +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). + + // Create the SwiftUI view that provides the window contents. + let contentView = ContentView() + + // Use a UIHostingController as window root view controller. + + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: contentView) + 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/Testing/View/ContentView.swift b/Testing/View/ContentView.swift new file mode 100644 index 0000000..a3463f8 --- /dev/null +++ b/Testing/View/ContentView.swift @@ -0,0 +1,110 @@ + +//struct ImagePicker : UIViewControllerRepresentable { +// +// @Binding var isShown : Bool +// @Binding var image : Image? +// +// func updateUIViewController(_ uiViewController: UIImagePickerController, context: UIViewControllerRepresentableContext) { +// +// } +// +// func makeCoordinator() -> ImagePickerCordinator { +// return ImagePickerCordinator(isShown: $isShown, image: $image) +// } +// +// func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIImagePickerController { +// let picker = UIImagePickerController() +// picker.delegate = context.coordinator +// return picker +// } +//} +//class ImagePickerCordinator : NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate{ +// +// @Binding var isShown : Bool +// @Binding var image : Image? +// +// init(isShown : Binding, image: Binding) { +// _isShown = isShown +// _image = image +// } +// +// //Selected Image +// func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { +// let uiImage = info[UIImagePickerController.InfoKey.originalImage] as! UIImage +// +// let imageData = uiImage.jpegData(compressionQuality: 1) +// let imageBase64String = imageData?.base64EncodedString() +// print(imageBase64String ?? "Could not encode image to Base64") +// +// image = Image(uiImage: uiImage) +// print("test") +// //print(imageData!) +// //print(image! as Any) +// isShown = false +// } +// +// //Image selection got cancel +// func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { +// isShown = false +// } +//} +//struct PhotoCaptureView: View { +// +// @Binding var showImagePicker : Bool +// @Binding var image : Image? +// +// var body: some View { +// ImagePicker(isShown: $showImagePicker, image: $image) +// } +//} +// +// +import SwiftUI +//struct ContentView: View { +// @State private var showingAlert = false +// @State var code : String = "60" +// @State var number : String = "" +// @ObservedObject var ans = num() +// +// var body: some View { +// // PhoneNumberField(code: $code, number: $number) +// PhoneNumberField(ans: ans) +// +// } +//} +// +//struct PhoneNumberField: View { +// // @Binding var code: String +// // @Binding var number: String +// @ObservedObject var ans: num +// var body: some View { +// VStack{ +// HStack { +// Text(ans.code) +// TextField("Number", text: $ans.phone) +// } +// .padding() +// .background(Color.gray) +// .clipShape(RoundedRectangle(cornerRadius: 10)) +// Button(action: { +// print("Register tapped") +// print(self.ans.num) +// }) +// { +// Text("+") +// } +// } +// +// } +//} +//class num: ObservableObject { +// @Published var code: String = "60" +// @Published var phone: String = "" +// var num: String { +// return self.code + self.phone +// } +// func testP() { +// print(self.num) +// } +//} + diff --git a/Testing/View/FullModal.swift b/Testing/View/FullModal.swift new file mode 100644 index 0000000..5685c6d --- /dev/null +++ b/Testing/View/FullModal.swift @@ -0,0 +1,78 @@ +// +// FullModal.swift +// Testing +// +// Created by Hao Yang Yip on 20/09/2020. +// Copyright © 2020 Hao Yang Yip. All rights reserved. +// + +import SwiftUI + +struct FullModal: View { + @Binding var isPresented:Bool + var backgroundColor:UIColor? + var buttonColor:UIColor? + let modalView: () -> Content + let thisWindow = UIApplication.shared.windows.filter{$0.isKeyWindow}.first + var body: some View { + ZStack { + Color((backgroundColor == nil ? UIColor.white : backgroundColor)!) + VStack { + HStack { + Button(action: { + withAnimation { + self.isPresented = false + } + }) { + Image(systemName:"xmark.circle.fill") + .foregroundColor(buttonColor == nil ? Color(UIColor.orange) : Color(buttonColor!)) + } + Spacer() + + } + .padding(.horizontal) + modalView() + }.padding(.top,thisWindow?.safeAreaInsets.top) + Spacer() + } + .offset(x: 0, y: isPresented ? 0 : thisWindow?.frame.height ?? 0) + .edgesIgnoringSafeArea(.all) + } +} +struct ModalView: View { + var body: some View { + NavigationView { + VStack { + // This is your modal content here + RoundedRectangle(cornerRadius: 10) + .fill(Color.green) + .frame(width: 200, height: 200) + // The spacer is to push up the FullModal close button + Text("testing 123") + Spacer() + }.navigationBarTitle("test", displayMode: .inline) + .navigationBarItems(leading: Image(systemName:"xmark.circle.fill")) + + } + + } +} +struct ContentView: View { + @State private var isPresented = false + var body: some View { + ZStack { + NavigationView { + Button("Show Modal") { + withAnimation { + self.isPresented = true + } + } + .navigationBarTitle("Full Screen Modal") + } + FullModal(isPresented: $isPresented) { + ModalView() + } + } + } + } + diff --git a/Testing/View/HideTab.swift b/Testing/View/HideTab.swift new file mode 100644 index 0000000..9f5a472 --- /dev/null +++ b/Testing/View/HideTab.swift @@ -0,0 +1,136 @@ +//// +//// HideTab.swift +//// Testing +//// +//// Created by Hao Yang Yip on 14/09/2020. +//// Copyright © 2020 Hao Yang Yip. All rights reserved. +//// +// +//import SwiftUI +//import UIKit +// +//struct ContentView: View { +// @State private var tabSelection = 1 +// +// var body: some View { +// TabView(selection: $tabSelection) { +// NavigationView{FirstView()}.tabItem { +// Text("1") +// } +// .tag(1) +// SecondView().tabItem { +// Text("2") +// } +// .tag(2) +// } +// +// +// } +//} +//struct FirstView: View { +// @State var isPresent = false +// var body: some View { +// +// VStack{ +// Text("test") +// .onTapGesture(perform: { +// self.isPresent.toggle() +// }) +// }.sheet(isPresented: $isPresent, content: { +// DetailView() +// }) +// } +//} +// +// +//struct DetailView: View { +// var body: some View { +// NavigationView{ +// VStack{ +// NavigationLink(destination: DetailView2()) { +// Text("Go to detail detail") +// } +// } +// } +// +//// .onAppear(perform: Tool.hiddenTabBar) +//// .onDisappear(perform: Tool.showTabBar) +// +// } +//} +//struct DetailView2: View { +// +// var body: some View{ +// VStack{ +// NavigationLink(destination: FirstView()) { +// Text("Go to First") +// } } +// .onAppear(perform: Tool.hiddenTabBar) +// } +// +//} +//struct SecondView: View { +// var body: some View { +// NavigationView{ +// VStack{ +// NavigationLink(destination: DetailView()) { +// Text("Go to details") +// } +// } +// }.onAppear(perform: Tool.showTabBar) +// .onDisappear(perform: Tool.hiddenTabBar) +// } +//} +//extension UIView { +// +// func allSubviews() -> [UIView] { +// var res = self.subviews +// for subview in self.subviews { +// let riz = subview.allSubviews() +// res.append(contentsOf: riz) +// } +// return res +// } +//} +// +//struct Tool { +// static func showTabBar() { +// UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.allSubviews().forEach({ (v) in +// if let view = v as? UITabBar { +// view.isHidden = false +// } +// }) +// } +// +// static func hiddenTabBar() { +// UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.allSubviews().forEach({ (v) in +// if let view = v as? UITabBar { +// view.isHidden = true +// } +// }) +// } +//} +// +//struct ShowTabBar: ViewModifier { +// func body(content: Content) -> some View { +// return content.padding(.zero).onAppear { +// Tool.showTabBar() +// } +// } +//} +//struct HiddenTabBar: ViewModifier { +// func body(content: Content) -> some View { +// return content.padding(.zero).onAppear { +// Tool.hiddenTabBar() +// } +// } +//} +// +//extension View { +// func showTabBar() -> some View { +// return self.modifier(ShowTabBar()) +// } +// func hiddenTabBar() -> some View { +// return self.modifier(HiddenTabBar()) +// } +//} diff --git a/Testing/View/MerchantPromotionView.swift b/Testing/View/MerchantPromotionView.swift new file mode 100644 index 0000000..7d08e0f --- /dev/null +++ b/Testing/View/MerchantPromotionView.swift @@ -0,0 +1,80 @@ +// +// MerchantPromotionView.swift +// Proj1 +// +// Created by Hao Yang Yip on 18/08/2020. +// Copyright © 2020 Hao Yang Yip. All rights reserved. +// + +import SwiftUI + +struct MerchantPromotionView: View { + @ObservedObject var datas = MerchantPromotionJson() + + var body: some View { + + List(datas.json){ item in + + + VStack(alignment: .leading){ + HStack{ + Image("\(item.img)") + .resizable() + .aspectRatio(contentMode: .fill) + .frame(width: 50, height: 50) + .clipShape(Circle()) + .overlay(Circle().stroke(Color.white, lineWidth: 2)) + + .padding(3) + VStack(alignment: .leading){ + Text(item.shop) + .font(.headline) + Text(item.date) + .font(.subheadline) + } + } + Text(item.msg) + .font(.body) + Image(item.img) + .resizable() + .aspectRatio(contentMode: .fit) + .clipped() + .cornerRadius(30) + .padding(.bottom, 20) + } + + } + } +} + +struct MerchantPromotionView_Previews: PreviewProvider { + static var previews: some View { + MerchantPromotionView() + } +} + +class MerchantPromotionJson: ObservableObject { + @Published var json = [Promotion]() + + init() { + load() + } + func load() { + let path = Bundle.main.path(forResource: "merchantPromotionData", ofType: "json") + let url = URL(fileURLWithPath: path!) + URLSession.shared.dataTask(with: url) { (data, response, error) in do{ + if let data = data { + let json = try JSONDecoder().decode([Promotion].self, from: data) + DispatchQueue.main.sync { + self.json = json + } + } else { + print("No data") + } + } catch{ + print(error) + } + }.resume() + } + +} diff --git a/Testing/View/codeScanner.swift b/Testing/View/codeScanner.swift new file mode 100644 index 0000000..4ada23a --- /dev/null +++ b/Testing/View/codeScanner.swift @@ -0,0 +1,69 @@ +// +// codeScanner.swift +// Testing +// +// Created by Hao Yang Yip on 14/09/2020. +// Copyright © 2020 Hao Yang Yip. All rights reserved. +// +// +//import SwiftUI +// +//import CodeScanner +//struct ContentView: View { +// @State var isPresentingScanner = false +// @State var scannedCode: String? +// @State private var selectedItem = 1 +// @State private var oldSelectedItem = 1 +// +// var body: some View { +// TabView(selection: $selectedItem){ +// Text("1") +// .tabItem { +// Image(systemName: "house") +// }.tag(1) +// .onAppear { +// self.oldSelectedItem = self.selectedItem +// } +// +// Text("Add") +// .tabItem { Image(systemName: "plus.circle") } +// .tag(2) +// .onAppear { +// self.isPresentingScanner.toggle() +// self.selectedItem = self.oldSelectedItem +// } +// +// Text("3") +// .tabItem { +// Image(systemName: "calendar") +// }.tag(3) +// .onAppear { +// self.oldSelectedItem = self.selectedItem +// } +// } +// .sheet(isPresented: $isPresentingScanner) { +// self.scannerSheet +// } +// .accentColor(Color.orange) +// .navigationBarBackButtonHidden(true) +// .navigationBarHidden(true) +// +// } +// +// var scannerSheet : some View { +// CodeScannerView( +// codeTypes: [.qr], +// completion: { result in +// if case let .success(code) = result { +// self.scannedCode = code +// self.isPresentingScanner = false +// } +// } +// ) +// } +//} +//struct NextView : View { +// var body : some View { +// Text("Second") +// } +//} diff --git a/Testing/View/msgData.json b/Testing/View/msgData.json new file mode 100644 index 0000000..fda0b4c --- /dev/null +++ b/Testing/View/msgData.json @@ -0,0 +1,36 @@ + +[ + { + "id": "1", + "msg": "Hi ABC, your appointment at Sunway, on Friday, August 7th 2020, 9:30 am is confirmed. For more information, please contact 60123456789", + "shop": "Salon A", + "date": "2020-08-08", + "tel": "01111639290", + "img": "A" + }, + { + "id": "2", + "msg": "Hi ABC, your outstandings balance at Salon B is 65.00", + "shop": "Salon B", + "date": "2020-08-08", + "tel": "0123456789", + "img": "B" + }, + { + "id": "3", + "msg": "Hi ABC, your outstan0.00", + "shop": "Salon C", + "date": "2020-08-08", + "tel": "0112345678", + "img": "C" + }, + { + "id": "3", + "msg": "Hi ABC, your outstandings balance at Salon C is 100.00 asd dds xczxc", + "shop": "Salon D", + "date": "2020-08-08", + "tel": "0112345678", + "img": "D" + } +] + diff --git a/Testing/View/profile.png b/Testing/View/profile.png new file mode 100644 index 0000000..31dc931 Binary files /dev/null and b/Testing/View/profile.png differ diff --git a/Testing/View/select profile.swift b/Testing/View/select profile.swift new file mode 100644 index 0000000..24598dd --- /dev/null +++ b/Testing/View/select profile.swift @@ -0,0 +1,121 @@ +//// +//// select profile.swift +//// Testing +//// +//// Created by Hao Yang Yip on 14/09/2020. +//// Copyright © 2020 Hao Yang Yip. All rights reserved. +//// +// +//import SwiftUI +// +//struct ContentView: View { +// +// @State var isShowPicker: Bool = false +// @State var image: Image? = Image("profile") +// +// var body: some View { +// NavigationView { +// ZStack { +// VStack { +// image? +// .resizable() +// .clipShape(Circle()) +// .frame(width: 150, height: 150) +// .scaledToFit() +// .onTapGesture { +// self.isShowPicker.toggle() +// } +// Spacer() +// } +// } +// .sheet(isPresented: $isShowPicker) { +// ImagePicker(image: self.$image) +// } +// .navigationBarTitle("Pick Image") +// } +// } +//} +// +// +//struct ImagePicker: UIViewControllerRepresentable { +// +// @Environment(\.presentationMode) +// var presentationMode +// +// @Binding var image: Image? +// +// class Coordinator: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate { +// +// @Binding var presentationMode: PresentationMode +// @Binding var image: Image? +// +// init(presentationMode: Binding, image: Binding) { +// _presentationMode = presentationMode +// _image = image +// } +// +// func imagePickerController(_ picker: UIImagePickerController, +// didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { +// let uiImage = info[UIImagePickerController.InfoKey.originalImage] as! UIImage +// image = Image(uiImage: uiImage) +// print(image! as Any) +// presentationMode.dismiss() +// +// } +// +// func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { +// presentationMode.dismiss() +// } +// +// } +// +// func makeCoordinator() -> Coordinator { +// return Coordinator(presentationMode: presentationMode, image: $image) +// } +// +// func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIImagePickerController { +// let picker = UIImagePickerController() +// picker.delegate = context.coordinator +// return picker +// } +// +// func updateUIViewController(_ uiViewController: UIImagePickerController, +// context: UIViewControllerRepresentableContext) { +// +// } +// +//} +// +////import SwiftUI +//// +////struct ContentView: View { +//// +//// @State private var showImagePicker : Bool = false +//// @State private var image : Image? = Image("profile") +//// +//// var body: some View { +//// NavigationView{ +//// +//// VStack { +//// +//// image?.resizable().scaledToFit() +//// .onTapGesture { +//// self.showImagePicker = true +//// +//// } +//// Button("Open Camera"){ +//// self.showImagePicker = true +//// }.padding() +//// .foregroundColor(Color.white) +//// .background(Color.purple) +//// .cornerRadius(10) +//// }.sheet(isPresented: self.$showImagePicker){ +//// PhotoCaptureView(showImagePicker: self.$showImagePicker, image: self.$image) +//// } +//// +//// .navigationBarTitle(Text("Camera")) +//// } +//// } +//// +//// +////} diff --git a/Testing/merchantPromotionData.json b/Testing/merchantPromotionData.json new file mode 100644 index 0000000..5a2a972 --- /dev/null +++ b/Testing/merchantPromotionData.json @@ -0,0 +1,29 @@ +[ + { + "id": "1", + "title": "promotion C", + "img": "C", + "shop": "Salon C", + "date": "2020-09-01", + "tel": "0123456789", + "msg": "This is Promotion A by Salon A", + }, + { + "id": "2", + "title": "promotion C", + "img": "C", + "shop": "Salon B", + "date": "2020-09-01", + "tel": "0123456789", + "msg": "This is Promotion B by Salon B", + }, + { + "id": "3", + "title": "promotion C", + "img": "C", + "shop": "Salon C", + "date": "2020-09-01", + "tel": "0123456789", + "msg": "This is Promotion C by Salon C", + }, +] diff --git a/Testing/promotionData.json b/Testing/promotionData.json new file mode 100644 index 0000000..e4f3a99 --- /dev/null +++ b/Testing/promotionData.json @@ -0,0 +1,122 @@ +[ + { + "id": "1", + "title": "promotion A", + "imgURL": "https://img.tunai.io/89ea35db-fd6c-4a7c-937a-7c69fe6acfb1.png", + "img": "https://img.tunai.io/0ACFE8DE-7C69-480A-9946-AA5CABBFBC19.jpg", + "shop": "Salon A", + "date": "2020-09-01", + "tel": "01111639290", + "msg": "This is Promotion A by Salon A kjasdh kjahds kjhsd kjahdkja shdkjashd ksdja hkjahd kajshdkjhsa dkjhasdkj", + }, + { + "id": "2", + "title": "promotion B", + "imgURL": "https://m.tunai.io/c51090c5-cdd8-42b5-bba4-3f55714c829f.png", + "shop": "Salon B", + "img": "https://img.tunai.io/3A9870F5-6E0C-4A39-BC51-07A709394722.jpg", + "date": "2020-09-01", + "tel": "0123456789", + "msg": "This is Promotion B by Salon B", + }, + { + "id": "3", + "title": "promotion C", + "imgURL": "https://img.tunai.io/fe99d557-7a29-4193-aaf5-8a4193dbe54c.png", + "img": "https://img.tunai.io/283AD3D2-6CC3-428D-93F8-B16DCCFC2F43.jpg", + "shop": "Salon C", + "date": "2020-09-01", + "tel": "0112345678", + "msg": "This is Promotion C by Salon C", + }, + { + "id": "1", + "title": "promotion A", + "imgURL": "https://img.tunai.io/89ea35db-fd6c-4a7c-937a-7c69fe6acfb1.png", + "img": "https://img.tunai.io/83B118A4-2E8D-4480-AE0A-C3A4FCDA0AC6.jpg", + "shop": "Salon A", + "date": "2020-09-01", + "tel": "01111639290", + "msg": "This is Promotion A by Salon A kjasdh kjahds kjhsd kjahdkja shdkjashd ksdja hkjahd kajshdkjhsa dkjhasdkj", + }, + { + "id": "1", + "title": "promotion A", + "imgURL": "https://img.tunai.io/89ea35db-fd6c-4a7c-937a-7c69fe6acfb1.png", + "img": "https://img.tunai.io/0ACFE8DE-7C69-480A-9946-AA5CABBFBC19.jpg", + "shop": "Salon A", + "date": "2020-09-01", + "tel": "01111639290", + "msg": "This is Promotion A by Salon A kjasdh kjahds kjhsd kjahdkja shdkjashd ksdja hkjahd kajshdkjhsa dkjhasdkj", + }, + { + "id": "2", + "title": "promotion B", + "imgURL": "https://m.tunai.io/c51090c5-cdd8-42b5-bba4-3f55714c829f.png", + "shop": "Salon B", + "img": "https://img.tunai.io/3A9870F5-6E0C-4A39-BC51-07A709394722.jpg", + "date": "2020-09-01", + "tel": "0123456789", + "msg": "This is Promotion B by Salon B", + }, + { + "id": "3", + "title": "promotion C", + "imgURL": "https://img.tunai.io/fe99d557-7a29-4193-aaf5-8a4193dbe54c.png", + "img": "https://img.tunai.io/283AD3D2-6CC3-428D-93F8-B16DCCFC2F43.jpg", + "shop": "Salon C", + "date": "2020-09-01", + "tel": "0112345678", + "msg": "This is Promotion C by Salon C", + }, + { + "id": "1", + "title": "promotion A", + "imgURL": "https://img.tunai.io/89ea35db-fd6c-4a7c-937a-7c69fe6acfb1.png", + "img": "https://img.tunai.io/83B118A4-2E8D-4480-AE0A-C3A4FCDA0AC6.jpg", + "shop": "Salon A", + "date": "2020-09-01", + "tel": "01111639290", + "msg": "This is Promotion A by Salon A kjasdh kjahds kjhsd kjahdkja shdkjashd ksdja hkjahd kajshdkjhsa dkjhasdkj", + }, + { + "id": "1", + "title": "promotion A", + "imgURL": "https://img.tunai.io/89ea35db-fd6c-4a7c-937a-7c69fe6acfb1.png", + "img": "https://img.tunai.io/0ACFE8DE-7C69-480A-9946-AA5CABBFBC19.jpg", + "shop": "Salon A", + "date": "2020-09-01", + "tel": "01111639290", + "msg": "This is Promotion A by Salon A kjasdh kjahds kjhsd kjahdkja shdkjashd ksdja hkjahd kajshdkjhsa dkjhasdkj", + }, + { + "id": "2", + "title": "promotion B", + "imgURL": "https://m.tunai.io/c51090c5-cdd8-42b5-bba4-3f55714c829f.png", + "shop": "Salon B", + "img": "https://img.tunai.io/3A9870F5-6E0C-4A39-BC51-07A709394722.jpg", + "date": "2020-09-01", + "tel": "0123456789", + "msg": "This is Promotion B by Salon B", + }, + { + "id": "3", + "title": "promotion C", + "imgURL": "https://img.tunai.io/fe99d557-7a29-4193-aaf5-8a4193dbe54c.png", + "img": "https://img.tunai.io/283AD3D2-6CC3-428D-93F8-B16DCCFC2F43.jpg", + "shop": "Salon C", + "date": "2020-09-01", + "tel": "0112345678", + "msg": "This is Promotion C by Salon C", + }, + { + "id": "1", + "title": "promotion A", + "imgURL": "https://img.tunai.io/89ea35db-fd6c-4a7c-937a-7c69fe6acfb1.png", + "img": "https://img.tunai.io/83B118A4-2E8D-4480-AE0A-C3A4FCDA0AC6.jpg", + "shop": "Salon A", + "date": "2020-09-01", + "tel": "01111639290", + "msg": "This is Promotion A by Salon A kjasdh kjahds kjhsd kjahdkja shdkjashd ksdja hkjahd kajshdkjhsa dkjhasdkj", + }, +]