diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..17eaec19 Binary files /dev/null and b/.DS_Store differ diff --git a/iosGigsProject/.DS_Store b/iosGigsProject/.DS_Store new file mode 100644 index 00000000..621d925b Binary files /dev/null and b/iosGigsProject/.DS_Store differ diff --git a/iosGigsProject/iosGigsProject.xcodeproj/project.pbxproj b/iosGigsProject/iosGigsProject.xcodeproj/project.pbxproj new file mode 100644 index 00000000..3c61d86d --- /dev/null +++ b/iosGigsProject/iosGigsProject.xcodeproj/project.pbxproj @@ -0,0 +1,391 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 4A8EA8EB24BEA47A00F22605 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8EA8EA24BEA47A00F22605 /* User.swift */; }; + 4A8EA8EE24BEA5D300F22605 /* GigController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8EA8ED24BEA5D300F22605 /* GigController.swift */; }; + 4ACCF10624BB9C14009FF61E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ACCF10524BB9C14009FF61E /* AppDelegate.swift */; }; + 4ACCF10824BB9C14009FF61E /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ACCF10724BB9C14009FF61E /* SceneDelegate.swift */; }; + 4ACCF10D24BB9C14009FF61E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4ACCF10B24BB9C14009FF61E /* Main.storyboard */; }; + 4ACCF10F24BB9C2F009FF61E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4ACCF10E24BB9C2F009FF61E /* Assets.xcassets */; }; + 4ACCF11224BB9C2F009FF61E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4ACCF11024BB9C2F009FF61E /* LaunchScreen.storyboard */; }; + 4ACCF11A24BBA123009FF61E /* GigsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ACCF11924BBA123009FF61E /* GigsTableViewController.swift */; }; + 4ACCF11C24BBA2D3009FF61E /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ACCF11B24BBA2D3009FF61E /* LoginViewController.swift */; }; + 4ACCF11E24BBE1C8009FF61E /* Bearer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ACCF11D24BBE1C8009FF61E /* Bearer.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 4A8EA8EA24BEA47A00F22605 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 4A8EA8ED24BEA5D300F22605 /* GigController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GigController.swift; sourceTree = ""; }; + 4ACCF10224BB9C14009FF61E /* iosGigsProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosGigsProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4ACCF10524BB9C14009FF61E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 4ACCF10724BB9C14009FF61E /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 4ACCF10C24BB9C14009FF61E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 4ACCF10E24BB9C2F009FF61E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 4ACCF11124BB9C2F009FF61E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 4ACCF11324BB9C2F009FF61E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4ACCF11924BBA123009FF61E /* GigsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GigsTableViewController.swift; sourceTree = ""; }; + 4ACCF11B24BBA2D3009FF61E /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; + 4ACCF11D24BBE1C8009FF61E /* Bearer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bearer.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 4ACCF0FF24BB9C13009FF61E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4A8EA8EC24BEA48D00F22605 /* Models */ = { + isa = PBXGroup; + children = ( + 4ACCF11D24BBE1C8009FF61E /* Bearer.swift */, + 4A8EA8EA24BEA47A00F22605 /* User.swift */, + ); + path = Models; + sourceTree = ""; + }; + 4A8EA8EF24BEA5EA00F22605 /* Controllers */ = { + isa = PBXGroup; + children = ( + 4A8EA8ED24BEA5D300F22605 /* GigController.swift */, + ); + path = Controllers; + sourceTree = ""; + }; + 4A8EA8F024BEA67500F22605 /* Views */ = { + isa = PBXGroup; + children = ( + 4ACCF11B24BBA2D3009FF61E /* LoginViewController.swift */, + 4ACCF11924BBA123009FF61E /* GigsTableViewController.swift */, + ); + path = Views; + sourceTree = ""; + }; + 4A8EA8F124BEA6AF00F22605 /* Resources */ = { + isa = PBXGroup; + children = ( + 4ACCF10524BB9C14009FF61E /* AppDelegate.swift */, + 4ACCF10724BB9C14009FF61E /* SceneDelegate.swift */, + 4ACCF10E24BB9C2F009FF61E /* Assets.xcassets */, + ); + path = Resources; + sourceTree = ""; + }; + 4ACCF0F924BB9C13009FF61E = { + isa = PBXGroup; + children = ( + 4ACCF10424BB9C14009FF61E /* iosGigsProject */, + 4ACCF10324BB9C14009FF61E /* Products */, + ); + sourceTree = ""; + }; + 4ACCF10324BB9C14009FF61E /* Products */ = { + isa = PBXGroup; + children = ( + 4ACCF10224BB9C14009FF61E /* iosGigsProject.app */, + ); + name = Products; + sourceTree = ""; + }; + 4ACCF10424BB9C14009FF61E /* iosGigsProject */ = { + isa = PBXGroup; + children = ( + 4A8EA8F124BEA6AF00F22605 /* Resources */, + 4ACCF10B24BB9C14009FF61E /* Main.storyboard */, + 4ACCF11024BB9C2F009FF61E /* LaunchScreen.storyboard */, + 4A8EA8EC24BEA48D00F22605 /* Models */, + 4A8EA8F024BEA67500F22605 /* Views */, + 4A8EA8EF24BEA5EA00F22605 /* Controllers */, + 4ACCF11324BB9C2F009FF61E /* Info.plist */, + ); + path = iosGigsProject; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 4ACCF10124BB9C13009FF61E /* iosGigsProject */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4ACCF11624BB9C2F009FF61E /* Build configuration list for PBXNativeTarget "iosGigsProject" */; + buildPhases = ( + 4ACCF0FE24BB9C13009FF61E /* Sources */, + 4ACCF0FF24BB9C13009FF61E /* Frameworks */, + 4ACCF10024BB9C13009FF61E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = iosGigsProject; + productName = iosGigsProject; + productReference = 4ACCF10224BB9C14009FF61E /* iosGigsProject.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 4ACCF0FA24BB9C13009FF61E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1150; + LastUpgradeCheck = 1150; + ORGANIZATIONNAME = Lambda; + TargetAttributes = { + 4ACCF10124BB9C13009FF61E = { + CreatedOnToolsVersion = 11.5; + }; + }; + }; + buildConfigurationList = 4ACCF0FD24BB9C13009FF61E /* Build configuration list for PBXProject "iosGigsProject" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 4ACCF0F924BB9C13009FF61E; + productRefGroup = 4ACCF10324BB9C14009FF61E /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 4ACCF10124BB9C13009FF61E /* iosGigsProject */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 4ACCF10024BB9C13009FF61E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4ACCF11224BB9C2F009FF61E /* LaunchScreen.storyboard in Resources */, + 4ACCF10F24BB9C2F009FF61E /* Assets.xcassets in Resources */, + 4ACCF10D24BB9C14009FF61E /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4ACCF0FE24BB9C13009FF61E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4ACCF11E24BBE1C8009FF61E /* Bearer.swift in Sources */, + 4A8EA8EE24BEA5D300F22605 /* GigController.swift in Sources */, + 4ACCF11C24BBA2D3009FF61E /* LoginViewController.swift in Sources */, + 4A8EA8EB24BEA47A00F22605 /* User.swift in Sources */, + 4ACCF10624BB9C14009FF61E /* AppDelegate.swift in Sources */, + 4ACCF10824BB9C14009FF61E /* SceneDelegate.swift in Sources */, + 4ACCF11A24BBA123009FF61E /* GigsTableViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 4ACCF10B24BB9C14009FF61E /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4ACCF10C24BB9C14009FF61E /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 4ACCF11024BB9C2F009FF61E /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4ACCF11124BB9C2F009FF61E /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4ACCF11424BB9C2F009FF61E /* 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.5; + 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; + }; + 4ACCF11524BB9C2F009FF61E /* 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.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 4ACCF11724BB9C2F009FF61E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2S8MH4C36K; + INFOPLIST_FILE = iosGigsProject/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.brysonS.iosGigsProject; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 4ACCF11824BB9C2F009FF61E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2S8MH4C36K; + INFOPLIST_FILE = iosGigsProject/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.brysonS.iosGigsProject; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4ACCF0FD24BB9C13009FF61E /* Build configuration list for PBXProject "iosGigsProject" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4ACCF11424BB9C2F009FF61E /* Debug */, + 4ACCF11524BB9C2F009FF61E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4ACCF11624BB9C2F009FF61E /* Build configuration list for PBXNativeTarget "iosGigsProject" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4ACCF11724BB9C2F009FF61E /* Debug */, + 4ACCF11824BB9C2F009FF61E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 4ACCF0FA24BB9C13009FF61E /* Project object */; +} diff --git a/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..effaa70b --- /dev/null +++ b/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/xcuserdata/Brys.xcuserdatad/UserInterfaceState.xcuserstate b/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/xcuserdata/Brys.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..5d9b3f3c Binary files /dev/null and b/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/xcuserdata/Brys.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/xcuserdata/brysonSaclausa.xcuserdatad/UserInterfaceState.xcuserstate b/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/xcuserdata/brysonSaclausa.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..793fb5a6 Binary files /dev/null and b/iosGigsProject/iosGigsProject.xcodeproj/project.xcworkspace/xcuserdata/brysonSaclausa.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iosGigsProject/iosGigsProject.xcodeproj/xcuserdata/Brys.xcuserdatad/xcschemes/xcschememanagement.plist b/iosGigsProject/iosGigsProject.xcodeproj/xcuserdata/Brys.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..6c90867f --- /dev/null +++ b/iosGigsProject/iosGigsProject.xcodeproj/xcuserdata/Brys.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + iosGigsProject.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/iosGigsProject/iosGigsProject.xcodeproj/xcuserdata/brysonSaclausa.xcuserdatad/xcschemes/xcschememanagement.plist b/iosGigsProject/iosGigsProject.xcodeproj/xcuserdata/brysonSaclausa.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..6c90867f --- /dev/null +++ b/iosGigsProject/iosGigsProject.xcodeproj/xcuserdata/brysonSaclausa.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + iosGigsProject.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/iosGigsProject/iosGigsProject/Animal.swift b/iosGigsProject/iosGigsProject/Animal.swift new file mode 100644 index 00000000..67cd366c --- /dev/null +++ b/iosGigsProject/iosGigsProject/Animal.swift @@ -0,0 +1,9 @@ +// +// Animal.swift +// AnimalSpotter +// +// Created by B$hady on 7/13/20. +// Copyright © 2020 Lambda School. All rights reserved. +// + +import Foundation diff --git a/iosGigsProject/iosGigsProject/Base.lproj/LaunchScreen.storyboard b/iosGigsProject/iosGigsProject/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/iosGigsProject/iosGigsProject/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iosGigsProject/iosGigsProject/Base.lproj/Main.storyboard b/iosGigsProject/iosGigsProject/Base.lproj/Main.storyboard new file mode 100644 index 00000000..27d377e5 --- /dev/null +++ b/iosGigsProject/iosGigsProject/Base.lproj/Main.storyboard @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iosGigsProject/iosGigsProject/Controllers/GigController.swift b/iosGigsProject/iosGigsProject/Controllers/GigController.swift new file mode 100644 index 00000000..9647daa5 --- /dev/null +++ b/iosGigsProject/iosGigsProject/Controllers/GigController.swift @@ -0,0 +1,122 @@ +// +// GigController.swift +// iosGigsProject +// +// Created by B$hady on 7/14/20. +// Copyright © 2020 Lambda. All rights reserved. +// + +import Foundation + + +class GigController { + + enum HTTPMethod: String { + case get = "GET" + case post = "POST" + } + + enum NetworkError: Error { + case nodata + case failedSignUp + case failedSignIn + case noToken + } + + var bearer: Bearer? + + let baseURL = URL(string: "https://lambdagigapi.herokuapp.com/api")! + private lazy var signUpURL = baseURL.appendingPathComponent("/users/signup") + private lazy var signInURL = baseURL.appendingPathComponent("/users/login") + + + + func signUp(with user: User, completion: @escaping (Result) -> Void) { + print("signUpURL = \(signUpURL.absoluteString)") + + var request = postRequest(for: signUpURL) + + do { + let jsonData = try JSONEncoder().encode(user) + print(String(data: jsonData, encoding: .utf8)!) + request.httpBody = jsonData + + let task = URLSession.shared.dataTask(with: request) { (_, response, error) in + if let error = error { + print("Sign up failed with error: \(error)") + completion(.failure(.failedSignUp)) + return + } + + guard let response = response as? HTTPURLResponse, + response.statusCode == 200 else { + print("Sign up was unsuccessful") + completion(.failure(.failedSignUp)) + return + } + + completion(.success(true)) + } + task.resume() + } catch { + print("Error encoding user: \(error)") + completion(.failure(.failedSignUp)) + return + } + + } + private func postRequest(for url: URL) -> URLRequest { + var request = URLRequest(url: url) + request.httpMethod = HTTPMethod.post.rawValue + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + return request + } + + func signIn(with user: User, completion: @escaping (Result) -> Void) { + var request = postRequest(for: signInURL) + do { + let jsonData = try JSONEncoder().encode(user) + request.httpBody = jsonData + let task = URLSession.shared.dataTask(with: request) { (data, response, error) in + if let error = error { + print("Sign in failed with error: \(error)") + completion(.failure(.failedSignIn)) + return + } + guard let response = response as? HTTPURLResponse, + response.statusCode == 200 else { + print("Sign in was unsuccessful") + completion(.failure(.failedSignIn)) + return + } + guard let data = data else { + print("Data was not received") + completion(.failure(.nodata)) + return + } + do { + self.bearer = try JSONDecoder().decode(Bearer.self, from: data) + completion(.success(true)) + } catch { + print("Error decoding bearer: \(error)") + completion(.failure(.noToken)) + } + } + task.resume() + } catch { + print("Error encoding user: \(error.localizedDescription)") + completion(.failure(.failedSignIn)) + } + } + + } + + + + + + + + + + diff --git a/iosGigsProject/iosGigsProject/Info.plist b/iosGigsProject/iosGigsProject/Info.plist new file mode 100644 index 00000000..2a3483c0 --- /dev/null +++ b/iosGigsProject/iosGigsProject/Info.plist @@ -0,0 +1,64 @@ + + + + + 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 + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/iosGigsProject/iosGigsProject/Models/Bearer.swift b/iosGigsProject/iosGigsProject/Models/Bearer.swift new file mode 100644 index 00000000..b814ba2d --- /dev/null +++ b/iosGigsProject/iosGigsProject/Models/Bearer.swift @@ -0,0 +1,13 @@ +// +// Bearer.swift +// iosGigsProject +// +// Created by B$hady on 7/12/20. +// Copyright © 2020 Lambda. All rights reserved. +// + +import Foundation + +struct Bearer: Codable { + let token: String +} diff --git a/iosGigsProject/iosGigsProject/Models/User.swift b/iosGigsProject/iosGigsProject/Models/User.swift new file mode 100644 index 00000000..c5977523 --- /dev/null +++ b/iosGigsProject/iosGigsProject/Models/User.swift @@ -0,0 +1,14 @@ +// +// User.swift +// iosGigsProject +// +// Created by B$hady on 7/14/20. +// Copyright © 2020 Lambda. All rights reserved. +// + +import Foundation + +struct User: Codable { + let username: String + let password: String +} diff --git a/iosGigsProject/iosGigsProject/Resources/AppDelegate.swift b/iosGigsProject/iosGigsProject/Resources/AppDelegate.swift new file mode 100644 index 00000000..c65345d9 --- /dev/null +++ b/iosGigsProject/iosGigsProject/Resources/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// iosGigsProject +// +// Created by B$hady on 7/12/20. +// Copyright © 2020 Lambda. 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/iosGigsProject/iosGigsProject/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/iosGigsProject/iosGigsProject/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9221b9bb --- /dev/null +++ b/iosGigsProject/iosGigsProject/Resources/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/iosGigsProject/iosGigsProject/Resources/Assets.xcassets/Contents.json b/iosGigsProject/iosGigsProject/Resources/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/iosGigsProject/iosGigsProject/Resources/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iosGigsProject/iosGigsProject/Resources/SceneDelegate.swift b/iosGigsProject/iosGigsProject/Resources/SceneDelegate.swift new file mode 100644 index 00000000..0f5758bc --- /dev/null +++ b/iosGigsProject/iosGigsProject/Resources/SceneDelegate.swift @@ -0,0 +1,53 @@ +// +// SceneDelegate.swift +// iosGigsProject +// +// Created by B$hady on 7/12/20. +// Copyright © 2020 Lambda. All rights reserved. +// + +import UIKit + +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). + guard let _ = (scene as? UIWindowScene) else { return } + } + + 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/iosGigsProject/iosGigsProject/Views/GigsTableViewController.swift b/iosGigsProject/iosGigsProject/Views/GigsTableViewController.swift new file mode 100644 index 00000000..e6643faa --- /dev/null +++ b/iosGigsProject/iosGigsProject/Views/GigsTableViewController.swift @@ -0,0 +1,49 @@ +// +// GigsTableViewController.swift +// iosGigsProject +// +// Created by B$hady on 7/12/20. +// Copyright © 2020 Lambda. All rights reserved. +// + +import UIKit + +class GigsTableViewController: UITableViewController { + + let gigControlla = GigController() + + + override func viewDidLoad() { + super.viewDidLoad() + } + + override func viewDidAppear(_ animated: Bool) { + if gigControlla.bearer == nil { + performSegue(withIdentifier: "signUpSegue", sender: self) + } else { + // TODO: fetch gigs here + } + } + + // MARK: - Table view data source + + override func numberOfSections(in tableView: UITableView) -> Int { + // #warning Incomplete implementation, return the number of sections + return 0 + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "gigCell", for: indexPath) + + + return cell + } + + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + if segue.identifier == "signUpSegue" { + if let loginVC = segue.destination as? LoginViewController { + loginVC.gigController = gigControlla + } + } + } +} diff --git a/iosGigsProject/iosGigsProject/Views/LoginViewController.swift b/iosGigsProject/iosGigsProject/Views/LoginViewController.swift new file mode 100644 index 00000000..a5fc2c0c --- /dev/null +++ b/iosGigsProject/iosGigsProject/Views/LoginViewController.swift @@ -0,0 +1,100 @@ +// +// LoginViewController.swift +// iosGigsProject +// +// Created by B$hady on 7/12/20. +// Copyright © 2020 Lambda. All rights reserved. +// + +import UIKit + +class LoginViewController: UIViewController { + + enum LoginType { + case signUp + case signIn + } + + var gigController: GigController? + var loginType = LoginType.signUp + + @IBOutlet weak var segmentedController: UISegmentedControl! + @IBOutlet weak var usernameTextField: UITextField! + @IBOutlet weak var passwordTextField: UITextField! + @IBOutlet weak var signInLogInButton: UIButton! + + + override func viewDidLoad() { + super.viewDidLoad() + signInLogInButton.layer.cornerRadius = 8 + // Do any additional setup after loading the view. + } + + @IBAction func signInLogInSegmentedControl(_ sender: UISegmentedControl) { + if sender.selectedSegmentIndex == 0 { + loginType = .signUp + signInLogInButton.setTitle("Sign Up", for: .normal) + } else { + loginType = .signIn + signInLogInButton.setTitle("Sign In", for: .normal) + } + } + + + @IBAction func signInLogInButtonTapped(_ sender: Any) { + if let username = usernameTextField.text, + !username.isEmpty, + let password = passwordTextField.text, + !password.isEmpty { + let user = User(username: username, password: password) + switch loginType { + case .signUp: + gigController?.signUp(with: user, completion: { (result) in + do { + let success = try result.get() + if success { + DispatchQueue.main.async { + let alertController = UIAlertController(title: "Sign up successful!", message: "Please log in.", preferredStyle: .alert) + let alertAction = UIAlertAction(title: "OK", style: .default, handler: nil) + alertController.addAction(alertAction) + self.present(alertController, animated: true) { + self.loginType = .signIn + self.segmentedController.selectedSegmentIndex = 1 + self.signInLogInButton.setTitle("Sign In", for: .normal) + } + } + } + } catch { + print("Error signing up: \(error)") + } + }) + case .signIn: + gigController?.signIn(with: user, completion: { (result) in + do { + let success = try result.get() + if success { + DispatchQueue.main.async { + self.dismiss(animated: true, completion: nil) + + } + } + } catch { + if let error = error as? GigController.NetworkError { + switch error { + case .failedSignIn: + print("Sign in failed") + case .nodata, .noToken: + print("No data received") + default: + print("Other error occurred") + } + } + } + }) + } + } + } + + } + +