Merge branch 'main' of github.com:hykilpikonna/ProjectClock into main
@@ -15,7 +15,7 @@
|
||||
4FD642DB25B4B7F60069171E /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FD642DA25B4B7F60069171E /* Utils.swift */; };
|
||||
4FD642E025B4D5F30069171E /* AlarmActivationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FD642DF25B4D5F30069171E /* AlarmActivationViewController.swift */; };
|
||||
4FF0683F25A5F18700304E6B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FF0683E25A5F18700304E6B /* AppDelegate.swift */; };
|
||||
4FF0684325A5F18700304E6B /* AccountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FF0684225A5F18700304E6B /* AccountViewController.swift */; };
|
||||
4FF0684325A5F18700304E6B /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FF0684225A5F18700304E6B /* Account.swift */; };
|
||||
4FF0684625A5F18700304E6B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4FF0684425A5F18700304E6B /* Main.storyboard */; };
|
||||
4FF0684825A5F18800304E6B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4FF0684725A5F18800304E6B /* Assets.xcassets */; };
|
||||
4FF0684B25A5F18800304E6B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4FF0684925A5F18800304E6B /* LaunchScreen.storyboard */; };
|
||||
@@ -38,7 +38,7 @@
|
||||
4FD642DF25B4D5F30069171E /* AlarmActivationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlarmActivationViewController.swift; sourceTree = "<group>"; };
|
||||
4FF0683B25A5F18700304E6B /* ProjectClock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ProjectClock.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4FF0683E25A5F18700304E6B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
4FF0684225A5F18700304E6B /* AccountViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountViewController.swift; sourceTree = "<group>"; };
|
||||
4FF0684225A5F18700304E6B /* Account.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Account.swift; sourceTree = "<group>"; };
|
||||
4FF0684525A5F18700304E6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
4FF0684725A5F18800304E6B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
4FF0684A25A5F18800304E6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
@@ -86,7 +86,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7CD385A425BE4639007E9890 /* Sounds */,
|
||||
4FF0684225A5F18700304E6B /* AccountViewController.swift */,
|
||||
4FF0684225A5F18700304E6B /* Account.swift */,
|
||||
4F8A607025A9160400D88DC3 /* AddAlarmViewController.swift */,
|
||||
4FD642DF25B4D5F30069171E /* AlarmActivationViewController.swift */,
|
||||
4FD642D225B48C380069171E /* AlarmActivator.swift */,
|
||||
@@ -204,7 +204,7 @@
|
||||
4F8A607125A9160400D88DC3 /* AddAlarmViewController.swift in Sources */,
|
||||
4F98955225A9260400F51321 /* Net.swift in Sources */,
|
||||
7C83963925AF68980027A94C /* DebugViewController.swift in Sources */,
|
||||
4FF0684325A5F18700304E6B /* AccountViewController.swift in Sources */,
|
||||
4FF0684325A5F18700304E6B /* Account.swift in Sources */,
|
||||
F0DF7C0725BCD9FC0064A26B /* StopwatchViewController.swift in Sources */,
|
||||
4FF0683F25A5F18700304E6B /* AppDelegate.swift in Sources */,
|
||||
4FD642D325B48C380069171E /* AlarmActivator.swift in Sources */,
|
||||
|
||||
@@ -358,7 +358,7 @@ extension FamilyVC: UITableViewDelegate, UITableViewDataSource
|
||||
*/
|
||||
func tableView(_ view: UITableView, cellForRowAt i: IndexPath) -> UITableViewCell
|
||||
{
|
||||
let cell = view.dequeueReusableCell(withIdentifier: "cell", for: i)
|
||||
let cell = view.dequeueReusableCell(withIdentifier: "family-member-cell", for: i)
|
||||
cell.textLabel?.text = Family.fromLocal()!.membersList[i.row]
|
||||
return cell
|
||||
}
|
||||
@@ -369,6 +369,7 @@ extension FamilyVC: UITableViewDelegate, UITableViewDataSource
|
||||
func tableView(_ view: UITableView, didSelectRowAt i: IndexPath)
|
||||
{
|
||||
print(i.row)
|
||||
view.deselectRow(at: i, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,3 +462,51 @@ class FamilyCreateJoinVC: UIViewController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
View controller for adding an alarm to a fmaily member
|
||||
*/
|
||||
class FamilyAddAlarmVC: UIViewController
|
||||
{
|
||||
@IBOutlet weak var table: UITableView!
|
||||
|
||||
override func viewDidLoad()
|
||||
{
|
||||
super.viewDidLoad()
|
||||
|
||||
table.delegate = self
|
||||
table.dataSource = self
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Table data source
|
||||
*/
|
||||
extension FamilyAddAlarmVC: UITableViewDelegate, UITableViewDataSource
|
||||
{
|
||||
/**
|
||||
Define row count
|
||||
*/
|
||||
func tableView(_ _: UITableView, numberOfRowsInSection _: Int) -> Int
|
||||
{
|
||||
return Alarms.fromLocal().list.count
|
||||
}
|
||||
|
||||
/**
|
||||
Set cell at i
|
||||
*/
|
||||
func tableView(_ view: UITableView, cellForRowAt i: IndexPath) -> UITableViewCell
|
||||
{
|
||||
let cell = view.dequeueReusableCell(withIdentifier: "family-alarm-cell", for: i)
|
||||
let alarm = Alarms.fromLocal().list[i.row]
|
||||
cell.textLabel?.text = String(format: "%i:%02i", alarm.hour, alarm.minute)
|
||||
return cell
|
||||
}
|
||||
|
||||
/**
|
||||
Called when the user clicks on the cell at i
|
||||
*/
|
||||
func tableView(_ view: UITableView, didSelectRowAt i: IndexPath)
|
||||
{
|
||||
view.deselectRow(at: i, animated: true)
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,9 @@ class AlarmActivationViewController: UIViewController
|
||||
@IBOutlet weak var rpsView: UIView!
|
||||
@IBOutlet weak var rpsResult: UILabel!
|
||||
|
||||
//Shake Outlets
|
||||
@IBOutlet weak var shakeView: UIView!
|
||||
|
||||
//Other Outlets
|
||||
@IBOutlet weak var timeLabel: UILabel!
|
||||
@IBOutlet weak var dateLabel: UILabel!
|
||||
@@ -55,6 +58,7 @@ class AlarmActivationViewController: UIViewController
|
||||
//Hide all inactive wakemethods
|
||||
puzzleView.isHidden = true
|
||||
rpsView.isHidden = true
|
||||
shakeView.isHidden = true
|
||||
|
||||
timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(AlarmActivationViewController.playSound), userInfo: nil, repeats: true)
|
||||
setAlarmType()
|
||||
@@ -85,6 +89,12 @@ class AlarmActivationViewController: UIViewController
|
||||
rpsView.isHidden = false
|
||||
//Get Choice here
|
||||
//rpsAction(choice: choice)
|
||||
case "Shake":
|
||||
shakeView.isHidden = false
|
||||
shakeAction()
|
||||
if regulate {
|
||||
endAlarm()
|
||||
}
|
||||
default:
|
||||
print("Invalid alarm type")
|
||||
}
|
||||
|
||||
@@ -72,5 +72,4 @@ class AlarmActivator: UITabBarController
|
||||
@IBSegueAction func sendAlarm(_ coder: NSCoder) -> AlarmActivationViewController? {
|
||||
return AlarmActivationViewController(coder: coder, currentAlarm: alarm!)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -1,91 +1,109 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "40.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"filename" : "60.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"filename" : "58.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"filename" : "87.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"filename" : "80.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"filename" : "120.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"filename" : "120-1.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"filename" : "180.png",
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"filename" : "20.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"filename" : "40-1.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"filename" : "29.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"filename" : "58-1.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"filename" : "40-2.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"filename" : "80-1.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"filename" : "76.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"filename" : "152.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"filename" : "167.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "83.5x83.5"
|
||||
},
|
||||
{
|
||||
"filename" : "appstore.png",
|
||||
"idiom" : "ios-marketing",
|
||||
"scale" : "1x",
|
||||
"size" : "1024x1024"
|
||||
|
||||
|
After Width: | Height: | Size: 1.3 MiB |
@@ -237,7 +237,7 @@
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="oTa-Ok-U9h">
|
||||
<rect key="frame" x="20" y="109" width="374" height="128"/>
|
||||
<rect key="frame" x="20" y="109" width="374" height="174"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8o4-jF-mCC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="374" height="36"/>
|
||||
@@ -263,6 +263,15 @@
|
||||
<action selector="deleteAlarm:" destination="r8W-6e-Hn2" eventType="touchUpInside" id="gqI-7A-W9C"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zrg-H8-O73">
|
||||
<rect key="frame" x="0.0" y="138" width="374" height="36"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="20"/>
|
||||
<state key="normal" title="Switch to Dark Mode"/>
|
||||
<connections>
|
||||
<action selector="deleteAlarm:" destination="r8W-6e-Hn2" eventType="touchUpInside" id="gSj-DC-XvL"/>
|
||||
<action selector="switchViewingMode:" destination="r8W-6e-Hn2" eventType="touchUpInside" id="GFd-hP-L8n"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</stackView>
|
||||
</subviews>
|
||||
@@ -281,6 +290,9 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<tabBarItem key="tabBarItem" title="Debug" image="hammer.fill" catalog="system" selectedImage="hammer.fill" id="QZ2-fJ-hLg"/>
|
||||
<connections>
|
||||
<outlet property="userModeButton" destination="Zrg-H8-O73" id="9sz-f3-9pJ"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="mZu-oh-Lmb" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
@@ -429,7 +441,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Going off in 23 hr 59 min" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xqs-n0-H9G">
|
||||
<rect key="frame" x="20" y="40.5" width="374" height="14.5"/>
|
||||
<rect key="frame" x="20" y="40" width="374" height="14.5"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="14.5" id="MVD-pk-nSS"/>
|
||||
</constraints>
|
||||
@@ -437,15 +449,15 @@
|
||||
<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="97A-aJ-4ms">
|
||||
<rect key="frame" x="20" y="20" width="374" height="20.5"/>
|
||||
<rect key="frame" x="20" y="20" width="374" height="20"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ybc-8d-6pJ">
|
||||
<rect key="frame" x="20" y="62.5" width="374" height="779.5"/>
|
||||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ybc-8d-6pJ">
|
||||
<rect key="frame" x="20" y="62" width="374" height="780"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="N7f-vi-SFU">
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="N7f-vi-SFU">
|
||||
<rect key="frame" x="0.0" y="-15.5" width="374" height="811"/>
|
||||
<subviews>
|
||||
<datePicker multipleTouchEnabled="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="time" minuteInterval="1" style="wheels" translatesAutoresizingMaskIntoConstraints="NO" id="qSt-1V-2DQ">
|
||||
@@ -586,8 +598,11 @@
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="N7f-vi-SFU" firstAttribute="centerX" secondItem="ybc-8d-6pJ" secondAttribute="centerX" id="9sw-RP-ShH"/>
|
||||
<constraint firstItem="N7f-vi-SFU" firstAttribute="centerY" secondItem="ybc-8d-6pJ" secondAttribute="centerY" id="FUJ-kg-rEj"/>
|
||||
<constraint firstAttribute="trailing" secondItem="N7f-vi-SFU" secondAttribute="trailing" id="W7k-vp-Dh9"/>
|
||||
<constraint firstItem="N7f-vi-SFU" firstAttribute="leading" secondItem="ybc-8d-6pJ" secondAttribute="leading" id="emg-h4-yvU"/>
|
||||
<constraint firstItem="N7f-vi-SFU" firstAttribute="top" secondItem="ybc-8d-6pJ" secondAttribute="top" constant="-15.5" id="tdx-PC-7su"/>
|
||||
<constraint firstAttribute="bottom" secondItem="N7f-vi-SFU" secondAttribute="bottom" constant="-16" id="uBK-cD-VCh"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="contentLayoutGuide" id="Uk6-Oc-bJw"/>
|
||||
<viewLayoutGuide key="frameLayoutGuide" id="LfY-uk-G49"/>
|
||||
@@ -676,6 +691,20 @@
|
||||
<constraint firstItem="eTb-g7-8x3" firstAttribute="top" secondItem="CZ0-R6-FDq" secondAttribute="bottom" constant="20" id="yME-j6-vSk"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zph-rd-rPI" userLabel="shakeView">
|
||||
<rect key="frame" x="87" y="357" width="240" height="128"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nK2-jK-GsP">
|
||||
<rect key="frame" x="99" y="53" 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>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NmX-iJ-1D0" userLabel="rpsView">
|
||||
<rect key="frame" x="20" y="338.5" width="374" height="165"/>
|
||||
<subviews>
|
||||
@@ -759,6 +788,7 @@
|
||||
<outlet property="puzzleView" destination="OMQ-qK-fej" id="KLT-oe-RJX"/>
|
||||
<outlet property="rpsResult" destination="HEP-oh-VSY" id="W2G-eZ-mzI"/>
|
||||
<outlet property="rpsView" destination="NmX-iJ-1D0" id="Rhg-Hm-2Xx"/>
|
||||
<outlet property="shakeView" destination="Zph-rd-rPI" id="aJ0-W7-cAV"/>
|
||||
<outlet property="timeLabel" destination="vmg-Oj-8tB" id="FJJ-No-dwF"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
@@ -1021,7 +1051,7 @@
|
||||
<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="20" width="374" height="142"/>
|
||||
<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"/>
|
||||
@@ -1071,13 +1101,31 @@
|
||||
</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="EoV-eE-GYj" firstAttribute="top" secondItem="Gjo-27-xML" secondAttribute="top" constant="20" id="dFi-T2-Ziw"/>
|
||||
<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"/>
|
||||
@@ -1092,6 +1140,75 @@
|
||||
</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="ProjectClock" 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>
|
||||
@@ -1119,13 +1236,16 @@
|
||||
<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="cell" rowHeight="66" id="PpM-BI-Arz">
|
||||
<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>
|
||||
@@ -1248,11 +1368,6 @@
|
||||
<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>
|
||||
<variation key="default">
|
||||
<mask key="subviews">
|
||||
<exclude reference="yB2-sF-tqs"/>
|
||||
</mask>
|
||||
</variation>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="6by-4V-XuW"/>
|
||||
<connections>
|
||||
|
||||
@@ -10,6 +10,9 @@ import UserNotifications
|
||||
|
||||
class DebugViewController: UIViewController
|
||||
{
|
||||
@IBOutlet weak var userModeButton: UIButton!
|
||||
var darkMode = false
|
||||
|
||||
override func viewDidLoad()
|
||||
{
|
||||
super.viewDidLoad()
|
||||
@@ -43,4 +46,16 @@ class DebugViewController: UIViewController
|
||||
{
|
||||
Alarms.fromLocal().apply { $0.list.removeAll() }.localSave()
|
||||
}
|
||||
|
||||
@IBAction func switchViewingMode(_ sender: Any) {
|
||||
if !darkMode {
|
||||
view.window?.overrideUserInterfaceStyle = .dark
|
||||
userModeButton.setTitle("Switch to Light Mode", for: .normal)
|
||||
darkMode = true
|
||||
} else {
|
||||
view.window?.overrideUserInterfaceStyle = .light
|
||||
userModeButton.setTitle("Switch to Dark Mode", for: .normal)
|
||||
darkMode = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,6 +198,7 @@ class RPS {
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
//Reference: https://youtu.be/XDuchXYiWuE
|
||||
class Shake {
|
||||
var motionManager = CMMotionManager()
|
||||
@@ -214,3 +215,4 @@ class Shake {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -40,6 +40,7 @@ struct WVM: Codable
|
||||
let wvms = [
|
||||
WVM(name: "Factor", desc: "Factor a binomial"),
|
||||
WVM(name: "RPS", desc: "Win a game of rock paper scissors"),
|
||||
WVM(name: "Shake", desc: "Shake your phone... aggresively!"),
|
||||
//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")
|
||||
|
||||
@@ -10,6 +10,9 @@ import CoreMotion
|
||||
import UserNotifications
|
||||
import UIKit
|
||||
|
||||
var motionManager = CMMotionManager()
|
||||
var regulate = true
|
||||
|
||||
func walkAction() {
|
||||
|
||||
}
|
||||
@@ -18,6 +21,23 @@ func jumpAction() {
|
||||
|
||||
}
|
||||
|
||||
func shakeAction() {
|
||||
regulate = true
|
||||
|
||||
while regulate {
|
||||
motionManager.accelerometerUpdateInterval = 0.2
|
||||
|
||||
motionManager.startAccelerometerUpdates(to: OperationQueue.current!) { (data,error) in
|
||||
if let myData = data {
|
||||
if myData.acceleration.x > 5 {
|
||||
print("DO SOMETHING SPECIAL")
|
||||
regulate = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func rpsAction(choice: RPS.Choice) -> Bool? {
|
||||
let rps = RPS()
|
||||
return rps.playRPS(you: choice, computer: RPS.randomComputerChoice())
|
||||
|
||||