Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added Poll/.DS_Store
Binary file not shown.
413 changes: 413 additions & 0 deletions Poll/Poll.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Poll.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
9 changes: 9 additions & 0 deletions Poll/Poll/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

}

23 changes: 23 additions & 0 deletions Poll/Poll/Models/PollingTabBarController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import UIKit

class PollingTabBarController: UITabBarController {

let voteController = VoteController()


override func viewDidLoad() {
super.viewDidLoad()

passVoteControllerToChildViewControllers()
}

func passVoteControllerToChildViewControllers() {

guard let viewControllers = self.viewControllers else { return }
for i in viewControllers {
if var viewController = i as? VoteControllerProtocol {
viewController.voteController = self.voteController
}
}
}
}
11 changes: 11 additions & 0 deletions Poll/Poll/Models/Vote.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import UIKit

class Vote {
var name: String
var response: String

init(name: String, response: String) {
self.name = name
self.response = response
}
}
19 changes: 19 additions & 0 deletions Poll/Poll/Models/VoteController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import UIKit

class VoteController {

//DO C.R.U.D. HERE


// READ
var votes: [Vote] = []


//CREATE
func createNewVote(name: String, response: String) -> Vote {

let newVote = Vote(name: name, response: response)
votes.append(newVote)
return newVote
}
}
5 changes: 5 additions & 0 deletions Poll/Poll/Models/VoteControllerProtocol.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import UIKit

protocol VoteControllerProtocol {
var voteController: VoteController? { get set }
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
6 changes: 6 additions & 0 deletions Poll/Poll/Resources/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
25 changes: 25 additions & 0 deletions Poll/Poll/Resources/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
45 changes: 45 additions & 0 deletions Poll/Poll/Resources/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
70 changes: 70 additions & 0 deletions Poll/Poll/Storyboards/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="2iU-AX-O9c">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Polling Tab Bar Controller-->
<scene sceneID="nOF-Ny-a1O">
<objects>
<tabBarController id="2iU-AX-O9c" customClass="PollingTabBarController" customModule="Poll" customModuleProvider="target" sceneMemberID="viewController">
<tabBar key="tabBar" contentMode="scaleAspectFit" insetsLayoutMarginsFromSafeArea="NO" translucent="NO" itemPositioning="fill" id="b18-8g-hhD">
<rect key="frame" x="0.0" y="0.0" width="375" height="49"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="tintColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="selectedImageTintColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tabBar>
<connections>
<segue destination="X1q-bI-scI" kind="relationship" relationship="viewControllers" id="SdN-s3-HUa"/>
<segue destination="HeK-eF-2it" kind="relationship" relationship="viewControllers" id="tkM-pZ-HcJ"/>
<segue destination="bI7-ss-ydH" kind="relationship" relationship="viewControllers" id="RVo-oL-l6N"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="HhT-ZH-WFK" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-118" y="45"/>
</scene>
<!--Voting-->
<scene sceneID="A9x-Wh-NhC">
<objects>
<viewControllerPlaceholder storyboardIdentifier="Voting" storyboardName="Voting" id="X1q-bI-scI" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Vote" image="Vote" id="AEk-aB-SP7">
<color key="badgeColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tabBarItem>
</viewControllerPlaceholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="6a1-Hw-Wsi" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="603" y="-181"/>
</scene>
<!--Results-->
<scene sceneID="DGK-VA-vd6">
<objects>
<viewControllerPlaceholder storyboardIdentifier="Results" storyboardName="Results" id="HeK-eF-2it" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Results" image="results" id="nqa-y8-V2l"/>
</viewControllerPlaceholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="eiw-TR-5pj" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="607" y="44"/>
</scene>
<!--Combined-->
<scene sceneID="RF3-SI-fXO">
<objects>
<viewControllerPlaceholder storyboardIdentifier="Combined" storyboardName="Combined" id="bI7-ss-ydH" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Combined" image="combined" id="brn-sZ-r5N"/>
</viewControllerPlaceholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ybj-DR-2ha" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="621" y="277"/>
</scene>
</scenes>
<resources>
<image name="Vote" width="16" height="16"/>
<image name="combined" width="16" height="16"/>
<image name="results" width="16" height="16"/>
</resources>
</document>
Loading