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
|
||||
}
|
||||
|
||||
@IBOutlet weak var repeatWeekdaysSwitch: UISwitch!
|
||||
@IBOutlet weak var repeatWeekendsSwitch: UISwitch!
|
||||
|
||||
|
||||
// Pickers
|
||||
@IBOutlet weak var timePicker: UIDatePicker!
|
||||
@IBOutlet weak var wvmPicker: UIPickerView!
|
||||
|
||||
@IBAction func defaultRingtonesButton(_ sender: Any) {
|
||||
}
|
||||
@IBAction func soundLibraryButton(_ sender: Any) {
|
||||
}
|
||||
|
||||
|
||||
override func viewDidLoad()
|
||||
{
|
||||
super.viewDidLoad()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class WVMDataSource: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource
|
||||
{
|
||||
required init?(coder: NSCoder)
|
||||
|
||||
@@ -61,12 +61,27 @@ class AlarmTableCell: UITableViewCell
|
||||
@IBOutlet weak var goingOffText: UILabel!
|
||||
|
||||
/// 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)
|
||||
{
|
||||
descriptionText.text = "- " + alarm.text
|
||||
|
||||
if alarm.enabled, let n = alarm.nextActivate
|
||||
{
|
||||
ampm.text = alarm.hour<12 || alarm.hour==24 ? "AM":"PM"
|
||||
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()))"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,10 +458,16 @@
|
||||
<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"/>
|
||||
<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 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"/>
|
||||
<state key="normal" title="Pick From Sound Library"/>
|
||||
<connections>
|
||||
<action selector="soundLibraryButton:" destination="Mki-dC-5Kc" eventType="touchUpInside" id="5G8-FV-bDx"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</stackView>
|
||||
@@ -575,6 +581,8 @@
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="Ydw-dw-vLC"/>
|
||||
<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="scrollViewInner" destination="N7f-vi-SFU" id="LQW-6T-f6x"/>
|
||||
<outlet property="timePicker" destination="qSt-1V-2DQ" id="aDM-jE-0OP"/>
|
||||
|
||||
Reference in New Issue
Block a user