Skip to content

Jonah Bergevin firebase #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
18 changes: 18 additions & 0 deletions Custom Cells/EntryCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import UIKit

class EntryCell: UITableViewCell {
static let resuseIdentifier = "entry cell"

@IBOutlet weak var nameTextField: UITextField!
@IBOutlet weak var cohortTextField: UITextField!

@IBAction func add(_ sender: Any) {
guard let name = nameTextField.text, !name.isEmpty else { return }
let cohort = cohortTextField.text ?? ""
let person = Person(name: name, cohort: cohort)
Model.shared.add(person: person) {}

nameTextField.text = ""
cohortTextField.text = ""
}
}
87 changes: 87 additions & 0 deletions Custom Cells/EntryCell.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="128" id="zyX-ob-202" customClass="EntryCell" customModule="Detail" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="389" height="128"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="zyX-ob-202" id="e7q-mt-Esu">
<rect key="frame" x="0.0" y="0.0" width="389" height="127.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalCentering" translatesAutoresizingMaskIntoConstraints="NO" id="FdC-z6-y9n">
<rect key="frame" x="28" y="19" width="333" height="90"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="OvQ-rg-2oy">
<rect key="frame" x="0.0" y="0.0" width="333" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Name:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1TA-Op-EKK">
<rect key="frame" x="0.0" y="5" width="58" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Name" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="BbN-pk-QEH">
<rect key="frame" x="66" y="0.0" width="267" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="tul-5Z-9mU">
<rect key="frame" x="0.0" y="30" width="333" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cohort:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VEx-7b-DMW">
<rect key="frame" x="0.0" y="5" width="58" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Cohort" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ANR-G5-DeX">
<rect key="frame" x="66" y="0.0" width="267" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<viewLayoutGuide key="safeArea" id="IAu-Fa-dNb"/>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tHa-Ed-MFq">
<rect key="frame" x="0.0" y="60" width="333" height="30"/>
<state key="normal" title="Add"/>
<connections>
<action selector="add:" destination="zyX-ob-202" eventType="touchUpInside" id="B4Q-LS-BdD"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="VEx-7b-DMW" firstAttribute="width" secondItem="1TA-Op-EKK" secondAttribute="width" id="JTD-6R-sbR"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" red="0.93909893134715028" green="0.93909893134715028" blue="0.93909893134715028" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="FdC-z6-y9n" secondAttribute="trailing" constant="8" id="KNV-uL-86P"/>
<constraint firstItem="FdC-z6-y9n" firstAttribute="leading" secondItem="e7q-mt-Esu" secondAttribute="leadingMargin" constant="8" id="Mge-UV-gtq"/>
<constraint firstAttribute="bottomMargin" secondItem="FdC-z6-y9n" secondAttribute="bottom" constant="8" id="cTZ-8f-Q39"/>
<constraint firstItem="FdC-z6-y9n" firstAttribute="top" secondItem="e7q-mt-Esu" secondAttribute="topMargin" constant="8" id="rld-vy-8uD"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="cohortTextField" destination="ANR-G5-DeX" id="fOm-1e-BPt"/>
<outlet property="nameTextField" destination="BbN-pk-QEH" id="HzO-hP-tTt"/>
</connections>
<point key="canvasLocation" x="160.80000000000001" y="136.73163418290855"/>
</tableViewCell>
</objects>
</document>
17 changes: 17 additions & 0 deletions Custom Cells/PersonCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// PersonCell.swift
// Detail
//
// Created by Madison Waters on 11/14/18.
// Copyright © 2018 Jonah Bergevin. All rights reserved.
//

import UIKit

class PersonCell: UITableViewCell {
static let reuseIdentifier = "person cell"

@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var cohortLabel: UILabel!
@IBOutlet weak var uuidLabel: UILabel!
}
52 changes: 52 additions & 0 deletions Custom Cells/PersonCell.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<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>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="128" id="x0Q-z1-uV8" customClass="PersonCell" customModule="Detail" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="372" height="128"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="x0Q-z1-uV8" id="1vg-fk-hRx">
<rect key="frame" x="0.0" y="0.0" width="372" height="127.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="25" translatesAutoresizingMaskIntoConstraints="NO" id="803-3J-f8R">
<rect key="frame" x="24" y="19" width="324" height="90"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="72Q-mH-ozm">
<rect key="frame" x="0.0" y="0.0" width="324" height="32.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle0"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fdi-FN-Xo5">
<rect key="frame" x="0.0" y="57.5" width="324" height="32.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstAttribute="bottomMargin" secondItem="803-3J-f8R" secondAttribute="bottom" constant="8" id="Fm0-XY-wMO"/>
<constraint firstAttribute="trailingMargin" secondItem="803-3J-f8R" secondAttribute="trailing" constant="8" id="XcD-sN-FFe"/>
<constraint firstItem="803-3J-f8R" firstAttribute="leading" secondItem="1vg-fk-hRx" secondAttribute="leadingMargin" constant="8" id="oJD-TB-BnU"/>
<constraint firstItem="803-3J-f8R" firstAttribute="top" secondItem="1vg-fk-hRx" secondAttribute="topMargin" constant="8" id="yvj-kv-KkP"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="cohortLabel" destination="Fdi-FN-Xo5" id="Iug-D6-71u"/>
<outlet property="nameLabel" destination="72Q-mH-ozm" id="JHL-KA-eYG"/>
</connections>
<point key="canvasLocation" x="75.200000000000003" y="48.575712143928037"/>
</tableViewCell>
</objects>
</document>
Loading