diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..a010bc1 Binary files /dev/null and b/.DS_Store differ diff --git a/Poll.xcodeproj/project.pbxproj b/Poll.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e972d69 --- /dev/null +++ b/Poll.xcodeproj/project.pbxproj @@ -0,0 +1,383 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 9614A8EE21388F760060C2E0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9614A8ED21388F760060C2E0 /* AppDelegate.swift */; }; + 9614A8F321388F760060C2E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9614A8F121388F760060C2E0 /* Main.storyboard */; }; + 9614A8F521388F760060C2E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9614A8F421388F760060C2E0 /* Assets.xcassets */; }; + 9614A8F821388F760060C2E0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9614A8F621388F760060C2E0 /* LaunchScreen.storyboard */; }; + 9614A9002138907F0060C2E0 /* Vote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9614A8FF2138907F0060C2E0 /* Vote.swift */; }; + 9614A902213890B50060C2E0 /* VoteController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9614A901213890B50060C2E0 /* VoteController.swift */; }; + 9614A905213891ED0060C2E0 /* PollTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9614A904213891ED0060C2E0 /* PollTabBarController.swift */; }; + 9614A907213892230060C2E0 /* Voting.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9614A906213892230060C2E0 /* Voting.storyboard */; }; + 9614A9092138949E0060C2E0 /* VotingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9614A9082138949E0060C2E0 /* VotingViewController.swift */; }; + 9614A90B2138955A0060C2E0 /* Results.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9614A90A2138955A0060C2E0 /* Results.storyboard */; }; + 9614A90D2138961B0060C2E0 /* ResultsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9614A90C2138961B0060C2E0 /* ResultsTableViewController.swift */; }; + 9614A90F2138969E0060C2E0 /* Combined.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9614A90E2138969E0060C2E0 /* Combined.storyboard */; }; + 9614A911213897A50060C2E0 /* CombinedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9614A910213897A50060C2E0 /* CombinedViewController.swift */; }; + 96CD7C842138A5A5004DA204 /* VoteControllerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CD7C832138A5A5004DA204 /* VoteControllerProtocol.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 9614A8EA21388F760060C2E0 /* Poll.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Poll.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9614A8ED21388F760060C2E0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 9614A8F221388F760060C2E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 9614A8F421388F760060C2E0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 9614A8F721388F760060C2E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 9614A8F921388F760060C2E0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9614A8FF2138907F0060C2E0 /* Vote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vote.swift; sourceTree = ""; }; + 9614A901213890B50060C2E0 /* VoteController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteController.swift; sourceTree = ""; }; + 9614A904213891ED0060C2E0 /* PollTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollTabBarController.swift; sourceTree = ""; }; + 9614A906213892230060C2E0 /* Voting.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Voting.storyboard; sourceTree = ""; }; + 9614A9082138949E0060C2E0 /* VotingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VotingViewController.swift; sourceTree = ""; }; + 9614A90A2138955A0060C2E0 /* Results.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Results.storyboard; sourceTree = ""; }; + 9614A90C2138961B0060C2E0 /* ResultsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultsTableViewController.swift; sourceTree = ""; }; + 9614A90E2138969E0060C2E0 /* Combined.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Combined.storyboard; sourceTree = ""; }; + 9614A910213897A50060C2E0 /* CombinedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombinedViewController.swift; sourceTree = ""; }; + 96CD7C832138A5A5004DA204 /* VoteControllerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteControllerProtocol.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9614A8E721388F760060C2E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9614A8E121388F760060C2E0 = { + isa = PBXGroup; + children = ( + 9614A8EC21388F760060C2E0 /* Poll */, + 9614A8EB21388F760060C2E0 /* Products */, + ); + sourceTree = ""; + }; + 9614A8EB21388F760060C2E0 /* Products */ = { + isa = PBXGroup; + children = ( + 9614A8EA21388F760060C2E0 /* Poll.app */, + ); + name = Products; + sourceTree = ""; + }; + 9614A8EC21388F760060C2E0 /* Poll */ = { + isa = PBXGroup; + children = ( + 9614A8ED21388F760060C2E0 /* AppDelegate.swift */, + 9614A903213891470060C2E0 /* Model+ModelController */, + 9614A904213891ED0060C2E0 /* PollTabBarController.swift */, + 9614A8F121388F760060C2E0 /* Main.storyboard */, + 9614A906213892230060C2E0 /* Voting.storyboard */, + 9614A9082138949E0060C2E0 /* VotingViewController.swift */, + 9614A90A2138955A0060C2E0 /* Results.storyboard */, + 9614A90C2138961B0060C2E0 /* ResultsTableViewController.swift */, + 9614A90E2138969E0060C2E0 /* Combined.storyboard */, + 9614A910213897A50060C2E0 /* CombinedViewController.swift */, + 9614A8F421388F760060C2E0 /* Assets.xcassets */, + 9614A8F621388F760060C2E0 /* LaunchScreen.storyboard */, + 9614A8F921388F760060C2E0 /* Info.plist */, + ); + path = Poll; + sourceTree = ""; + }; + 9614A903213891470060C2E0 /* Model+ModelController */ = { + isa = PBXGroup; + children = ( + 9614A8FF2138907F0060C2E0 /* Vote.swift */, + 9614A901213890B50060C2E0 /* VoteController.swift */, + 96CD7C832138A5A5004DA204 /* VoteControllerProtocol.swift */, + ); + path = "Model+ModelController"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 9614A8E921388F760060C2E0 /* Poll */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9614A8FC21388F760060C2E0 /* Build configuration list for PBXNativeTarget "Poll" */; + buildPhases = ( + 9614A8E621388F760060C2E0 /* Sources */, + 9614A8E721388F760060C2E0 /* Frameworks */, + 9614A8E821388F760060C2E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Poll; + productName = Poll; + productReference = 9614A8EA21388F760060C2E0 /* Poll.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9614A8E221388F760060C2E0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0940; + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "Jason Modisett"; + TargetAttributes = { + 9614A8E921388F760060C2E0 = { + CreatedOnToolsVersion = 9.4.1; + }; + }; + }; + buildConfigurationList = 9614A8E521388F760060C2E0 /* Build configuration list for PBXProject "Poll" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 9614A8E121388F760060C2E0; + productRefGroup = 9614A8EB21388F760060C2E0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 9614A8E921388F760060C2E0 /* Poll */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 9614A8E821388F760060C2E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9614A8F821388F760060C2E0 /* LaunchScreen.storyboard in Resources */, + 9614A90B2138955A0060C2E0 /* Results.storyboard in Resources */, + 9614A8F521388F760060C2E0 /* Assets.xcassets in Resources */, + 9614A8F321388F760060C2E0 /* Main.storyboard in Resources */, + 9614A907213892230060C2E0 /* Voting.storyboard in Resources */, + 9614A90F2138969E0060C2E0 /* Combined.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 9614A8E621388F760060C2E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9614A90D2138961B0060C2E0 /* ResultsTableViewController.swift in Sources */, + 9614A905213891ED0060C2E0 /* PollTabBarController.swift in Sources */, + 9614A911213897A50060C2E0 /* CombinedViewController.swift in Sources */, + 96CD7C842138A5A5004DA204 /* VoteControllerProtocol.swift in Sources */, + 9614A902213890B50060C2E0 /* VoteController.swift in Sources */, + 9614A9002138907F0060C2E0 /* Vote.swift in Sources */, + 9614A8EE21388F760060C2E0 /* AppDelegate.swift in Sources */, + 9614A9092138949E0060C2E0 /* VotingViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 9614A8F121388F760060C2E0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9614A8F221388F760060C2E0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 9614A8F621388F760060C2E0 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9614A8F721388F760060C2E0 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 9614A8FA21388F760060C2E0 /* 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; + CODE_SIGN_IDENTITY = "iPhone Developer"; + 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 9614A8FB21388F760060C2E0 /* 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; + CODE_SIGN_IDENTITY = "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 = 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 9614A8FD21388F760060C2E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 7LHTMK9AWG; + INFOPLIST_FILE = Poll/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.jasonmodisett.Poll; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 9614A8FE21388F760060C2E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 7LHTMK9AWG; + INFOPLIST_FILE = Poll/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.jasonmodisett.Poll; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 9614A8E521388F760060C2E0 /* Build configuration list for PBXProject "Poll" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9614A8FA21388F760060C2E0 /* Debug */, + 9614A8FB21388F760060C2E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9614A8FC21388F760060C2E0 /* Build configuration list for PBXNativeTarget "Poll" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9614A8FD21388F760060C2E0 /* Debug */, + 9614A8FE21388F760060C2E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 9614A8E221388F760060C2E0 /* Project object */; +} diff --git a/Poll.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Poll.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9d02d16 --- /dev/null +++ b/Poll.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Poll.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Poll.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Poll.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Poll.xcodeproj/project.xcworkspace/xcuserdata/jason.xcuserdatad/UserInterfaceState.xcuserstate b/Poll.xcodeproj/project.xcworkspace/xcuserdata/jason.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..a44eccb Binary files /dev/null and b/Poll.xcodeproj/project.xcworkspace/xcuserdata/jason.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Poll.xcodeproj/xcuserdata/jason.xcuserdatad/xcschemes/xcschememanagement.plist b/Poll.xcodeproj/xcuserdata/jason.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..aecce71 --- /dev/null +++ b/Poll.xcodeproj/xcuserdata/jason.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Poll.xcscheme + + orderHint + 0 + + + + diff --git a/Poll/.DS_Store b/Poll/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/Poll/.DS_Store differ diff --git a/Poll/AppDelegate.swift b/Poll/AppDelegate.swift new file mode 100644 index 0000000..7f44f38 --- /dev/null +++ b/Poll/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Poll +// +// Created by Jason Modisett on 8/30/18. +// Copyright © 2018 Jason Modisett. 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/Poll/Assets.xcassets/AppIcon.appiconset/Contents.json b/Poll/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/Poll/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Poll/Assets.xcassets/Contents.json b/Poll/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Poll/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Poll/Base.lproj/LaunchScreen.storyboard b/Poll/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/Poll/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/Base.lproj/Main.storyboard b/Poll/Base.lproj/Main.storyboard new file mode 100644 index 0000000..c2e961f --- /dev/null +++ b/Poll/Base.lproj/Main.storyboard @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/Combined.storyboard b/Poll/Combined.storyboard new file mode 100644 index 0000000..c12018a --- /dev/null +++ b/Poll/Combined.storyboard @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/CombinedViewController.swift b/Poll/CombinedViewController.swift new file mode 100644 index 0000000..ac5fc6a --- /dev/null +++ b/Poll/CombinedViewController.swift @@ -0,0 +1,25 @@ +// +// CombinedViewController.swift +// Poll +// +// Created by Jason Modisett on 8/30/18. +// Copyright © 2018 Jason Modisett. All rights reserved. +// + +import UIKit + +class CombinedViewController: UIViewController, VoteControllerProtocol { + + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + if segue.identifier == "Voting" { + guard let destinationVC = segue.destination as? VoteControllerProtocol else { return } + destinationVC.voteController = voteController + } else if segue.identifier == "Results" { + guard let destinationVC = segue.destination as? VoteControllerProtocol else { return } + destinationVC.voteController = voteController + } + } + + var voteController: VoteController? + +} diff --git a/Poll/Info.plist b/Poll/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/Poll/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Poll/Model+ModelController/Vote.swift b/Poll/Model+ModelController/Vote.swift new file mode 100644 index 0000000..076d474 --- /dev/null +++ b/Poll/Model+ModelController/Vote.swift @@ -0,0 +1,14 @@ +// +// Poll.swift +// Poll +// +// Created by Jason Modisett on 8/30/18. +// Copyright © 2018 Jason Modisett. All rights reserved. +// + +import Foundation + +struct Vote { + let name: String + let response: String +} diff --git a/Poll/Model+ModelController/VoteController.swift b/Poll/Model+ModelController/VoteController.swift new file mode 100644 index 0000000..59dff58 --- /dev/null +++ b/Poll/Model+ModelController/VoteController.swift @@ -0,0 +1,20 @@ +// +// PollController.swift +// Poll +// +// Created by Jason Modisett on 8/30/18. +// Copyright © 2018 Jason Modisett. All rights reserved. +// + +import Foundation + +class VoteController { + + func createVote(name: String, response: String) { + let vote = Vote(name: name, response: response) + votes.append(vote) + } + + var votes: [Vote] = [] + +} diff --git a/Poll/Model+ModelController/VoteControllerProtocol.swift b/Poll/Model+ModelController/VoteControllerProtocol.swift new file mode 100644 index 0000000..57accf0 --- /dev/null +++ b/Poll/Model+ModelController/VoteControllerProtocol.swift @@ -0,0 +1,13 @@ +// +// VoteControllerProtocol.swift +// Poll +// +// Created by Jason Modisett on 8/30/18. +// Copyright © 2018 Jason Modisett. All rights reserved. +// + +import Foundation + +protocol VoteControllerProtocol: class { + var voteController: VoteController? { get set } +} diff --git a/Poll/PollTabBarController.swift b/Poll/PollTabBarController.swift new file mode 100644 index 0000000..055b570 --- /dev/null +++ b/Poll/PollTabBarController.swift @@ -0,0 +1,28 @@ +// +// PollTabBarController.swift +// Poll +// +// Created by Jason Modisett on 8/30/18. +// Copyright © 2018 Jason Modisett. All rights reserved. +// + +import UIKit + +class PollTabBarController: UITabBarController { + + override func viewDidLoad() { + super.viewDidLoad() + passVoteControllerToChildViewControllers() + } + + func passVoteControllerToChildViewControllers() { + for childVC in childViewControllers { + if let childVC = childVC as? VoteControllerProtocol { + childVC.voteController = voteController + } + } + } + + let voteController = VoteController() + +} diff --git a/Poll/Results.storyboard b/Poll/Results.storyboard new file mode 100644 index 0000000..1770f7e --- /dev/null +++ b/Poll/Results.storyboard @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/ResultsTableViewController.swift b/Poll/ResultsTableViewController.swift new file mode 100644 index 0000000..bc12333 --- /dev/null +++ b/Poll/ResultsTableViewController.swift @@ -0,0 +1,37 @@ +// +// ResultsTableViewController.swift +// Poll +// +// Created by Jason Modisett on 8/30/18. +// Copyright © 2018 Jason Modisett. All rights reserved. +// + +import UIKit + +class ResultsTableViewController: UITableViewController, VoteControllerProtocol { + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + tableView.reloadData() + } + + // MARK: - Table view data source + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return voteController?.votes.count ?? 0 + } + + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "VoteCell", for: indexPath) + + let vote = voteController?.votes[indexPath.row] + + cell.textLabel?.text = vote?.name + cell.detailTextLabel?.text = vote?.response + + return cell + } + + var voteController: VoteController? + +} diff --git a/Poll/Voting.storyboard b/Poll/Voting.storyboard new file mode 100644 index 0000000..5fcca31 --- /dev/null +++ b/Poll/Voting.storyboard @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/VotingViewController.swift b/Poll/VotingViewController.swift new file mode 100644 index 0000000..7edfc5b --- /dev/null +++ b/Poll/VotingViewController.swift @@ -0,0 +1,33 @@ +// +// VotingViewController.swift +// Poll +// +// Created by Jason Modisett on 8/30/18. +// Copyright © 2018 Jason Modisett. All rights reserved. +// + +import UIKit + +class VotingViewController: UIViewController, VoteControllerProtocol { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + @IBAction func submitVote(_ sender: Any) { + guard let name = nameTextField.text, + let response = responseTextField.text else { return } + + voteController?.createVote(name: name, response: response) + + view.endEditing(true) + } + + @IBOutlet weak var nameTextField: UITextField! + @IBOutlet weak var responseTextField: UITextField! + + var voteController: VoteController? + +}