Merge branch 'main' of github.com:hykilpikonna/ProjectClock into main
This commit is contained in:
@@ -18,16 +18,28 @@ class AddAlarmViewController: UIViewController
|
|||||||
scrollView.contentSize = scrollViewInner.frame.size
|
scrollView.contentSize = scrollViewInner.frame.size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@IBOutlet weak var repeatWeekdaysSwitch: UISwitch!
|
||||||
|
@IBOutlet weak var repeatWeekendsSwitch: UISwitch!
|
||||||
|
|
||||||
|
|
||||||
// Pickers
|
// Pickers
|
||||||
@IBOutlet weak var timePicker: UIDatePicker!
|
@IBOutlet weak var timePicker: UIDatePicker!
|
||||||
@IBOutlet weak var wvmPicker: UIPickerView!
|
@IBOutlet weak var wvmPicker: UIPickerView!
|
||||||
|
|
||||||
|
@IBAction func defaultRingtonesButton(_ sender: Any) {
|
||||||
|
}
|
||||||
|
@IBAction func soundLibraryButton(_ sender: Any) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override func viewDidLoad()
|
override func viewDidLoad()
|
||||||
{
|
{
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class WVMDataSource: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource
|
class WVMDataSource: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource
|
||||||
{
|
{
|
||||||
required init?(coder: NSCoder)
|
required init?(coder: NSCoder)
|
||||||
|
|||||||
@@ -61,12 +61,27 @@ class AlarmTableCell: UITableViewCell
|
|||||||
@IBOutlet weak var goingOffText: UILabel!
|
@IBOutlet weak var goingOffText: UILabel!
|
||||||
|
|
||||||
/// Update information on the cell to information in the alarm object
|
/// Update information on the cell to information in the alarm object
|
||||||
|
//WARNING:Terrible code lies ahead! You WILL be dissapointed! But it works, and that is all that matters.
|
||||||
|
|
||||||
func setData(_ alarm: Alarm)
|
func setData(_ alarm: Alarm)
|
||||||
{
|
{
|
||||||
descriptionText.text = "- " + alarm.text
|
descriptionText.text = "- " + alarm.text
|
||||||
|
ampm.text = alarm.hour<12 || alarm.hour==24 ? "AM":"PM"
|
||||||
if alarm.enabled, let n = alarm.nextActivate
|
time.text = alarm.minute<10 ? "\(alarm.hour)" + ":" + "0" + "\(alarm.minute)":"\(alarm.hour)" + ":" + "\(alarm.minute)"
|
||||||
{
|
|
||||||
|
// displays the specific days alarm is activated
|
||||||
|
let daysDict = [0: "Mon", 1: "Tues", 2: "Wed", 3: "Thurs", 4: "Fri", 5: "Sat", 6: "Sun"]
|
||||||
|
var daysActive : [String] = []
|
||||||
|
if alarm.oneTime {repeatText.text = "No Repeat"}
|
||||||
|
else{
|
||||||
|
for (index, element) in alarm.repeats.enumerated(){
|
||||||
|
if element{
|
||||||
|
daysActive.append(daysDict[index] ?? "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repeatText.text = daysActive.joined(separator: ", ")
|
||||||
|
}
|
||||||
|
if alarm.enabled, let n = alarm.nextActivate{
|
||||||
goingOffText.text = "(Going off in \(n.timeIntervalSince(Date()).str()))"
|
goingOffText.text = "(Going off in \(n.timeIntervalSince(Date()).str()))"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -458,10 +458,16 @@
|
|||||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cZ8-yN-fp6">
|
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cZ8-yN-fp6">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="374" height="30"/>
|
<rect key="frame" x="0.0" y="0.0" width="374" height="30"/>
|
||||||
<state key="normal" title="Pick From iOS Default Ringtones"/>
|
<state key="normal" title="Pick From iOS Default Ringtones"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="defaultRingtonesButton:" destination="Mki-dC-5Kc" eventType="touchUpInside" id="0oM-fE-Gyh"/>
|
||||||
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="A3Z-Qp-XmN">
|
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="A3Z-Qp-XmN">
|
||||||
<rect key="frame" x="0.0" y="30" width="374" height="30"/>
|
<rect key="frame" x="0.0" y="30" width="374" height="30"/>
|
||||||
<state key="normal" title="Pick From Sound Library"/>
|
<state key="normal" title="Pick From Sound Library"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="soundLibraryButton:" destination="Mki-dC-5Kc" eventType="touchUpInside" id="5G8-FV-bDx"/>
|
||||||
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
</subviews>
|
</subviews>
|
||||||
</stackView>
|
</stackView>
|
||||||
@@ -575,6 +581,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<navigationItem key="navigationItem" id="Ydw-dw-vLC"/>
|
<navigationItem key="navigationItem" id="Ydw-dw-vLC"/>
|
||||||
<connections>
|
<connections>
|
||||||
|
<outlet property="repeatWeekdaysSwitch" destination="5oN-BL-Xtu" id="gqb-l3-1jZ"/>
|
||||||
|
<outlet property="repeatWeekendsSwitch" destination="WPM-Fh-sRB" id="LB7-zW-jpC"/>
|
||||||
<outlet property="scrollView" destination="ybc-8d-6pJ" id="m1B-ff-zeC"/>
|
<outlet property="scrollView" destination="ybc-8d-6pJ" id="m1B-ff-zeC"/>
|
||||||
<outlet property="scrollViewInner" destination="N7f-vi-SFU" id="LQW-6T-f6x"/>
|
<outlet property="scrollViewInner" destination="N7f-vi-SFU" id="LQW-6T-f6x"/>
|
||||||
<outlet property="timePicker" destination="qSt-1V-2DQ" id="aDM-jE-0OP"/>
|
<outlet property="timePicker" destination="qSt-1V-2DQ" id="aDM-jE-0OP"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user