From 82de218e6c3428324fa795305d68bf8b1fc1ede9 Mon Sep 17 00:00:00 2001 From: OmegaWulf Date: Thu, 4 Oct 2018 16:03:20 -0400 Subject: [PATCH 1/7] Initial Commit - Project Created --- Poll/Poll.xcodeproj/project.pbxproj | 341 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Poll/Poll/AppDelegate.swift | 46 +++ .../AppIcon.appiconset/Contents.json | 98 +++++ Poll/Poll/Assets.xcassets/Contents.json | 6 + Poll/Poll/Base.lproj/LaunchScreen.storyboard | 25 ++ Poll/Poll/Base.lproj/Main.storyboard | 24 ++ Poll/Poll/Info.plist | 45 +++ Poll/Poll/ViewController.swift | 20 + 10 files changed, 620 insertions(+) create mode 100644 Poll/Poll.xcodeproj/project.pbxproj create mode 100644 Poll/Poll.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Poll/Poll.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Poll/Poll/AppDelegate.swift create mode 100644 Poll/Poll/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Poll/Poll/Assets.xcassets/Contents.json create mode 100644 Poll/Poll/Base.lproj/LaunchScreen.storyboard create mode 100644 Poll/Poll/Base.lproj/Main.storyboard create mode 100644 Poll/Poll/Info.plist create mode 100644 Poll/Poll/ViewController.swift diff --git a/Poll/Poll.xcodeproj/project.pbxproj b/Poll/Poll.xcodeproj/project.pbxproj new file mode 100644 index 0000000..0b0678f --- /dev/null +++ b/Poll/Poll.xcodeproj/project.pbxproj @@ -0,0 +1,341 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 117DA83F2166A922001743D4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA83E2166A922001743D4 /* AppDelegate.swift */; }; + 117DA8412166A922001743D4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8402166A922001743D4 /* ViewController.swift */; }; + 117DA8442166A922001743D4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8422166A922001743D4 /* Main.storyboard */; }; + 117DA8462166A923001743D4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8452166A923001743D4 /* Assets.xcassets */; }; + 117DA8492166A923001743D4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8472166A923001743D4 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 117DA83B2166A922001743D4 /* Poll.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Poll.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 117DA83E2166A922001743D4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 117DA8402166A922001743D4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 117DA8432166A922001743D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 117DA8452166A923001743D4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 117DA8482166A923001743D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 117DA84A2166A923001743D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 117DA8382166A922001743D4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 117DA8322166A922001743D4 = { + isa = PBXGroup; + children = ( + 117DA83D2166A922001743D4 /* Poll */, + 117DA83C2166A922001743D4 /* Products */, + ); + sourceTree = ""; + }; + 117DA83C2166A922001743D4 /* Products */ = { + isa = PBXGroup; + children = ( + 117DA83B2166A922001743D4 /* Poll.app */, + ); + name = Products; + sourceTree = ""; + }; + 117DA83D2166A922001743D4 /* Poll */ = { + isa = PBXGroup; + children = ( + 117DA83E2166A922001743D4 /* AppDelegate.swift */, + 117DA8402166A922001743D4 /* ViewController.swift */, + 117DA8422166A922001743D4 /* Main.storyboard */, + 117DA8452166A923001743D4 /* Assets.xcassets */, + 117DA8472166A923001743D4 /* LaunchScreen.storyboard */, + 117DA84A2166A923001743D4 /* Info.plist */, + ); + path = Poll; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 117DA83A2166A922001743D4 /* Poll */ = { + isa = PBXNativeTarget; + buildConfigurationList = 117DA84D2166A923001743D4 /* Build configuration list for PBXNativeTarget "Poll" */; + buildPhases = ( + 117DA8372166A922001743D4 /* Sources */, + 117DA8382166A922001743D4 /* Frameworks */, + 117DA8392166A922001743D4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Poll; + productName = Poll; + productReference = 117DA83B2166A922001743D4 /* Poll.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 117DA8332166A922001743D4 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1000; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Nikita Thomas"; + TargetAttributes = { + 117DA83A2166A922001743D4 = { + CreatedOnToolsVersion = 10.0; + }; + }; + }; + buildConfigurationList = 117DA8362166A922001743D4 /* Build configuration list for PBXProject "Poll" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 117DA8322166A922001743D4; + productRefGroup = 117DA83C2166A922001743D4 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 117DA83A2166A922001743D4 /* Poll */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 117DA8392166A922001743D4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 117DA8492166A923001743D4 /* LaunchScreen.storyboard in Resources */, + 117DA8462166A923001743D4 /* Assets.xcassets in Resources */, + 117DA8442166A922001743D4 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 117DA8372166A922001743D4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 117DA8412166A922001743D4 /* ViewController.swift in Sources */, + 117DA83F2166A922001743D4 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 117DA8422166A922001743D4 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 117DA8432166A922001743D4 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 117DA8472166A923001743D4 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 117DA8482166A923001743D4 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 117DA84B2166A923001743D4 /* 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 = 12.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 117DA84C2166A923001743D4 /* 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 = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 117DA84E2166A923001743D4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = FXUY9QKNNU; + INFOPLIST_FILE = Poll/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.NikitaThomas.Poll; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 117DA84F2166A923001743D4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = FXUY9QKNNU; + INFOPLIST_FILE = Poll/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.NikitaThomas.Poll; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 117DA8362166A922001743D4 /* Build configuration list for PBXProject "Poll" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 117DA84B2166A923001743D4 /* Debug */, + 117DA84C2166A923001743D4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 117DA84D2166A923001743D4 /* Build configuration list for PBXNativeTarget "Poll" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 117DA84E2166A923001743D4 /* Debug */, + 117DA84F2166A923001743D4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 117DA8332166A922001743D4 /* Project object */; +} diff --git a/Poll/Poll.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Poll/Poll.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9d02d16 --- /dev/null +++ b/Poll/Poll.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Poll/Poll.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Poll/Poll.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Poll/Poll.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Poll/Poll/AppDelegate.swift b/Poll/Poll/AppDelegate.swift new file mode 100644 index 0000000..b4a119c --- /dev/null +++ b/Poll/Poll/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Poll +// +// Created by Nikita Thomas on 10/4/18. +// Copyright © 2018 Nikita Thomas. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: 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/Poll/Assets.xcassets/AppIcon.appiconset/Contents.json b/Poll/Poll/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/Poll/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/Poll/Assets.xcassets/Contents.json b/Poll/Poll/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Poll/Poll/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Poll/Poll/Base.lproj/LaunchScreen.storyboard b/Poll/Poll/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..bfa3612 --- /dev/null +++ b/Poll/Poll/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/Poll/Base.lproj/Main.storyboard b/Poll/Poll/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f1bcf38 --- /dev/null +++ b/Poll/Poll/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/Poll/Info.plist b/Poll/Poll/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/Poll/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/Poll/ViewController.swift b/Poll/Poll/ViewController.swift new file mode 100644 index 0000000..d7ba2a2 --- /dev/null +++ b/Poll/Poll/ViewController.swift @@ -0,0 +1,20 @@ +// +// ViewController.swift +// Poll +// +// Created by Nikita Thomas on 10/4/18. +// Copyright © 2018 Nikita Thomas. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + +} + From af0c991fd1c7673af0f444aff5bfe99472274355 Mon Sep 17 00:00:00 2001 From: OmegaWulf Date: Thu, 4 Oct 2018 16:09:01 -0400 Subject: [PATCH 2/7] Set up model + model controller --- Poll/Poll.xcodeproj/project.pbxproj | 8 ++++++++ Poll/Poll/Vote.swift | 19 +++++++++++++++++++ Poll/Poll/VoteController.swift | 19 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 Poll/Poll/Vote.swift create mode 100644 Poll/Poll/VoteController.swift diff --git a/Poll/Poll.xcodeproj/project.pbxproj b/Poll/Poll.xcodeproj/project.pbxproj index 0b0678f..b603ed7 100644 --- a/Poll/Poll.xcodeproj/project.pbxproj +++ b/Poll/Poll.xcodeproj/project.pbxproj @@ -12,6 +12,8 @@ 117DA8442166A922001743D4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8422166A922001743D4 /* Main.storyboard */; }; 117DA8462166A923001743D4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8452166A923001743D4 /* Assets.xcassets */; }; 117DA8492166A923001743D4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8472166A923001743D4 /* LaunchScreen.storyboard */; }; + 117DA8512166A9FB001743D4 /* Vote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8502166A9FB001743D4 /* Vote.swift */; }; + 117DA8532166AA40001743D4 /* VoteController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8522166AA40001743D4 /* VoteController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -22,6 +24,8 @@ 117DA8452166A923001743D4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 117DA8482166A923001743D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 117DA84A2166A923001743D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 117DA8502166A9FB001743D4 /* Vote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vote.swift; sourceTree = ""; }; + 117DA8522166AA40001743D4 /* VoteController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -57,6 +61,8 @@ 117DA83E2166A922001743D4 /* AppDelegate.swift */, 117DA8402166A922001743D4 /* ViewController.swift */, 117DA8422166A922001743D4 /* Main.storyboard */, + 117DA8502166A9FB001743D4 /* Vote.swift */, + 117DA8522166AA40001743D4 /* VoteController.swift */, 117DA8452166A923001743D4 /* Assets.xcassets */, 117DA8472166A923001743D4 /* LaunchScreen.storyboard */, 117DA84A2166A923001743D4 /* Info.plist */, @@ -136,6 +142,8 @@ buildActionMask = 2147483647; files = ( 117DA8412166A922001743D4 /* ViewController.swift in Sources */, + 117DA8532166AA40001743D4 /* VoteController.swift in Sources */, + 117DA8512166A9FB001743D4 /* Vote.swift in Sources */, 117DA83F2166A922001743D4 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Poll/Poll/Vote.swift b/Poll/Poll/Vote.swift new file mode 100644 index 0000000..76e8a3b --- /dev/null +++ b/Poll/Poll/Vote.swift @@ -0,0 +1,19 @@ +// +// Vote.swift +// Poll +// +// Created by Nikita Thomas on 10/4/18. +// Copyright © 2018 Nikita Thomas. All rights reserved. +// + +import Foundation + +class Vote { + var name: String + var response: String + + init(name: String, response: String) { + self.name = name + self.response = response + } +} diff --git a/Poll/Poll/VoteController.swift b/Poll/Poll/VoteController.swift new file mode 100644 index 0000000..1387c6d --- /dev/null +++ b/Poll/Poll/VoteController.swift @@ -0,0 +1,19 @@ +// +// VoteController.swift +// Poll +// +// Created by Nikita Thomas on 10/4/18. +// Copyright © 2018 Nikita Thomas. All rights reserved. +// + +import Foundation + +class VoteController { + + var votes = [Vote]() + + func create(name: String, response: String) { + let vote = Vote(name: name, response: response) + votes.append(vote) + } +} From fde6c12c4417a22ef09466171389971c61b89064 Mon Sep 17 00:00:00 2001 From: OmegaWulf Date: Thu, 4 Oct 2018 16:45:33 -0400 Subject: [PATCH 3/7] set up storyboards --- Poll/Poll.xcodeproj/project.pbxproj | 32 +++++++- Poll/Poll/Base.lproj/Main.storyboard | 65 +++++++++++---- Poll/Poll/Combined.storyboard | 68 ++++++++++++++++ Poll/Poll/CombinedViewController.swift | 30 +++++++ Poll/Poll/PollingTabBarViewController.swift | 30 +++++++ Poll/Poll/Results.storyboard | 56 +++++++++++++ Poll/Poll/ResultsTableViewController.swift | 90 +++++++++++++++++++++ Poll/Poll/ViewController.swift | 20 ----- Poll/Poll/Voting.storyboard | 77 ++++++++++++++++++ Poll/Poll/VotingViewController.swift | 41 ++++++++++ 10 files changed, 471 insertions(+), 38 deletions(-) create mode 100644 Poll/Poll/Combined.storyboard create mode 100644 Poll/Poll/CombinedViewController.swift create mode 100644 Poll/Poll/PollingTabBarViewController.swift create mode 100644 Poll/Poll/Results.storyboard create mode 100644 Poll/Poll/ResultsTableViewController.swift delete mode 100644 Poll/Poll/ViewController.swift create mode 100644 Poll/Poll/Voting.storyboard create mode 100644 Poll/Poll/VotingViewController.swift diff --git a/Poll/Poll.xcodeproj/project.pbxproj b/Poll/Poll.xcodeproj/project.pbxproj index b603ed7..1b56f0c 100644 --- a/Poll/Poll.xcodeproj/project.pbxproj +++ b/Poll/Poll.xcodeproj/project.pbxproj @@ -8,24 +8,36 @@ /* Begin PBXBuildFile section */ 117DA83F2166A922001743D4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA83E2166A922001743D4 /* AppDelegate.swift */; }; - 117DA8412166A922001743D4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8402166A922001743D4 /* ViewController.swift */; }; 117DA8442166A922001743D4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8422166A922001743D4 /* Main.storyboard */; }; 117DA8462166A923001743D4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8452166A923001743D4 /* Assets.xcassets */; }; 117DA8492166A923001743D4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8472166A923001743D4 /* LaunchScreen.storyboard */; }; 117DA8512166A9FB001743D4 /* Vote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8502166A9FB001743D4 /* Vote.swift */; }; 117DA8532166AA40001743D4 /* VoteController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8522166AA40001743D4 /* VoteController.swift */; }; + 117DA8552166AB06001743D4 /* Voting.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8542166AB06001743D4 /* Voting.storyboard */; }; + 117DA8572166ABA4001743D4 /* VotingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8562166ABA4001743D4 /* VotingViewController.swift */; }; + 117DA8592166AC1B001743D4 /* Results.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA8582166AC1B001743D4 /* Results.storyboard */; }; + 117DA85B2166AC54001743D4 /* ResultsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA85A2166AC54001743D4 /* ResultsTableViewController.swift */; }; + 117DA85D2166AC80001743D4 /* Combined.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA85C2166AC80001743D4 /* Combined.storyboard */; }; + 117DA85F2166AD8F001743D4 /* CombinedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA85E2166AD8F001743D4 /* CombinedViewController.swift */; }; + 117DA8612166B105001743D4 /* PollingTabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8602166B105001743D4 /* PollingTabBarViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 117DA83B2166A922001743D4 /* Poll.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Poll.app; sourceTree = BUILT_PRODUCTS_DIR; }; 117DA83E2166A922001743D4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 117DA8402166A922001743D4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 117DA8432166A922001743D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 117DA8452166A923001743D4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 117DA8482166A923001743D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 117DA84A2166A923001743D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 117DA8502166A9FB001743D4 /* Vote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vote.swift; sourceTree = ""; }; 117DA8522166AA40001743D4 /* VoteController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteController.swift; sourceTree = ""; }; + 117DA8542166AB06001743D4 /* Voting.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Voting.storyboard; sourceTree = ""; }; + 117DA8562166ABA4001743D4 /* VotingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VotingViewController.swift; sourceTree = ""; }; + 117DA8582166AC1B001743D4 /* Results.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Results.storyboard; sourceTree = ""; }; + 117DA85A2166AC54001743D4 /* ResultsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultsTableViewController.swift; sourceTree = ""; }; + 117DA85C2166AC80001743D4 /* Combined.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Combined.storyboard; sourceTree = ""; }; + 117DA85E2166AD8F001743D4 /* CombinedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombinedViewController.swift; sourceTree = ""; }; + 117DA8602166B105001743D4 /* PollingTabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollingTabBarViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -59,8 +71,14 @@ isa = PBXGroup; children = ( 117DA83E2166A922001743D4 /* AppDelegate.swift */, - 117DA8402166A922001743D4 /* ViewController.swift */, 117DA8422166A922001743D4 /* Main.storyboard */, + 117DA8602166B105001743D4 /* PollingTabBarViewController.swift */, + 117DA8542166AB06001743D4 /* Voting.storyboard */, + 117DA8562166ABA4001743D4 /* VotingViewController.swift */, + 117DA8582166AC1B001743D4 /* Results.storyboard */, + 117DA85C2166AC80001743D4 /* Combined.storyboard */, + 117DA85E2166AD8F001743D4 /* CombinedViewController.swift */, + 117DA85A2166AC54001743D4 /* ResultsTableViewController.swift */, 117DA8502166A9FB001743D4 /* Vote.swift */, 117DA8522166AA40001743D4 /* VoteController.swift */, 117DA8452166A923001743D4 /* Assets.xcassets */, @@ -129,8 +147,11 @@ buildActionMask = 2147483647; files = ( 117DA8492166A923001743D4 /* LaunchScreen.storyboard in Resources */, + 117DA8592166AC1B001743D4 /* Results.storyboard in Resources */, 117DA8462166A923001743D4 /* Assets.xcassets in Resources */, 117DA8442166A922001743D4 /* Main.storyboard in Resources */, + 117DA8552166AB06001743D4 /* Voting.storyboard in Resources */, + 117DA85D2166AC80001743D4 /* Combined.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -141,10 +162,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 117DA8412166A922001743D4 /* ViewController.swift in Sources */, + 117DA85B2166AC54001743D4 /* ResultsTableViewController.swift in Sources */, + 117DA85F2166AD8F001743D4 /* CombinedViewController.swift in Sources */, 117DA8532166AA40001743D4 /* VoteController.swift in Sources */, 117DA8512166A9FB001743D4 /* Vote.swift in Sources */, 117DA83F2166A922001743D4 /* AppDelegate.swift in Sources */, + 117DA8572166ABA4001743D4 /* VotingViewController.swift in Sources */, + 117DA8612166B105001743D4 /* PollingTabBarViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Poll/Poll/Base.lproj/Main.storyboard b/Poll/Poll/Base.lproj/Main.storyboard index f1bcf38..2ae280e 100644 --- a/Poll/Poll/Base.lproj/Main.storyboard +++ b/Poll/Poll/Base.lproj/Main.storyboard @@ -1,24 +1,61 @@ - + + + + - - + - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/Poll/Combined.storyboard b/Poll/Poll/Combined.storyboard new file mode 100644 index 0000000..6e2d186 --- /dev/null +++ b/Poll/Poll/Combined.storyboard @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/Poll/CombinedViewController.swift b/Poll/Poll/CombinedViewController.swift new file mode 100644 index 0000000..6f23480 --- /dev/null +++ b/Poll/Poll/CombinedViewController.swift @@ -0,0 +1,30 @@ +// +// CombinedViewController.swift +// Poll +// +// Created by Nikita Thomas on 10/4/18. +// Copyright © 2018 Nikita Thomas. All rights reserved. +// + +import UIKit + +class CombinedViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + + /* + // 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.destination. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/Poll/Poll/PollingTabBarViewController.swift b/Poll/Poll/PollingTabBarViewController.swift new file mode 100644 index 0000000..0c96d3b --- /dev/null +++ b/Poll/Poll/PollingTabBarViewController.swift @@ -0,0 +1,30 @@ +// +// PollingTabBarViewController.swift +// Poll +// +// Created by Nikita Thomas on 10/4/18. +// Copyright © 2018 Nikita Thomas. All rights reserved. +// + +import UIKit + +class PollingTabBarViewController: UITabBarController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + + /* + // 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.destination. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/Poll/Poll/Results.storyboard b/Poll/Poll/Results.storyboard new file mode 100644 index 0000000..1ecfce2 --- /dev/null +++ b/Poll/Poll/Results.storyboard @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/Poll/ResultsTableViewController.swift b/Poll/Poll/ResultsTableViewController.swift new file mode 100644 index 0000000..4339be1 --- /dev/null +++ b/Poll/Poll/ResultsTableViewController.swift @@ -0,0 +1,90 @@ +// +// ResultsTableViewController.swift +// Poll +// +// Created by Nikita Thomas on 10/4/18. +// Copyright © 2018 Nikita Thomas. All rights reserved. +// + +import UIKit + +class ResultsTableViewController: UITableViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Uncomment the following line to preserve selection between presentations + // self.clearsSelectionOnViewWillAppear = false + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem + } + + // 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, numberOfRowsInSection section: Int) -> Int { + // #warning Incomplete implementation, return the number of rows + return 0 + } + + /* + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) + + // Configure the cell... + + return cell + } + */ + + /* + // Override to support conditional editing of the table view. + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + */ + + /* + // Override to support editing the table view. + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + // Delete the row from the data source + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } + } + */ + + /* + // Override to support rearranging the table view. + override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { + + } + */ + + /* + // Override to support conditional rearranging of the table view. + override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the item to be re-orderable. + return true + } + */ + + /* + // 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.destination. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/Poll/Poll/ViewController.swift b/Poll/Poll/ViewController.swift deleted file mode 100644 index d7ba2a2..0000000 --- a/Poll/Poll/ViewController.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ViewController.swift -// Poll -// -// Created by Nikita Thomas on 10/4/18. -// Copyright © 2018 Nikita Thomas. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - -} - diff --git a/Poll/Poll/Voting.storyboard b/Poll/Poll/Voting.storyboard new file mode 100644 index 0000000..5ed1c95 --- /dev/null +++ b/Poll/Poll/Voting.storyboard @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Poll/Poll/VotingViewController.swift b/Poll/Poll/VotingViewController.swift new file mode 100644 index 0000000..754a53b --- /dev/null +++ b/Poll/Poll/VotingViewController.swift @@ -0,0 +1,41 @@ +// +// VotingViewController.swift +// Poll +// +// Created by Nikita Thomas on 10/4/18. +// Copyright © 2018 Nikita Thomas. All rights reserved. +// + +import UIKit + +class VotingViewController: UIViewController { + + @IBOutlet weak var nameField: UITextField! + @IBOutlet weak var responseField: UITextField! + + @IBAction func submitButton(_ sender: Any) { + + } + + + + + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + + /* + // 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.destination. + // Pass the selected object to the new view controller. + } + */ + +} From 3ccfa84369c657024c5a3846205c068235bd38d7 Mon Sep 17 00:00:00 2001 From: OmegaWulf Date: Thu, 4 Oct 2018 16:46:07 -0400 Subject: [PATCH 4/7] fixed TabBarView storyboard --- Poll/Poll/Base.lproj/Main.storyboard | 8 ++++---- Poll/Poll/Combined.storyboard | 3 ++- Poll/Poll/Results.storyboard | 1 + Poll/Poll/Voting.storyboard | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Poll/Poll/Base.lproj/Main.storyboard b/Poll/Poll/Base.lproj/Main.storyboard index 2ae280e..8e082c2 100644 --- a/Poll/Poll/Base.lproj/Main.storyboard +++ b/Poll/Poll/Base.lproj/Main.storyboard @@ -12,7 +12,7 @@ - + @@ -29,8 +29,8 @@ - + @@ -41,7 +41,7 @@ - + @@ -51,7 +51,7 @@ - + diff --git a/Poll/Poll/Combined.storyboard b/Poll/Poll/Combined.storyboard index 6e2d186..4b65ae7 100644 --- a/Poll/Poll/Combined.storyboard +++ b/Poll/Poll/Combined.storyboard @@ -24,7 +24,7 @@ - + @@ -43,6 +43,7 @@ + diff --git a/Poll/Poll/Results.storyboard b/Poll/Poll/Results.storyboard index 1ecfce2..1262d3d 100644 --- a/Poll/Poll/Results.storyboard +++ b/Poll/Poll/Results.storyboard @@ -47,6 +47,7 @@ + diff --git a/Poll/Poll/Voting.storyboard b/Poll/Poll/Voting.storyboard index 5ed1c95..1c66a1e 100644 --- a/Poll/Poll/Voting.storyboard +++ b/Poll/Poll/Voting.storyboard @@ -64,6 +64,7 @@ + From 3f7a1e7ffffd46a7aa01cd7718953b2beea32521 Mon Sep 17 00:00:00 2001 From: OmegaWulf Date: Thu, 4 Oct 2018 17:03:24 -0400 Subject: [PATCH 5/7] Implemented VoteController and VotingViewController --- Poll/Poll.xcodeproj/project.pbxproj | 4 ++++ Poll/Poll/PollingTabBarViewController.swift | 19 +++++++++++++++++-- Poll/Poll/ResultsTableViewController.swift | 9 +++++---- Poll/Poll/VoteControllerProtocol.swift | 13 +++++++++++++ Poll/Poll/VotingViewController.swift | 8 ++++++-- 5 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 Poll/Poll/VoteControllerProtocol.swift diff --git a/Poll/Poll.xcodeproj/project.pbxproj b/Poll/Poll.xcodeproj/project.pbxproj index 1b56f0c..9e459ac 100644 --- a/Poll/Poll.xcodeproj/project.pbxproj +++ b/Poll/Poll.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 117DA85D2166AC80001743D4 /* Combined.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 117DA85C2166AC80001743D4 /* Combined.storyboard */; }; 117DA85F2166AD8F001743D4 /* CombinedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA85E2166AD8F001743D4 /* CombinedViewController.swift */; }; 117DA8612166B105001743D4 /* PollingTabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8602166B105001743D4 /* PollingTabBarViewController.swift */; }; + 117DA8632166B3E4001743D4 /* VoteControllerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 117DA8622166B3E4001743D4 /* VoteControllerProtocol.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -38,6 +39,7 @@ 117DA85C2166AC80001743D4 /* Combined.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Combined.storyboard; sourceTree = ""; }; 117DA85E2166AD8F001743D4 /* CombinedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombinedViewController.swift; sourceTree = ""; }; 117DA8602166B105001743D4 /* PollingTabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollingTabBarViewController.swift; sourceTree = ""; }; + 117DA8622166B3E4001743D4 /* VoteControllerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoteControllerProtocol.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,6 +74,7 @@ children = ( 117DA83E2166A922001743D4 /* AppDelegate.swift */, 117DA8422166A922001743D4 /* Main.storyboard */, + 117DA8622166B3E4001743D4 /* VoteControllerProtocol.swift */, 117DA8602166B105001743D4 /* PollingTabBarViewController.swift */, 117DA8542166AB06001743D4 /* Voting.storyboard */, 117DA8562166ABA4001743D4 /* VotingViewController.swift */, @@ -165,6 +168,7 @@ 117DA85B2166AC54001743D4 /* ResultsTableViewController.swift in Sources */, 117DA85F2166AD8F001743D4 /* CombinedViewController.swift in Sources */, 117DA8532166AA40001743D4 /* VoteController.swift in Sources */, + 117DA8632166B3E4001743D4 /* VoteControllerProtocol.swift in Sources */, 117DA8512166A9FB001743D4 /* Vote.swift in Sources */, 117DA83F2166A922001743D4 /* AppDelegate.swift in Sources */, 117DA8572166ABA4001743D4 /* VotingViewController.swift in Sources */, diff --git a/Poll/Poll/PollingTabBarViewController.swift b/Poll/Poll/PollingTabBarViewController.swift index 0c96d3b..f272f5e 100644 --- a/Poll/Poll/PollingTabBarViewController.swift +++ b/Poll/Poll/PollingTabBarViewController.swift @@ -10,11 +10,26 @@ import UIKit class PollingTabBarViewController: UITabBarController { + + + let voteController = VoteController() + override func viewDidLoad() { super.viewDidLoad() - - // Do any additional setup after loading the view. + + func passVoteControllerToChildViewControllers() { + guard let viewControllers = self.viewControllers else {return} + + for v in viewControllers { + if var viewController = v as? VoteControllerProtocol { + viewController.voteController = self.voteController + } + } + } } + + + /* diff --git a/Poll/Poll/ResultsTableViewController.swift b/Poll/Poll/ResultsTableViewController.swift index 4339be1..ae6c787 100644 --- a/Poll/Poll/ResultsTableViewController.swift +++ b/Poll/Poll/ResultsTableViewController.swift @@ -8,7 +8,9 @@ import UIKit -class ResultsTableViewController: UITableViewController { +class ResultsTableViewController: UITableViewController, VoteControllerProtocol { + var voteController: VoteController? + override func viewDidLoad() { super.viewDidLoad() @@ -29,10 +31,9 @@ class ResultsTableViewController: UITableViewController { override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows - return 0 + return voteController?.votes.count ?? 0 } - /* override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) @@ -40,7 +41,7 @@ class ResultsTableViewController: UITableViewController { return cell } - */ + /* // Override to support conditional editing of the table view. diff --git a/Poll/Poll/VoteControllerProtocol.swift b/Poll/Poll/VoteControllerProtocol.swift new file mode 100644 index 0000000..7f9f6a1 --- /dev/null +++ b/Poll/Poll/VoteControllerProtocol.swift @@ -0,0 +1,13 @@ +// +// VoteControllerProtocol.swift +// Poll +// +// Created by Nikita Thomas on 10/4/18. +// Copyright © 2018 Nikita Thomas. All rights reserved. +// + +import Foundation + +protocol VoteControllerProtocol { + var voteController: VoteController? {get set} +} diff --git a/Poll/Poll/VotingViewController.swift b/Poll/Poll/VotingViewController.swift index 754a53b..db89adb 100644 --- a/Poll/Poll/VotingViewController.swift +++ b/Poll/Poll/VotingViewController.swift @@ -8,13 +8,17 @@ import UIKit -class VotingViewController: UIViewController { +class VotingViewController: UIViewController, VoteControllerProtocol { + var voteController: VoteController? + @IBOutlet weak var nameField: UITextField! @IBOutlet weak var responseField: UITextField! @IBAction func submitButton(_ sender: Any) { - + if let name = nameField.text, let response = responseField.text { + voteController?.create(name: name, response: response) + } } From c933f116d5d09784101d1df5576b952d19e768cb Mon Sep 17 00:00:00 2001 From: OmegaWulf Date: Thu, 4 Oct 2018 17:12:12 -0400 Subject: [PATCH 6/7] Implemented resultsTableViewController --- Poll/Poll/ResultsTableViewController.swift | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Poll/Poll/ResultsTableViewController.swift b/Poll/Poll/ResultsTableViewController.swift index ae6c787..31332b4 100644 --- a/Poll/Poll/ResultsTableViewController.swift +++ b/Poll/Poll/ResultsTableViewController.swift @@ -35,14 +35,20 @@ class ResultsTableViewController: UITableViewController, VoteControllerProtocol } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) - - // Configure the cell... - + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) + let vote = voteController?.votes[indexPath.row] + cell.textLabel?.text = vote?.name + cell.detailTextLabel?.text = vote?.response + return cell } + + override func viewWillAppear(_ animated: Bool) { + tableView.reloadData() + } + /* // Override to support conditional editing of the table view. override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { From 09f60c93e4875e2e4b97ce01b1afcce91a5a2061 Mon Sep 17 00:00:00 2001 From: OmegaWulf Date: Thu, 4 Oct 2018 18:23:20 -0400 Subject: [PATCH 7/7] Project Done --- Poll/Poll/Base.lproj/Main.storyboard | 4 ++-- Poll/Poll/Combined.storyboard | 4 ++-- Poll/Poll/CombinedViewController.swift | 18 ++++++++++++------ Poll/Poll/PollingTabBarViewController.swift | 20 ++++++++++---------- Poll/Poll/Results.storyboard | 4 ++-- Poll/Poll/ResultsTableViewController.swift | 2 +- Poll/Poll/Voting.storyboard | 4 ++-- Poll/Poll/VotingViewController.swift | 20 -------------------- 8 files changed, 31 insertions(+), 45 deletions(-) diff --git a/Poll/Poll/Base.lproj/Main.storyboard b/Poll/Poll/Base.lproj/Main.storyboard index 8e082c2..865daf5 100644 --- a/Poll/Poll/Base.lproj/Main.storyboard +++ b/Poll/Poll/Base.lproj/Main.storyboard @@ -16,7 +16,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/Poll/Poll/Combined.storyboard b/Poll/Poll/Combined.storyboard index 4b65ae7..ef193db 100644 --- a/Poll/Poll/Combined.storyboard +++ b/Poll/Poll/Combined.storyboard @@ -9,10 +9,10 @@ - + - + diff --git a/Poll/Poll/CombinedViewController.swift b/Poll/Poll/CombinedViewController.swift index 6f23480..923c68e 100644 --- a/Poll/Poll/CombinedViewController.swift +++ b/Poll/Poll/CombinedViewController.swift @@ -8,7 +8,9 @@ import UIKit -class CombinedViewController: UIViewController { +class CombinedViewController: UIViewController, VoteControllerProtocol { + var voteController: VoteController? + override func viewDidLoad() { super.viewDidLoad() @@ -17,14 +19,18 @@ class CombinedViewController: UIViewController { } - /* + // 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.destination. - // Pass the selected object to the new view controller. + if segue.identifier == "votingSegue" || segue.identifier == "resultsSegue" { + if var viewDestination = segue.destination as? VoteControllerProtocol { + viewDestination.voteController = voteController + } + + + } + } - */ } diff --git a/Poll/Poll/PollingTabBarViewController.swift b/Poll/Poll/PollingTabBarViewController.swift index f272f5e..38ac4f2 100644 --- a/Poll/Poll/PollingTabBarViewController.swift +++ b/Poll/Poll/PollingTabBarViewController.swift @@ -16,20 +16,20 @@ class PollingTabBarViewController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() + passVoteControllerToChildViewControllers() - func passVoteControllerToChildViewControllers() { - guard let viewControllers = self.viewControllers else {return} - - for v in viewControllers { - if var viewController = v as? VoteControllerProtocol { - viewController.voteController = self.voteController - } - } - } } - + func passVoteControllerToChildViewControllers() { + guard let viewControllers = self.viewControllers else {return} + + for v in viewControllers { + if var viewController = v as? VoteControllerProtocol { + viewController.voteController = self.voteController + } + } + } /* diff --git a/Poll/Poll/Results.storyboard b/Poll/Poll/Results.storyboard index 1262d3d..bd502ce 100644 --- a/Poll/Poll/Results.storyboard +++ b/Poll/Poll/Results.storyboard @@ -8,10 +8,10 @@ - + - + diff --git a/Poll/Poll/ResultsTableViewController.swift b/Poll/Poll/ResultsTableViewController.swift index 31332b4..1f692a8 100644 --- a/Poll/Poll/ResultsTableViewController.swift +++ b/Poll/Poll/ResultsTableViewController.swift @@ -26,7 +26,7 @@ class ResultsTableViewController: UITableViewController, VoteControllerProtocol override func numberOfSections(in tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections - return 0 + return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { diff --git a/Poll/Poll/Voting.storyboard b/Poll/Poll/Voting.storyboard index 1c66a1e..290e12f 100644 --- a/Poll/Poll/Voting.storyboard +++ b/Poll/Poll/Voting.storyboard @@ -9,10 +9,10 @@ - + - + diff --git a/Poll/Poll/VotingViewController.swift b/Poll/Poll/VotingViewController.swift index db89adb..992f6fb 100644 --- a/Poll/Poll/VotingViewController.swift +++ b/Poll/Poll/VotingViewController.swift @@ -20,26 +20,6 @@ class VotingViewController: UIViewController, VoteControllerProtocol { voteController?.create(name: name, response: response) } } - - - - - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view. - } - - - /* - // 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.destination. - // Pass the selected object to the new view controller. - } - */ }