From f7dcd1feff025ce6dbfa52da8d71259b3b469729 Mon Sep 17 00:00:00 2001 From: Alexander Munch-hansen Date: Mon, 31 Jul 2017 23:52:46 +0200 Subject: [PATCH] Initial Commit --- dcav-uploader.xcodeproj/project.pbxproj | 431 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcdebugger/Breakpoints_v2.xcbkptlist | 5 + .../xcschemes/dcav-uploader.xcscheme | 101 ++++ .../xcschemes/xcschememanagement.plist | 27 ++ dcav-uploader/AppDelegate.swift | 46 ++ .../AppIcon.appiconset/Contents.json | 93 ++++ .../Base.lproj/LaunchScreen.storyboard | 27 ++ dcav-uploader/Base.lproj/Main.storyboard | 116 +++++ dcav-uploader/Info.plist | 47 ++ dcav-uploader/Settings.bundle/Root.plist | 67 +++ .../Settings.bundle/en.lproj/Root.strings | Bin 0 -> 546 bytes dcav-uploader/SettingsViewController.swift | 35 ++ dcav-uploader/ViewController.swift | 125 +++++ dcav-uploaderTests/Info.plist | 22 + dcav-uploaderTests/dcav_uploaderTests.swift | 36 ++ 16 files changed, 1185 insertions(+) create mode 100644 dcav-uploader.xcodeproj/project.pbxproj create mode 100644 dcav-uploader.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist create mode 100644 dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcschemes/dcav-uploader.xcscheme create mode 100644 dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 dcav-uploader/AppDelegate.swift create mode 100644 dcav-uploader/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 dcav-uploader/Base.lproj/LaunchScreen.storyboard create mode 100644 dcav-uploader/Base.lproj/Main.storyboard create mode 100644 dcav-uploader/Info.plist create mode 100644 dcav-uploader/Settings.bundle/Root.plist create mode 100644 dcav-uploader/Settings.bundle/en.lproj/Root.strings create mode 100644 dcav-uploader/SettingsViewController.swift create mode 100644 dcav-uploader/ViewController.swift create mode 100644 dcav-uploaderTests/Info.plist create mode 100644 dcav-uploaderTests/dcav_uploaderTests.swift diff --git a/dcav-uploader.xcodeproj/project.pbxproj b/dcav-uploader.xcodeproj/project.pbxproj new file mode 100644 index 0000000..a1be6b7 --- /dev/null +++ b/dcav-uploader.xcodeproj/project.pbxproj @@ -0,0 +1,431 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + AC786EAF1F2F9B270013741A /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = AC786EAE1F2F9B270013741A /* Settings.bundle */; }; + ACAAF0061F2F93C600271C26 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACAAF0051F2F93C600271C26 /* AppDelegate.swift */; }; + ACAAF0081F2F93C600271C26 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACAAF0071F2F93C600271C26 /* ViewController.swift */; }; + ACAAF00B1F2F93C600271C26 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ACAAF0091F2F93C600271C26 /* Main.storyboard */; }; + ACAAF00D1F2F93C600271C26 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ACAAF00C1F2F93C600271C26 /* Assets.xcassets */; }; + ACAAF0101F2F93C600271C26 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ACAAF00E1F2F93C600271C26 /* LaunchScreen.storyboard */; }; + ACAAF01B1F2F93C600271C26 /* dcav_uploaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACAAF01A1F2F93C600271C26 /* dcav_uploaderTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + ACAAF0171F2F93C600271C26 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = ACAAEFFA1F2F93C600271C26 /* Project object */; + proxyType = 1; + remoteGlobalIDString = ACAAF0011F2F93C600271C26; + remoteInfo = "dcav-uploader"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + AC786EAE1F2F9B270013741A /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = ""; }; + ACAAF0021F2F93C600271C26 /* dcav-uploader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "dcav-uploader.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + ACAAF0051F2F93C600271C26 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + ACAAF0071F2F93C600271C26 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + ACAAF00A1F2F93C600271C26 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + ACAAF00C1F2F93C600271C26 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + ACAAF00F1F2F93C600271C26 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + ACAAF0111F2F93C600271C26 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + ACAAF0161F2F93C600271C26 /* dcav-uploaderTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "dcav-uploaderTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + ACAAF01A1F2F93C600271C26 /* dcav_uploaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dcav_uploaderTests.swift; sourceTree = ""; }; + ACAAF01C1F2F93C600271C26 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + ACAAEFFF1F2F93C600271C26 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ACAAF0131F2F93C600271C26 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + ACAAEFF91F2F93C600271C26 = { + isa = PBXGroup; + children = ( + ACAAF0041F2F93C600271C26 /* dcav-uploader */, + ACAAF0191F2F93C600271C26 /* dcav-uploaderTests */, + ACAAF0031F2F93C600271C26 /* Products */, + ); + sourceTree = ""; + }; + ACAAF0031F2F93C600271C26 /* Products */ = { + isa = PBXGroup; + children = ( + ACAAF0021F2F93C600271C26 /* dcav-uploader.app */, + ACAAF0161F2F93C600271C26 /* dcav-uploaderTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + ACAAF0041F2F93C600271C26 /* dcav-uploader */ = { + isa = PBXGroup; + children = ( + ACAAF0051F2F93C600271C26 /* AppDelegate.swift */, + ACAAF0071F2F93C600271C26 /* ViewController.swift */, + ACAAF0091F2F93C600271C26 /* Main.storyboard */, + ACAAF00C1F2F93C600271C26 /* Assets.xcassets */, + ACAAF00E1F2F93C600271C26 /* LaunchScreen.storyboard */, + ACAAF0111F2F93C600271C26 /* Info.plist */, + AC786EAE1F2F9B270013741A /* Settings.bundle */, + ); + path = "dcav-uploader"; + sourceTree = ""; + }; + ACAAF0191F2F93C600271C26 /* dcav-uploaderTests */ = { + isa = PBXGroup; + children = ( + ACAAF01A1F2F93C600271C26 /* dcav_uploaderTests.swift */, + ACAAF01C1F2F93C600271C26 /* Info.plist */, + ); + path = "dcav-uploaderTests"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + ACAAF0011F2F93C600271C26 /* dcav-uploader */ = { + isa = PBXNativeTarget; + buildConfigurationList = ACAAF01F1F2F93C600271C26 /* Build configuration list for PBXNativeTarget "dcav-uploader" */; + buildPhases = ( + ACAAEFFE1F2F93C600271C26 /* Sources */, + ACAAEFFF1F2F93C600271C26 /* Frameworks */, + ACAAF0001F2F93C600271C26 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "dcav-uploader"; + productName = "dcav-uploader"; + productReference = ACAAF0021F2F93C600271C26 /* dcav-uploader.app */; + productType = "com.apple.product-type.application"; + }; + ACAAF0151F2F93C600271C26 /* dcav-uploaderTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = ACAAF0221F2F93C600271C26 /* Build configuration list for PBXNativeTarget "dcav-uploaderTests" */; + buildPhases = ( + ACAAF0121F2F93C600271C26 /* Sources */, + ACAAF0131F2F93C600271C26 /* Frameworks */, + ACAAF0141F2F93C600271C26 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ACAAF0181F2F93C600271C26 /* PBXTargetDependency */, + ); + name = "dcav-uploaderTests"; + productName = "dcav-uploaderTests"; + productReference = ACAAF0161F2F93C600271C26 /* dcav-uploaderTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + ACAAEFFA1F2F93C600271C26 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0830; + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = Guava; + TargetAttributes = { + ACAAF0011F2F93C600271C26 = { + CreatedOnToolsVersion = 8.3.3; + ProvisioningStyle = Automatic; + }; + ACAAF0151F2F93C600271C26 = { + CreatedOnToolsVersion = 8.3.3; + ProvisioningStyle = Automatic; + TestTargetID = ACAAF0011F2F93C600271C26; + }; + }; + }; + buildConfigurationList = ACAAEFFD1F2F93C600271C26 /* Build configuration list for PBXProject "dcav-uploader" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = ACAAEFF91F2F93C600271C26; + productRefGroup = ACAAF0031F2F93C600271C26 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + ACAAF0011F2F93C600271C26 /* dcav-uploader */, + ACAAF0151F2F93C600271C26 /* dcav-uploaderTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + ACAAF0001F2F93C600271C26 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AC786EAF1F2F9B270013741A /* Settings.bundle in Resources */, + ACAAF0101F2F93C600271C26 /* LaunchScreen.storyboard in Resources */, + ACAAF00D1F2F93C600271C26 /* Assets.xcassets in Resources */, + ACAAF00B1F2F93C600271C26 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ACAAF0141F2F93C600271C26 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + ACAAEFFE1F2F93C600271C26 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ACAAF0081F2F93C600271C26 /* ViewController.swift in Sources */, + ACAAF0061F2F93C600271C26 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + ACAAF0121F2F93C600271C26 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ACAAF01B1F2F93C600271C26 /* dcav_uploaderTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + ACAAF0181F2F93C600271C26 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = ACAAF0011F2F93C600271C26 /* dcav-uploader */; + targetProxy = ACAAF0171F2F93C600271C26 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + ACAAF0091F2F93C600271C26 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + ACAAF00A1F2F93C600271C26 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + ACAAF00E1F2F93C600271C26 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + ACAAF00F1F2F93C600271C26 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + ACAAF01D1F2F93C600271C26 /* 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++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + ACAAF01E1F2F93C600271C26 /* 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++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + ACAAF0201F2F93C600271C26 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = "dcav-uploader/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "space.guava.dcav-uploader"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + ACAAF0211F2F93C600271C26 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = "dcav-uploader/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "space.guava.dcav-uploader"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + ACAAF0231F2F93C600271C26 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = "dcav-uploaderTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "space.guava.dcav-uploaderTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/dcav-uploader.app/dcav-uploader"; + }; + name = Debug; + }; + ACAAF0241F2F93C600271C26 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = "dcav-uploaderTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "space.guava.dcav-uploaderTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/dcav-uploader.app/dcav-uploader"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + ACAAEFFD1F2F93C600271C26 /* Build configuration list for PBXProject "dcav-uploader" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ACAAF01D1F2F93C600271C26 /* Debug */, + ACAAF01E1F2F93C600271C26 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ACAAF01F1F2F93C600271C26 /* Build configuration list for PBXNativeTarget "dcav-uploader" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ACAAF0201F2F93C600271C26 /* Debug */, + ACAAF0211F2F93C600271C26 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + ACAAF0221F2F93C600271C26 /* Build configuration list for PBXNativeTarget "dcav-uploaderTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ACAAF0231F2F93C600271C26 /* Debug */, + ACAAF0241F2F93C600271C26 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = ACAAEFFA1F2F93C600271C26 /* Project object */; +} diff --git a/dcav-uploader.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/dcav-uploader.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..d7a3be6 --- /dev/null +++ b/dcav-uploader.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcschemes/dcav-uploader.xcscheme b/dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcschemes/dcav-uploader.xcscheme new file mode 100644 index 0000000..c6ba130 --- /dev/null +++ b/dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcschemes/dcav-uploader.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcschemes/xcschememanagement.plist b/dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6c9c644 --- /dev/null +++ b/dcav-uploader.xcodeproj/xcuserdata/alexandermunch-hansen.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + dcav-uploader.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + ACAAF0011F2F93C600271C26 + + primary + + + ACAAF0151F2F93C600271C26 + + primary + + + + + diff --git a/dcav-uploader/AppDelegate.swift b/dcav-uploader/AppDelegate.swift new file mode 100644 index 0000000..7519d6a --- /dev/null +++ b/dcav-uploader/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// dcav-uploader +// +// Created by Alexander Munch-hansen on 31/07/2017. +// Copyright © 2017 Guava. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/dcav-uploader/Assets.xcassets/AppIcon.appiconset/Contents.json b/dcav-uploader/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/dcav-uploader/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "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" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dcav-uploader/Base.lproj/LaunchScreen.storyboard b/dcav-uploader/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..fdf3f97 --- /dev/null +++ b/dcav-uploader/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dcav-uploader/Base.lproj/Main.storyboard b/dcav-uploader/Base.lproj/Main.storyboard new file mode 100644 index 0000000..a4a86d9 --- /dev/null +++ b/dcav-uploader/Base.lproj/Main.storyboard @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dcav-uploader/Info.plist b/dcav-uploader/Info.plist new file mode 100644 index 0000000..4102788 --- /dev/null +++ b/dcav-uploader/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.0.1 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSPhotoLibraryUsageDescription + Plz give access + NSCameraUsageDescription + Need to access camera lol + + diff --git a/dcav-uploader/Settings.bundle/Root.plist b/dcav-uploader/Settings.bundle/Root.plist new file mode 100644 index 0000000..c80f861 --- /dev/null +++ b/dcav-uploader/Settings.bundle/Root.plist @@ -0,0 +1,67 @@ + + + + + StringsTable + Root + PreferenceSpecifiers + + + Type + PSGroupSpecifier + Title + User data + + + Type + PSTextFieldSpecifier + Title + API Endpoint URL + Key + endpoint_preference + AutocapitalizationType + None + AutocorrectionType + No + + + Type + PSTitleValueSpecifier + Title + Device ID + Key + id_preference + DefaultValue + + + + Type + PSTextFieldSpecifier + Title + Username + Key + username_preference + DefaultValue + + IsSecure + + KeyboardType + Alphabet + AutocapitalizationType + None + AutocorrectionType + No + + + Type + PSTextFieldSpecifier + IsSecure + + Title + Passphrase + Key + passphrase_preference + + + + diff --git a/dcav-uploader/Settings.bundle/en.lproj/Root.strings b/dcav-uploader/Settings.bundle/en.lproj/Root.strings new file mode 100644 index 0000000000000000000000000000000000000000..8cd87b9d6b20c1fbf87bd4db3db267fca5ad4df9 GIT binary patch literal 546 zcmaixOHRW;5JYRuDMndFh#Ua1V1d}N;sVAV2TO?uC3a9aJn*VxFrY}tnon0(S66#J z-d9>G>6W!ur(SDqlp`9nn~*(m%iWnv?yq`Qfp6XbK1?+om~~#r)ZnhkYQU_VbfjuT zHNn`CX<0sd*m1A}>&5sU$akD=GTXJ1e literal 0 HcmV?d00001 diff --git a/dcav-uploader/SettingsViewController.swift b/dcav-uploader/SettingsViewController.swift new file mode 100644 index 0000000..96630a2 --- /dev/null +++ b/dcav-uploader/SettingsViewController.swift @@ -0,0 +1,35 @@ +// +// SettingsViewController.swift +// dcav-uploader +// +// Created by Alexander Munch-hansen on 31/07/2017. +// Copyright © 2017 Guava. All rights reserved. +// + +import UIKit + +class SettingsViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/dcav-uploader/ViewController.swift b/dcav-uploader/ViewController.swift new file mode 100644 index 0000000..b326f20 --- /dev/null +++ b/dcav-uploader/ViewController.swift @@ -0,0 +1,125 @@ +// +// ViewController.swift +// dcav-uploader +// +// Created by Alexander Munch-hansen on 31/07/2017. +// Copyright © 2017 Guava. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UITextFieldDelegate { + + @IBOutlet weak var labell: UILabel! + @IBOutlet weak var imageView: UIImageView! + var imagePickerController : UIImagePickerController! + @IBOutlet weak var dcavTextField: UITextField! + var responseString : String! + + override func viewDidLoad() { + super.viewDidLoad() + UserDefaults.standard.synchronize() + dcavTextField.delegate = self + labell.text = UserDefaults.standard.string(forKey: "username_preference") + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + @IBAction func onLibraryButton(_ sender: Any) { + imagePickerController = UIImagePickerController() + imagePickerController.delegate = self + imagePickerController.sourceType = .photoLibrary + present(imagePickerController, animated: true, completion: nil) + } + + @IBAction func onPhotoButton(_ sender: Any) { + imagePickerController = UIImagePickerController() + imagePickerController.delegate = self + imagePickerController.sourceType = .camera + present(imagePickerController, animated: true, completion: nil) + } + + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { + imagePickerController.dismiss(animated: true, completion: nil) + imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage + } + + @IBAction func onSaveButton(_ sender: Any) { + } + + @IBAction func onUploadButton(_ sender: Any) { + guard let username : String = UserDefaults.standard.string(forKey: "username_preference") else { + print("USERNAME, MOTHERFUCKER!") + // TODO create proper pop-up + return + } + guard let passphrase : String = UserDefaults.standard.string(forKey: "passphrase_preference") else { + // TODO create proper pop-up + print("PASSPHRASE, MOTHERFUCKER!") + return + } + + let request = generateRequest(user: username, pass: passphrase) + + let task = URLSession.shared.dataTask(with: request) { data, response, error in + guard let data = data, error == nil else { // check for fundamental networking error + print("error=\(String(describing: error))") + return + } + + if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200 { // check for http errors + print("statusCode should be 200, but is \(httpStatus.statusCode)") + print("response = \(String(describing: response))") + } + self.responseString = String(data: data, encoding: .utf8)! + print("responseString = \(String(describing: self.responseString))") + } + task.resume() + dcavTextField.text = "https://dcav.pw/\(String(describing: self.labell.text![(self.labell.text!.startIndex)]))\(String(describing: responseString))" + } + + + + func generateBoundaryString() -> String { + return "Boundary-\(NSUUID().uuidString)" + } + + func generateRequest(user: String, pass: String) -> URLRequest { + let params : [String : String] = [ "user": user, "pass": pass ] + + let url = URL(string: "http://192.168.0.119:35257/upload") + + let boundary = generateBoundaryString() + + var request = URLRequest(url: url!) + request.httpMethod = "POST" + request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") + + let imageData: Data = UIImagePNGRepresentation(imageView.image!)! + + var body = Data() + + for (key, value) in params { + body.append(Data("--\(boundary)\r\n".utf8)) + body.append(Data("Content-Disposition: form-data; name=\"\(key)\"\r\n\r\n".utf8)) + body.append(Data("\(value)\r\n".utf8)) + } + + let mimetype : String = "application/octet-stream" + + body.append(Data("--\(boundary)\r\n".utf8)) + body.append(Data("Content-Disposition: form-data; name=\"imagedata\"; filename=\"lolfag.png\"\r\n".utf8)) + body.append(Data("Content-Type: \(mimetype)\r\n\r\n".utf8)) + body.append(imageData) + body.append(Data("\r\n".utf8)) + + body.append(Data("--\(boundary)--\r\n".utf8)) + request.httpBody = body + + return request + } +} + diff --git a/dcav-uploaderTests/Info.plist b/dcav-uploaderTests/Info.plist new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ b/dcav-uploaderTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/dcav-uploaderTests/dcav_uploaderTests.swift b/dcav-uploaderTests/dcav_uploaderTests.swift new file mode 100644 index 0000000..19d2e94 --- /dev/null +++ b/dcav-uploaderTests/dcav_uploaderTests.swift @@ -0,0 +1,36 @@ +// +// dcav_uploaderTests.swift +// dcav-uploaderTests +// +// Created by Alexander Munch-hansen on 31/07/2017. +// Copyright © 2017 Guava. All rights reserved. +// + +import XCTest +@testable import dcav_uploader + +class dcav_uploaderTests: XCTestCase { + + override func setUp() { + super.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. + super.tearDown() + } + + 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. + } + } + +}