[+] Play sound when alarm is activated
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
//
|
||||||
|
// AlarmActivationViewController.swift
|
||||||
|
// ProjectClock
|
||||||
|
//
|
||||||
|
// Created by Hykilpikonna on 1/17/21.
|
||||||
|
//
|
||||||
|
|
||||||
|
import UIKit
|
||||||
|
import AVFoundation
|
||||||
|
|
||||||
|
class AlarmActivationViewController: UIViewController
|
||||||
|
{
|
||||||
|
override func viewDidLoad()
|
||||||
|
{
|
||||||
|
super.viewDidLoad()
|
||||||
|
AudioServicesPlayAlertSound(SystemSoundID(1005))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -592,15 +592,37 @@
|
|||||||
</objects>
|
</objects>
|
||||||
<point key="canvasLocation" x="-494" y="1576"/>
|
<point key="canvasLocation" x="-494" y="1576"/>
|
||||||
</scene>
|
</scene>
|
||||||
<!--View Controller-->
|
<!--Alarm Activation View Controller-->
|
||||||
<scene sceneID="21H-AI-pzd">
|
<scene sceneID="21H-AI-pzd">
|
||||||
<objects>
|
<objects>
|
||||||
<viewController id="hDW-11-g9U" sceneMemberID="viewController">
|
<viewController id="hDW-11-g9U" customClass="AlarmActivationViewController" customModule="ProjectClock" customModuleProvider="target" sceneMemberID="viewController">
|
||||||
<view key="view" contentMode="scaleToFill" id="BZn-UX-vps">
|
<view key="view" contentMode="scaleToFill" id="BZn-UX-vps">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="842"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="842"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="17:40" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vmg-Oj-8tB">
|
||||||
|
<rect key="frame" x="20" y="20" width="374" height="137.33333333333334"/>
|
||||||
|
<fontDescription key="fontDescription" type="system" weight="thin" pointSize="115"/>
|
||||||
|
<nil key="textColor"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Jan 17, Sunday" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="42Q-0v-ZS3">
|
||||||
|
<rect key="frame" x="20" y="152.33333333333334" width="374" height="25.333333333333343"/>
|
||||||
|
<fontDescription key="fontDescription" type="system" pointSize="21"/>
|
||||||
|
<nil key="textColor"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
</subviews>
|
||||||
<viewLayoutGuide key="safeArea" id="hS6-fS-yWp"/>
|
<viewLayoutGuide key="safeArea" id="hS6-fS-yWp"/>
|
||||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="vmg-Oj-8tB" firstAttribute="top" secondItem="hS6-fS-yWp" secondAttribute="top" constant="20" id="5lz-9m-i9F"/>
|
||||||
|
<constraint firstItem="vmg-Oj-8tB" firstAttribute="leading" secondItem="hS6-fS-yWp" secondAttribute="leading" constant="20" id="7fm-Y8-FaE"/>
|
||||||
|
<constraint firstItem="42Q-0v-ZS3" firstAttribute="top" secondItem="vmg-Oj-8tB" secondAttribute="bottom" constant="-5" id="GNM-uI-sQt"/>
|
||||||
|
<constraint firstItem="hS6-fS-yWp" firstAttribute="trailing" secondItem="42Q-0v-ZS3" secondAttribute="trailing" constant="20" id="L1F-Bv-r5M"/>
|
||||||
|
<constraint firstItem="42Q-0v-ZS3" firstAttribute="leading" secondItem="hS6-fS-yWp" secondAttribute="leading" constant="20" id="Nbf-jB-Uq5"/>
|
||||||
|
<constraint firstItem="hS6-fS-yWp" firstAttribute="trailing" secondItem="vmg-Oj-8tB" secondAttribute="trailing" constant="20" id="vVE-ID-dgj"/>
|
||||||
|
</constraints>
|
||||||
</view>
|
</view>
|
||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="78q-sr-CNz" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="78q-sr-CNz" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user