1 Commits

Author SHA1 Message Date
Aaron 1f66a59372 Made alarmTone editable, but localRead() nil error. 2021-01-27 22:24:54 -05:00
4 changed files with 902 additions and 0 deletions
+93
View File
@@ -9,6 +9,74 @@ import UIKit
class AddAlarmViewController: UIViewController
{
<<<<<<< Updated upstream
=======
// Editing variables
var alarmCell: AlarmTableCell? = nil
var editMode: Bool { alarmCell != nil }
var originalTime: String = ""
override func viewDidLoad()
{
// End edit on return
alarmNameTextField.delegate = self
// Load alarm to edit if in edit mode
if let alarmCell = alarmCell
{
// Toggle editing mode
viewTitle.text = "Edit Alarm"
// Convert string to Date
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "h:mma"
let date = dateFormatter.date(from: "\(alarmCell.time.text!)\(alarmCell.ampm.text!)")
// Set all the original values to be edited
timePicker.date = date!
originalTime = String(dateFormatter.string(from: date!).dropLast(2))
// Toggle proper repeats
if let repeats = alarmCell.repeatText.text {
if repeats == "Repeats: Weekdays" {
repeatWeekdaysSwitch.isOn = true
repeatWeekendsSwitch.isOn = false
} else if repeats == "Repeats: Weekends" {
repeatWeekendsSwitch.isOn = true
repeatWeekdaysSwitch.isOn = false
} else if repeats == "Repeats: Daily" {
repeatWeekdaysSwitch.isOn = true
repeatWeekendsSwitch.isOn = true
} else {
repeatWeekendsSwitch.isOn = false
repeatWeekdaysSwitch.isOn = false
}
}
alarmNameTextField.text = String(alarmCell.descriptionText.text!.dropFirst(2))
updateETA()
// Sets the WVM
if let wvm = alarmCell.wvmText.text {
for index in 0...wvms.count-1 {
if wvm == wvms[index].name {
wvmPicker.selectRow(index, inComponent: 0, animated: true)
}
}
}
//Sets alarm tone
if let toneName = alarmCell.toneLabel.text {
for index in 0...ringtones.count-1 {
if toneName == ringtones[index].name {
ringtonePicker.selectRow(index, inComponent: 0, animated: true)
}
}
}
}
}
>>>>>>> Stashed changes
// UI: Make scroll view scrollable
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var scrollViewInner: UIView!
@@ -24,7 +92,32 @@ class AddAlarmViewController: UIViewController
override func viewDidLoad()
{
<<<<<<< Updated upstream
super.viewDidLoad()
=======
let (h, m, _) = timePicker.date.getHMS()
// Create the alarm
let alarm = Alarm(hour: h, minute: m,
text: alarmNameTextField.text ?? "Alarm",
wakeMethod: wvms[wvmPicker.selectedRow(inComponent: 0)],
lastActivate: Date(), alarmTone: ringtones[ringtonePicker.selectedRow(inComponent: 0)].tone, toneName: ringtones[ringtonePicker.selectedRow(inComponent: 0)].name)
// Set alarm.repeats to correspond with what the user selects
(0...6).forEach { alarm.repeats[$0] = false }
if repeatWeekdaysSwitch.isOn { (1...5).forEach { alarm.repeats[$0] = true } }
if repeatWeekendsSwitch.isOn { [0, 6].forEach { alarm.repeats[$0] = true } }
return alarm
}
/**
Dynamically the ETA label for the alarm
*/
func updateETA() {
let timeTill = createAlarm().nextActivate!.timeIntervalSince(Date()).str()
timeTillAlarmLabel.text = "Going off in \(timeTill)"
>>>>>>> Stashed changes
}
}
+62
View File
@@ -60,10 +60,72 @@ class AlarmTableCell: UITableViewCell
@IBOutlet weak var enable: UISwitch!
@IBOutlet weak var repeatText: UILabel!
@IBOutlet weak var goingOffText: UILabel!
<<<<<<< Updated upstream
=======
@IBOutlet weak var wvmText: UILabel!
@IBOutlet weak var toneLabel: UILabel!
>>>>>>> Stashed changes
/// Update information on the cell to information in the alarm object
func setData(_ alarm: Alarm)
{
descriptionText.text = "- " + alarm.text
<<<<<<< Updated upstream
=======
enable.isOn = alarm.enabled
wvmText.text = alarm.wakeMethod.name
toneLabel.text = alarm.toneName
// Display Hour, Minute, and AM or PM
ampm.text = alarm.hour < 12 || alarm.hour == 24 ? "AM" : "PM"
var hour = alarm.hour <= 12 ? alarm.hour : alarm.hour - 12
hour = alarm.hour == 0 ? 12 : hour
time.text = String(format: "%i:%02i", hour, alarm.minute)
// displays the specific days alarm is activated
let daysDict = ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"]
var daysActive : [String] = []
if alarm.oneTime {repeatText.text = "One-time Alarm"}
else {
for (index, element) in alarm.repeats.enumerated() {
if element {
daysActive.append(daysDict[index])
}
}
if daysDict == daysActive {
repeatText.text = "Repeats: Daily"
} else if daysActive == ["Sun", "Sat"] {
repeatText.text = "Repeats: Weekends"
} else if daysActive == ["Mon", "Tues", "Wed", "Thurs", "Fri"] {
repeatText.text = "Repeats: Weekdays"
} else {
repeatText.text = daysActive.joined(separator: ", ")
}
}
updateActivationTime()
}
func updateActivationTime()
{
// Show next activation date
if alarm.enabled, let n = alarm.nextActivate {
goingOffText.text = "(Going off in \(n.timeIntervalSince(Date()).str()))"
}
else {
goingOffText.text = ""
}
}
/**
Called when the user switches the switch
*/
@IBAction func switchChange(_ sender: Any)
{
Alarms.fromLocal().apply {
$0.list.first { $0.hour == self.alarm.hour && $0.minute == self.alarm.minute }?.enabled = enable.isOn
}.localSave()
>>>>>>> Stashed changes
}
}
+582
View File
@@ -67,10 +67,20 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<<<<<<< Updated upstream
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yra-wA-O7B">
<rect key="frame" x="345" y="26" width="49" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</switch>
=======
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eZP-Zd-RS2" userLabel="toneLabel">
<rect key="frame" x="246" y="19" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
>>>>>>> Stashed changes
</subviews>
<constraints>
<constraint firstItem="YhV-X3-y1v" firstAttribute="leading" secondItem="Wl6-IQ-lVM" secondAttribute="leadingMargin" constant="10" id="Hur-MO-GTA"/>
@@ -94,6 +104,12 @@
<outlet property="goingOffText" destination="EPJ-eL-Kek" id="QNo-WD-AyS"/>
<outlet property="repeatText" destination="YhV-X3-y1v" id="Alj-Ko-6y6"/>
<outlet property="time" destination="mjO-SX-f31" id="OQC-eJ-Qjc"/>
<<<<<<< Updated upstream
=======
<outlet property="toneLabel" destination="eZP-Zd-RS2" id="sH0-Be-ekr"/>
<outlet property="wvmText" destination="Kaa-5k-xfL" id="gsX-DJ-xmb"/>
<segue destination="Mki-dC-5Kc" kind="show" identifier="edit-alarm" id="WYD-ju-WX0"/>
>>>>>>> Stashed changes
</connections>
</tableViewCell>
</prototypes>
@@ -583,6 +599,572 @@
</objects>
<point key="canvasLocation" x="-1406" y="1102"/>
</scene>
<<<<<<< Updated upstream
=======
<!--LoginVC-->
<scene sceneID="erw-PT-N27">
<objects>
<viewController id="ZAC-hn-zGl" customClass="LoginVC" customModule="GetGoing" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="ikD-PZ-wEA">
<rect key="frame" x="0.0" y="0.0" width="414" height="200"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="bey-TF-Fqa">
<rect key="frame" x="20" y="29" width="374" height="142"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="4Rf-oJ-54p">
<rect key="frame" x="0.0" y="0.0" width="374" height="34"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Username" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2A7-sm-WU9">
<rect key="frame" x="0.0" y="0.0" width="80" height="34"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="80" id="sge-J8-P4B"/>
</constraints>
<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="Unique Username (Case Sensitive)" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="1M0-Wo-TZA">
<rect key="frame" x="100" y="0.0" width="274" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no" textContentType="username"/>
</textField>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="8Az-dM-tXe">
<rect key="frame" x="0.0" y="54" width="374" height="34"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Password" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vtI-qz-pCA">
<rect key="frame" x="0.0" y="0.0" width="80" height="34"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="80" id="CfI-BL-Ifg"/>
</constraints>
<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="Password (Case Sensitive)" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3pJ-zP-vKy">
<rect key="frame" x="100" y="0.0" width="274" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
</textField>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="2Vc-MS-Vmc">
<rect key="frame" x="0.0" y="108" width="374" height="34"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DpZ-cR-QRd">
<rect key="frame" x="0.0" y="0.0" width="177" height="34"/>
<state key="normal" title="Register"/>
<connections>
<action selector="register:" destination="ZAC-hn-zGl" eventType="touchUpInside" id="t9e-S1-E1e"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="C8G-k3-WeR">
<rect key="frame" x="197" y="0.0" width="177" height="34"/>
<state key="normal" title="Login"/>
<connections>
<action selector="login:" destination="ZAC-hn-zGl" eventType="touchUpInside" id="hda-pr-3rN"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="bky-eU-lyX"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="bey-TF-Fqa" firstAttribute="centerY" secondItem="ikD-PZ-wEA" secondAttribute="centerY" id="61k-0f-XAy"/>
<constraint firstAttribute="trailing" secondItem="bey-TF-Fqa" secondAttribute="trailing" constant="20" id="6q6-l9-TNU"/>
<constraint firstItem="bey-TF-Fqa" firstAttribute="leading" secondItem="ikD-PZ-wEA" secondAttribute="leading" constant="20" id="Juc-Oa-X2W"/>
</constraints>
</view>
<connections>
<outlet property="password" destination="3pJ-zP-vKy" id="Cnb-HO-uMj"/>
<outlet property="username" destination="1M0-Wo-TZA" id="rfc-YG-20V"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="M0T-zq-vZ0" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="897" y="1342"/>
</scene>
<!--ManageVC-->
<scene sceneID="jRZ-qD-YDj">
<objects>
<viewController id="3gV-kF-UbK" customClass="ManageVC" customModule="GetGoing" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="yUd-Ri-s9C">
<rect key="frame" x="0.0" y="0.0" width="414" height="704"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="gYR-mG-zfS">
<rect key="frame" x="20" y="0.0" width="374" height="541.5"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gUf-g1-1af">
<rect key="frame" x="0.0" y="0.0" width="374" height="170"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="person.crop.circle.badge.checkmark" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="yVW-fL-SIQ">
<rect key="frame" x="132" y="0.0" width="110" height="109.5"/>
<constraints>
<constraint firstAttribute="width" constant="110" id="So8-k5-nLS"/>
<constraint firstAttribute="height" constant="110" id="inA-vb-CrL"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Username 233" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kAN-ll-4wh">
<rect key="frame" x="20" y="118" width="334" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Joined on Jan 8, 2021" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cT0-Ux-t7H">
<rect key="frame" x="20" y="138.5" width="334" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" systemColor="secondaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="cT0-Ux-t7H" firstAttribute="leading" secondItem="gUf-g1-1af" secondAttribute="leading" constant="20" id="1Ik-pd-j1d"/>
<constraint firstItem="cT0-Ux-t7H" firstAttribute="top" secondItem="kAN-ll-4wh" secondAttribute="bottom" id="8Tf-2A-QR5"/>
<constraint firstItem="yVW-fL-SIQ" firstAttribute="centerX" secondItem="gUf-g1-1af" secondAttribute="centerX" id="BgL-qD-g20"/>
<constraint firstItem="kAN-ll-4wh" firstAttribute="top" secondItem="yVW-fL-SIQ" secondAttribute="bottom" constant="8" symbolic="YES" id="Bt4-2a-aPr"/>
<constraint firstAttribute="trailing" secondItem="kAN-ll-4wh" secondAttribute="trailing" constant="20" id="DNM-FH-WaB"/>
<constraint firstItem="yVW-fL-SIQ" firstAttribute="top" secondItem="gUf-g1-1af" secondAttribute="top" id="bfq-gx-ofm"/>
<constraint firstItem="kAN-ll-4wh" firstAttribute="leading" secondItem="gUf-g1-1af" secondAttribute="leading" constant="20" id="dqc-ZN-G6v"/>
<constraint firstAttribute="height" constant="170" id="xvU-zX-6BQ"/>
<constraint firstAttribute="trailing" secondItem="cT0-Ux-t7H" secondAttribute="trailing" constant="20" id="yRX-lY-fXX"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Family" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cqT-C1-NoI">
<rect key="frame" x="0.0" y="190" width="374" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" systemColor="secondaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="q1f-J9-ukS">
<rect key="frame" x="0.0" y="230.5" width="374" height="20.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Current Family" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eoW-M7-PYh">
<rect key="frame" x="0.0" y="0.0" width="111" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="None" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5VN-tm-dGm">
<rect key="frame" x="131" y="0.0" width="243" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" systemColor="secondaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a4b-tg-b7K">
<rect key="frame" x="0.0" y="271" width="374" height="30"/>
<state key="normal" title="Manage Family"/>
<connections>
<segue destination="4ss-Ye-Da4" kind="show" id="9aj-jI-ZmP"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Account Actions" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dgZ-Jv-Z0F">
<rect key="frame" x="0.0" y="321" width="374" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" systemColor="secondaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ae0-Ce-3T1">
<rect key="frame" x="0.0" y="361.5" width="374" height="30"/>
<state key="normal" title="Download Alarm Backup"/>
<connections>
<action selector="downloadBackup:" destination="3gV-kF-UbK" eventType="touchUpInside" id="3GI-T3-9E4"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PJQ-Rs-7jD">
<rect key="frame" x="0.0" y="411.5" width="374" height="30"/>
<state key="normal" title="Upload Alarm Backup"/>
<connections>
<action selector="uploadBackup:" destination="3gV-kF-UbK" eventType="touchUpInside" id="TXd-5k-cdI"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3pG-br-PVl">
<rect key="frame" x="0.0" y="461.5" width="374" height="30"/>
<state key="normal" title="Log Out">
<color key="titleColor" systemColor="systemOrangeColor"/>
</state>
<connections>
<action selector="logout:" destination="3gV-kF-UbK" eventType="touchUpInside" id="dyQ-AR-u9Y"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="awy-Du-cqu">
<rect key="frame" x="0.0" y="511.5" width="374" height="30"/>
<state key="normal" title="Delete Account">
<color key="titleColor" systemColor="systemRedColor"/>
</state>
<connections>
<action selector="deleteAccount:" destination="3gV-kF-UbK" eventType="touchUpInside" id="iQ9-m9-VIm"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="xo1-tu-MEz"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="gYR-mG-zfS" firstAttribute="leading" secondItem="yUd-Ri-s9C" secondAttribute="leading" constant="20" id="LuV-cO-Q8K"/>
<constraint firstItem="gYR-mG-zfS" firstAttribute="top" secondItem="yUd-Ri-s9C" secondAttribute="top" id="aTB-LN-BGK"/>
<constraint firstAttribute="trailing" secondItem="gYR-mG-zfS" secondAttribute="trailing" constant="20" id="fxQ-LY-4QQ"/>
</constraints>
</view>
<connections>
<outlet property="lCurrentFamily" destination="5VN-tm-dGm" id="0Mr-NX-7Ww"/>
<outlet property="lJoinDate" destination="cT0-Ux-t7H" id="1XG-r8-Qr4"/>
<outlet property="lUsername" destination="kAN-ll-4wh" id="3Ta-rI-wql"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="pLc-eQ-yBW" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="897" y="1683"/>
</scene>
<!--Family Create JoinVC-->
<scene sceneID="tUH-PD-QsR">
<objects>
<viewController id="MJK-PM-TUJ" customClass="FamilyCreateJoinVC" customModule="GetGoing" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="hVL-5L-UCI">
<rect key="frame" x="0.0" y="0.0" width="414" height="650"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="EoV-eE-GYj">
<rect key="frame" x="20" y="75" width="374" height="142"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="Pjr-LE-crM">
<rect key="frame" x="0.0" y="0.0" width="374" height="34"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Family Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YfO-H5-olP">
<rect key="frame" x="0.0" y="0.0" width="100" height="34"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="100" id="Da0-E3-S2B"/>
</constraints>
<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" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="aPT-13-Az4">
<rect key="frame" x="120" y="0.0" width="254" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no" textContentType="username"/>
</textField>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="QPe-BN-cuF">
<rect key="frame" x="0.0" y="54" width="374" height="34"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Family Pin" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YUh-Lx-twG">
<rect key="frame" x="0.0" y="0.0" width="100" height="34"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="100" id="NjG-Ab-Dio"/>
</constraints>
<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" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="UGD-ka-LPo">
<rect key="frame" x="120" y="0.0" width="254" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad" secureTextEntry="YES" textContentType="one-time-code"/>
</textField>
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KSB-S7-kAX">
<rect key="frame" x="0.0" y="108" width="374" height="34"/>
<state key="normal" title="Create/Join"/>
<connections>
<action selector="btnCreateOrJoin:" destination="MJK-PM-TUJ" eventType="touchUpInside" id="wqB-ir-1be"/>
<action selector="register:" destination="ZAC-hn-zGl" eventType="touchUpInside" id="fbN-Jr-RKv"/>
</connections>
</button>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Family" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0ER-e7-2h0">
<rect key="frame" x="20" y="20" width="374" height="20.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Create Family" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Exc-3W-ubl">
<rect key="frame" x="20" y="40.5" width="374" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="Gjo-27-xML"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Gjo-27-xML" firstAttribute="trailing" secondItem="EoV-eE-GYj" secondAttribute="trailing" constant="20" id="0Tg-gG-uTP"/>
<constraint firstItem="0ER-e7-2h0" firstAttribute="trailing" secondItem="Exc-3W-ubl" secondAttribute="trailing" id="6zk-yI-u6h"/>
<constraint firstItem="0ER-e7-2h0" firstAttribute="leading" secondItem="Exc-3W-ubl" secondAttribute="leading" id="Ctg-6i-Cz9"/>
<constraint firstItem="EoV-eE-GYj" firstAttribute="top" secondItem="Exc-3W-ubl" secondAttribute="bottom" constant="20" id="Elp-CR-2Ad"/>
<constraint firstItem="Exc-3W-ubl" firstAttribute="trailing" secondItem="EoV-eE-GYj" secondAttribute="trailing" id="YL8-8b-lp8"/>
<constraint firstItem="EoV-eE-GYj" firstAttribute="leading" secondItem="Gjo-27-xML" secondAttribute="leading" constant="20" id="dNE-YR-Lmh"/>
<constraint firstItem="Exc-3W-ubl" firstAttribute="top" secondItem="0ER-e7-2h0" secondAttribute="bottom" id="l2T-UO-Eye"/>
<constraint firstItem="0ER-e7-2h0" firstAttribute="top" secondItem="hVL-5L-UCI" secondAttribute="top" constant="20" symbolic="YES" id="xeo-B1-cgl"/>
<constraint firstItem="Exc-3W-ubl" firstAttribute="leading" secondItem="EoV-eE-GYj" secondAttribute="leading" id="zI3-yY-dwo"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="ZUB-xj-wf6"/>
<connections>
<outlet property="bCreateJoin" destination="KSB-S7-kAX" id="aeU-Yk-wmh"/>
<outlet property="lFamilyNameOrId" destination="YfO-H5-olP" id="OXM-3N-ZVV"/>
<outlet property="tNameOrId" destination="aPT-13-Az4" id="6Cw-ur-FBF"/>
<outlet property="tPin" destination="UGD-ka-LPo" id="aNg-6j-ipe"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kMK-Pp-v1l" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1664" y="2271"/>
</scene>
<!--Family Add AlarmVC-->
<scene sceneID="nfh-Af-0i6">
<objects>
<viewController id="tsc-Sa-flN" customClass="FamilyAddAlarmVC" customModule="GetGoing" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="cjq-um-dZr">
<rect key="frame" x="0.0" y="0.0" width="414" height="650"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Tnv-t2-x4g">
<rect key="frame" x="20" y="191" width="374" height="439"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="family-alarm-cell" id="Suf-xg-DzL">
<rect key="frame" x="0.0" y="28" width="374" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Suf-xg-DzL" id="Ic2-YQ-FgT">
<rect key="frame" x="0.0" y="0.0" width="374" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
</tableView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Family" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vbG-Sp-h0i">
<rect key="frame" x="20" y="20" width="374" height="20.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Add Alarm" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EWO-hG-2vh">
<rect key="frame" x="20" y="40.5" width="374" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="justified" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cyP-bM-Yge">
<rect key="frame" x="20" y="75.5" width="374" height="95.5"/>
<string key="text">Here, you can add an alarm to your family members with the pin. If you want to add an alarm to someone from here, you need to add the alarm for yourself in the alarm tab first, and then select the alarm here.</string>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" systemColor="secondaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="IDe-wG-F35"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="vbG-Sp-h0i" firstAttribute="leading" secondItem="cjq-um-dZr" secondAttribute="leadingMargin" id="7uv-hC-5fa"/>
<constraint firstItem="Tnv-t2-x4g" firstAttribute="top" secondItem="cyP-bM-Yge" secondAttribute="bottom" constant="20" id="CSK-OV-6C3"/>
<constraint firstItem="cyP-bM-Yge" firstAttribute="top" secondItem="EWO-hG-2vh" secondAttribute="bottom" constant="20" id="Egn-NI-NHW"/>
<constraint firstItem="vbG-Sp-h0i" firstAttribute="leading" secondItem="EWO-hG-2vh" secondAttribute="leading" id="IWh-M9-QFL"/>
<constraint firstAttribute="trailing" secondItem="cyP-bM-Yge" secondAttribute="trailing" constant="20" id="PGX-dI-HdC"/>
<constraint firstItem="vbG-Sp-h0i" firstAttribute="top" secondItem="cjq-um-dZr" secondAttribute="top" constant="20" id="PeZ-Zt-1aL"/>
<constraint firstItem="vbG-Sp-h0i" firstAttribute="trailing" secondItem="EWO-hG-2vh" secondAttribute="trailing" id="WCT-Qe-M42"/>
<constraint firstItem="EWO-hG-2vh" firstAttribute="top" secondItem="vbG-Sp-h0i" secondAttribute="bottom" id="Xdq-LA-K4F"/>
<constraint firstItem="vbG-Sp-h0i" firstAttribute="trailing" secondItem="cjq-um-dZr" secondAttribute="trailingMargin" id="ayi-jb-aGM"/>
<constraint firstItem="cyP-bM-Yge" firstAttribute="leading" secondItem="IDe-wG-F35" secondAttribute="leading" constant="20" id="bKL-iD-WWi"/>
<constraint firstAttribute="bottom" secondItem="Tnv-t2-x4g" secondAttribute="bottom" constant="20" symbolic="YES" id="ddm-sI-lce"/>
<constraint firstItem="EWO-hG-2vh" firstAttribute="leading" secondItem="Tnv-t2-x4g" secondAttribute="leading" id="imZ-ds-n7S"/>
<constraint firstItem="EWO-hG-2vh" firstAttribute="trailing" secondItem="Tnv-t2-x4g" secondAttribute="trailing" id="yJF-Ei-N2B"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="g8i-R5-KT9"/>
<connections>
<outlet property="table" destination="Tnv-t2-x4g" id="lsv-3K-jRC"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8aw-Tn-lRs" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1663.7681159420292" y="1732.3660714285713"/>
</scene>
<!--FamilyVC-->
<scene sceneID="KZB-tX-blq">
<objects>
<viewController id="4ss-Ye-Da4" customClass="FamilyVC" customModule="GetGoing" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="M0S-uG-lPW">
<rect key="frame" x="0.0" y="0.0" width="414" height="650"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Family" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4kN-8K-gM9">
<rect key="frame" x="20" y="20" width="374" height="20.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Manage Family Members" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4JV-r6-luC">
<rect key="frame" x="20" y="40.5" width="374" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fGb-4v-e2b">
<rect key="frame" x="20" y="75" width="374" height="575"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="rDD-Q4-4BN">
<rect key="frame" x="0.0" y="30.5" width="374" height="354.5"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="family-member-cell" rowHeight="66" id="PpM-BI-Arz">
<rect key="frame" x="0.0" y="28" width="374" height="66"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="PpM-BI-Arz" id="zXh-kT-4wz">
<rect key="frame" x="0.0" y="0.0" width="374" height="66"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
<connections>
<segue destination="tsc-Sa-flN" kind="show" id="F5K-wj-EOr"/>
</connections>
</tableViewCell>
</prototypes>
</tableView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="vpv-oC-dfU">
<rect key="frame" x="0.0" y="405" width="374" height="150"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jA1-s3-6ml">
<rect key="frame" x="0.0" y="0.0" width="374" height="30"/>
<state key="normal" title="Refresh"/>
<connections>
<action selector="btnRefresh:" destination="4ss-Ye-Da4" eventType="touchUpInside" id="t7G-Ur-JIH"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="R2H-k5-27v">
<rect key="frame" x="0.0" y="40" width="374" height="30"/>
<state key="normal" title="Change Pin"/>
<connections>
<action selector="btnChangePin:" destination="4ss-Ye-Da4" eventType="touchUpInside" id="0g1-r0-3Fn"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="De7-dU-p8j">
<rect key="frame" x="0.0" y="80" width="374" height="30"/>
<state key="normal" title="Leave Family">
<color key="titleColor" systemColor="systemOrangeColor"/>
</state>
<connections>
<action selector="btnLeave:" destination="4ss-Ye-Da4" eventType="touchUpInside" id="YMe-ri-xkZ"/>
</connections>
</button>
<button opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mA7-bI-2hr">
<rect key="frame" x="0.0" y="120" width="374" height="30"/>
<state key="normal" title="Delete Family">
<color key="titleColor" systemColor="systemRedColor"/>
</state>
<connections>
<action selector="btnLeave:" destination="4ss-Ye-Da4" eventType="touchUpInside" id="S6Z-gL-u2U"/>
</connections>
</button>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Members" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BH2-a6-zBn">
<rect key="frame" x="0.0" y="0.0" width="374" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="vpv-oC-dfU" firstAttribute="top" secondItem="rDD-Q4-4BN" secondAttribute="bottom" constant="20" id="0QU-6L-lAV"/>
<constraint firstItem="BH2-a6-zBn" firstAttribute="top" secondItem="fGb-4v-e2b" secondAttribute="top" id="AY9-6n-dG4"/>
<constraint firstAttribute="trailing" secondItem="rDD-Q4-4BN" secondAttribute="trailing" id="MHy-JS-4ch"/>
<constraint firstItem="rDD-Q4-4BN" firstAttribute="top" secondItem="BH2-a6-zBn" secondAttribute="bottom" constant="10" id="Soh-Ay-8S8"/>
<constraint firstItem="vpv-oC-dfU" firstAttribute="leading" secondItem="fGb-4v-e2b" secondAttribute="leading" id="ZS1-h8-ljQ"/>
<constraint firstAttribute="bottom" secondItem="vpv-oC-dfU" secondAttribute="bottom" constant="20" id="bKP-SZ-aXH"/>
<constraint firstAttribute="trailing" secondItem="BH2-a6-zBn" secondAttribute="trailing" id="chx-DC-ILr"/>
<constraint firstItem="rDD-Q4-4BN" firstAttribute="leading" secondItem="fGb-4v-e2b" secondAttribute="leading" id="lBl-wW-7fM"/>
<constraint firstAttribute="trailing" secondItem="vpv-oC-dfU" secondAttribute="trailing" id="oPm-FV-t2A"/>
<constraint firstItem="BH2-a6-zBn" firstAttribute="leading" secondItem="fGb-4v-e2b" secondAttribute="leading" id="wdL-Bi-3iu"/>
</constraints>
</view>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yB2-sF-tqs">
<rect key="frame" x="20" y="75" width="374" height="107.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="Afe-5l-IkF">
<rect key="frame" x="0.0" y="77.5" width="374" height="30"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Dd1-LB-2Mm">
<rect key="frame" x="0.0" y="0.0" width="177" height="30"/>
<state key="normal" title="Create"/>
<connections>
<action selector="btnCreate:" destination="4ss-Ye-Da4" eventType="touchUpInside" id="hQN-oC-Qzf"/>
<action selector="register:" destination="ZAC-hn-zGl" eventType="touchUpInside" id="4uN-vJ-WXg"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tz1-gQ-74Y">
<rect key="frame" x="197" y="0.0" width="177" height="30"/>
<state key="normal" title="Join"/>
<connections>
<action selector="btnJoin:" destination="4ss-Ye-Da4" eventType="touchUpInside" id="oVw-q9-eDv"/>
<action selector="login:" destination="ZAC-hn-zGl" eventType="touchUpInside" id="4rF-hE-JDe"/>
</connections>
</button>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="justified" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dki-8q-7sB">
<rect key="frame" x="0.0" y="0.0" width="374" height="57.5"/>
<string key="text">You're not in a family yet. Do you want to create or join one? If you are a parent, family features allow you to add alarms to your children's list.</string>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" systemColor="secondaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Dki-8q-7sB" firstAttribute="top" secondItem="yB2-sF-tqs" secondAttribute="top" id="6Wb-fC-MCf"/>
<constraint firstAttribute="trailing" secondItem="Dki-8q-7sB" secondAttribute="trailing" id="FlT-Vd-Cmq"/>
<constraint firstAttribute="bottom" secondItem="Afe-5l-IkF" secondAttribute="bottom" id="Sss-B4-a65"/>
<constraint firstItem="Dki-8q-7sB" firstAttribute="leading" secondItem="yB2-sF-tqs" secondAttribute="leading" id="Y5l-wW-nua"/>
<constraint firstItem="Afe-5l-IkF" firstAttribute="leading" secondItem="yB2-sF-tqs" secondAttribute="leading" id="ZLK-CO-w9x"/>
<constraint firstItem="Afe-5l-IkF" firstAttribute="top" secondItem="Dki-8q-7sB" secondAttribute="bottom" constant="20" id="hT6-ZL-eqA"/>
<constraint firstAttribute="trailing" secondItem="Afe-5l-IkF" secondAttribute="trailing" id="uoC-iy-Uvw"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="ZHP-aO-cBk"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="fGb-4v-e2b" firstAttribute="leading" secondItem="ZHP-aO-cBk" secondAttribute="leading" constant="20" id="5MG-Gy-w4D"/>
<constraint firstItem="fGb-4v-e2b" firstAttribute="bottom" secondItem="ZHP-aO-cBk" secondAttribute="bottom" id="8I1-Nv-8fQ"/>
<constraint firstItem="4kN-8K-gM9" firstAttribute="top" secondItem="ZHP-aO-cBk" secondAttribute="top" constant="20" id="99M-Lo-GoC"/>
<constraint firstItem="ZHP-aO-cBk" firstAttribute="trailing" secondItem="fGb-4v-e2b" secondAttribute="trailing" constant="20" id="9b4-mg-jdt"/>
<constraint firstItem="ZHP-aO-cBk" firstAttribute="trailing" secondItem="yB2-sF-tqs" secondAttribute="trailing" constant="20" id="EoR-1a-gX9"/>
<constraint firstItem="4kN-8K-gM9" firstAttribute="trailing" secondItem="4JV-r6-luC" secondAttribute="trailing" id="Idr-0Z-Irc"/>
<constraint firstItem="4kN-8K-gM9" firstAttribute="leading" secondItem="ZHP-aO-cBk" secondAttribute="leading" constant="20" id="QHJ-i3-Z9o"/>
<constraint firstItem="ZHP-aO-cBk" firstAttribute="trailing" secondItem="4kN-8K-gM9" secondAttribute="trailing" constant="20" id="egO-zB-efN"/>
<constraint firstItem="yB2-sF-tqs" firstAttribute="top" secondItem="4JV-r6-luC" secondAttribute="bottom" constant="20" id="hAD-jQ-eLo"/>
<constraint firstItem="4kN-8K-gM9" firstAttribute="leading" secondItem="4JV-r6-luC" secondAttribute="leading" id="hyU-dP-Zcc"/>
<constraint firstItem="fGb-4v-e2b" firstAttribute="top" secondItem="4JV-r6-luC" secondAttribute="bottom" constant="20" id="iVl-Mf-5MX"/>
<constraint firstItem="yB2-sF-tqs" firstAttribute="leading" secondItem="ZHP-aO-cBk" secondAttribute="leading" constant="20" id="rMF-jX-a4l"/>
<constraint firstItem="4JV-r6-luC" firstAttribute="top" secondItem="4kN-8K-gM9" secondAttribute="bottom" id="xRb-1q-Gad"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="6by-4V-XuW"/>
<connections>
<outlet property="familyView" destination="fGb-4v-e2b" id="kJI-xP-J5H"/>
<outlet property="noFamilyView" destination="yB2-sF-tqs" id="dp1-fy-2tU"/>
<outlet property="table" destination="rDD-Q4-4BN" id="64A-WA-DQx"/>
<segue destination="MJK-PM-TUJ" kind="show" identifier="family-create-join" destinationCreationSelector="segueCreateJoin:" id="Abf-zv-CJ0"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="eGH-yq-k1z" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="895.6521739130435" y="2270.7589285714284"/>
</scene>
>>>>>>> Stashed changes
</scenes>
<resources>
<image name="alarm.fill" catalog="system" width="124" height="128"/>
+165
View File
@@ -11,6 +11,171 @@ struct User: Decodable
{
var id: Int
var name: String
<<<<<<< Updated upstream
var email: String
var pass: String
=======
var members: String
// And a hidden field: admin pin
var membersList: [String] { members.csv }
/// Save family to local storage
func localSave()
{
localStorage.setValue(JSON.stringify(self)!, forKey: "family")
}
/// Read family object from local storage
static func fromLocal() -> Family?
{
guard let f = localStorage.string(forKey: "family") else { return nil }
return JSON.parse(Family.self, f)
}
}
struct WVM: Codable
{
let name: String
let desc: String
}
let wvms = [
WVM(name: "Shake", desc: "Shake your phone... aggresively!"),
WVM(name: "Math 1", desc: "Easy math expression"),
WVM(name: "Math 2", desc: "Medium math expression"),
WVM(name: "Math 3", desc: "Hard math expression"),
WVM(name: "Factor", desc: "Factor a binomial"),
WVM(name: "RPS", desc: "Win a game of rock paper scissors"),
//WVM(name: "Smash", desc: "It'll never turn off"),
//WVM(name: "Walk", desc: "Walk a few steps"),
//WVM(name: "Jump", desc: "Make a few jumps")
]
struct Tone: Codable{
let name: String
let tone: SystemSoundID
}
let ringtones = [
Tone(name: "News Flash", tone: SystemSoundID(1028)),
Tone(name: "Sherwood Forest", tone: SystemSoundID(1030)),
Tone(name: "Ladder", tone: SystemSoundID(1326)),
Tone(name: "Minuet", tone: SystemSoundID(1327)),
Tone(name: "Tock", tone: SystemSoundID(1306)),
Tone(name: "Bloom", tone: SystemSoundID(1321)),
Tone(name: "Calypso", tone: SystemSoundID(1322)),
Tone(name: "Train", tone: SystemSoundID(1323)),
Tone(name: "Fanfare", tone: SystemSoundID(1325))
]
class Alarm: Codable, Equatable
{
static func == (lhs: Alarm, rhs: Alarm) -> Bool {
return lhs.hour == rhs.hour && lhs.minute == rhs.minute && lhs.text == rhs.text &&
lhs.alarmTone == rhs.alarmTone && lhs.repeats == rhs.repeats
}
var enabled: Bool
var hour: Int // Hour (24)
var minute: Int
var text: String
var wakeMethod: WVM
var alarmTone: SystemSoundID
var notificationID: String
var toneName: String
/// What days does it repeat (Sun, Mon, Tue, Wed, Thu, Fri, Sat)
var repeats: [Bool]
/// When is the last time that the alarm went off
var lastActivate: Date
/// Constructor
init(enabled: Bool = true,
hour: Int, minute: Int, text: String, wakeMethod: WVM,
repeats: [Bool] = [false, true, true, true, true, true, false],
lastActivate: Date = Date(),
alarmTone: SystemSoundID = ringtones[0].tone,
toneName: String = ""
)
{
self.enabled = enabled
self.hour = hour
self.minute = minute
self.text = text
self.wakeMethod = wakeMethod
self.repeats = repeats
self.lastActivate = lastActivate
self.alarmTone = alarmTone
self.notificationID = "notification.id.\(Int.random(in: 1...Int.max))"
self.toneName = toneName
}
/// Does it automatically disable after activating once
var oneTime: Bool { repeats.allSatisfy { !$0 } }
/// Get time in h:mm format
var timeText: String { String(format: "%i:%02i", hour, minute) }
/// When should the alarm activate next since lastActivate?
var nextActivate: Date?
{
let (y, m, d) = lastActivate.getYMD()
let (nh, nm, _) = lastActivate.getHMS()
// Create activation date
var date = Date.create(y, m, d, hour, minute)
// If it will activate tomorrow
if nh > hour || (nh == hour && nm >= minute) { date = date.added(.day, 1) }
// If it's one-time, don't have to check for repeating date
if oneTime { return date }
// Make sure it's repeating
guard (repeats.contains { $0 }) else { return nil }
// If the day is not one of the "repeat" days, keep adding 1 until it is
while !repeats[date.get(.weekday) - 1] { date = date.added(.day, 1) }
return date
}
}
class Alarms: Codable
{
var list: [Alarm] = []
/// Save alarms to local storage
func localSave()
{
list.sort { ($0.hour * 60 + $0.minute) < ($1.hour * 60 + $1.minute) }
localStorage.setValue(JSON.stringify(list)!, forKey: "alarms")
// Reload table view
if let table = AlarmViewController.staticTable { table.reloadData() }
}
/// Read alarms from local storage
func localRead() { list = JSON.parse([Alarm].self, localStorage.string(forKey: "alarms")!)! }
/// Read an alarm object from local storage
static func fromLocal() -> Alarms { return Alarms().apply { $0.localRead() } }
/// Get enabled alarms
var listEnabled: [Alarm] { return list.filter { $0.enabled } }
/// Get alarms that should be activating now
var listActivating: [Alarm]
{
let now = Date()
return listEnabled.filter { guard let n = $0.nextActivate else { return false }; return n < now }
}
>>>>>>> Stashed changes
}