Browse Source

Revert location changes.

master
Abhishek Banthia 1 year ago
parent
commit
00e0d27967
  1. 1
      Clocker/Clocker/LocationController.swift
  2. 81
      Clocker/Onboarding/Onboarding.storyboard
  3. 59
      Clocker/Onboarding/OnboardingPermissionsViewController.swift

1
Clocker/Clocker/LocationController.swift

@ -118,7 +118,6 @@ extension LocationController: CLLocationManagerDelegate {
} else if status == .notDetermined || status == .authorized || status == .authorizedAlways { } else if status == .notDetermined || status == .authorized || status == .authorizedAlways {
locationManager.startUpdatingLocation() locationManager.startUpdatingLocation()
} }
delegate?.didChangeAuthorizationStatus()
} }
func locationManager(_: CLLocationManager, didFailWithError error: Error) { func locationManager(_: CLLocationManager, didFailWithError error: Error) {

81
Clocker/Onboarding/Onboarding.storyboard

@ -168,10 +168,10 @@ DQ
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="mF9-1w-sxR"> <customView translatesAutoresizingMaskIntoConstraints="NO" id="mF9-1w-sxR">
<rect key="frame" x="20" y="214" width="396" height="70"/> <rect key="frame" x="20" y="184" width="396" height="100"/>
<subviews> <subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="Lef-GT-zuM"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="Lef-GT-zuM">
<rect key="frame" x="8" y="42" width="157" height="18"/> <rect key="frame" x="8" y="72" width="157" height="18"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="Reminders Access Header" id="QiB-Um-yjg"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="Reminders Access Header" id="QiB-Um-yjg">
<font key="font" size="13" name="Avenir-Roman"/> <font key="font" size="13" name="Avenir-Roman"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -179,7 +179,7 @@ DQ
</textFieldCell> </textFieldCell>
</textField> </textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="O0s-Bu-IPq"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="O0s-Bu-IPq">
<rect key="frame" x="310" y="32" width="73" height="32"/> <rect key="frame" x="310" y="62" width="73" height="32"/>
<buttonCell key="cell" type="push" title="Action" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="BW3-qu-NiR"> <buttonCell key="cell" type="push" title="Action" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="BW3-qu-NiR">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
@ -189,7 +189,7 @@ DQ
</connections> </connections>
</button> </button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="gHR-Pd-9pP"> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="gHR-Pd-9pP">
<rect key="frame" x="8" y="5" width="370" height="27"/> <rect key="frame" x="8" y="5" width="370" height="57"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" placeholderString="Reminder Access Detail" id="zbc-CH-UBI"> <textFieldCell key="cell" sendsActionOnEndEditing="YES" placeholderString="Reminder Access Detail" id="zbc-CH-UBI">
<font key="font" size="12" name="Avenir-Book"/> <font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -197,7 +197,7 @@ DQ
</textFieldCell> </textFieldCell>
</textField> </textField>
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="Zhi-9z-C2u"> <progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="Zhi-9z-C2u">
<rect key="frame" x="261" y="41" width="16" height="16"/> <rect key="frame" x="261" y="71" width="16" height="16"/>
</progressIndicator> </progressIndicator>
</subviews> </subviews>
<constraints> <constraints>
@ -208,17 +208,17 @@ DQ
<constraint firstItem="O0s-Bu-IPq" firstAttribute="centerY" secondItem="Lef-GT-zuM" secondAttribute="centerY" constant="2" id="SVr-hp-EwO"/> <constraint firstItem="O0s-Bu-IPq" firstAttribute="centerY" secondItem="Lef-GT-zuM" secondAttribute="centerY" constant="2" id="SVr-hp-EwO"/>
<constraint firstAttribute="bottom" secondItem="gHR-Pd-9pP" secondAttribute="bottom" constant="5" id="Wrw-Yt-aph"/> <constraint firstAttribute="bottom" secondItem="gHR-Pd-9pP" secondAttribute="bottom" constant="5" id="Wrw-Yt-aph"/>
<constraint firstItem="Zhi-9z-C2u" firstAttribute="centerY" secondItem="Lef-GT-zuM" secondAttribute="centerY" constant="2" id="eav-2d-uIg"/> <constraint firstItem="Zhi-9z-C2u" firstAttribute="centerY" secondItem="Lef-GT-zuM" secondAttribute="centerY" constant="2" id="eav-2d-uIg"/>
<constraint firstAttribute="height" constant="70" id="nFN-Hi-RLw"/> <constraint firstAttribute="height" constant="100" id="nFN-Hi-RLw"/>
<constraint firstAttribute="trailing" secondItem="O0s-Bu-IPq" secondAttribute="trailing" constant="20" id="rLh-fW-vXY"/> <constraint firstAttribute="trailing" secondItem="O0s-Bu-IPq" secondAttribute="trailing" constant="20" id="rLh-fW-vXY"/>
<constraint firstAttribute="trailing" secondItem="gHR-Pd-9pP" secondAttribute="trailing" constant="20" id="u0N-ro-Kbt"/> <constraint firstAttribute="trailing" secondItem="gHR-Pd-9pP" secondAttribute="trailing" constant="20" id="u0N-ro-Kbt"/>
<constraint firstItem="O0s-Bu-IPq" firstAttribute="leading" secondItem="Zhi-9z-C2u" secondAttribute="trailing" constant="40" id="zrX-jL-yyZ"/> <constraint firstItem="O0s-Bu-IPq" firstAttribute="leading" secondItem="Zhi-9z-C2u" secondAttribute="trailing" constant="40" id="zrX-jL-yyZ"/>
</constraints> </constraints>
</customView> </customView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="4eB-eD-0jK"> <customView translatesAutoresizingMaskIntoConstraints="NO" id="4eB-eD-0jK">
<rect key="frame" x="20" y="124" width="396" height="70"/> <rect key="frame" x="20" y="64" width="396" height="100"/>
<subviews> <subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="noJ-fx-c1b"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="noJ-fx-c1b">
<rect key="frame" x="8" y="42" width="148" height="18"/> <rect key="frame" x="8" y="48" width="148" height="42"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="Calendar Access Header" id="cXW-N9-WyD"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="Calendar Access Header" id="cXW-N9-WyD">
<font key="font" size="13" name="Avenir-Roman"/> <font key="font" size="13" name="Avenir-Roman"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -226,7 +226,7 @@ DQ
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="749" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="wcB-cI-R4k"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="749" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="wcB-cI-R4k">
<rect key="frame" x="8" y="20" width="370" height="12"/> <rect key="frame" x="8" y="20" width="370" height="18"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="leO-6q-mRB"> <textFieldCell key="cell" sendsActionOnEndEditing="YES" id="leO-6q-mRB">
<font key="font" size="13" name="Avenir-Book"/> <font key="font" size="13" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -234,7 +234,7 @@ DQ
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="DgE-EN-bNM"> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="DgE-EN-bNM">
<rect key="frame" x="8" y="10" width="380" height="22"/> <rect key="frame" x="8" y="10" width="380" height="28"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" placeholderString="Calendar Access Detail" id="RpL-I6-iJq"> <textFieldCell key="cell" sendsActionOnEndEditing="YES" placeholderString="Calendar Access Detail" id="RpL-I6-iJq">
<font key="font" size="12" name="Avenir-Book"/> <font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -242,7 +242,7 @@ DQ
</textFieldCell> </textFieldCell>
</textField> </textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dI2-oA-MBA"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dI2-oA-MBA">
<rect key="frame" x="310" y="34" width="73" height="32"/> <rect key="frame" x="310" y="52" width="73" height="32"/>
<buttonCell key="cell" type="push" title="Action" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="i5r-db-Pnw"> <buttonCell key="cell" type="push" title="Action" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="i5r-db-Pnw">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
@ -252,7 +252,7 @@ DQ
</connections> </connections>
</button> </button>
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="0GH-vY-2Du"> <progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="0GH-vY-2Du">
<rect key="frame" x="261" y="43" width="16" height="16"/> <rect key="frame" x="261" y="61" width="16" height="16"/>
</progressIndicator> </progressIndicator>
</subviews> </subviews>
<constraints> <constraints>
@ -266,7 +266,7 @@ DQ
<constraint firstItem="wcB-cI-R4k" firstAttribute="leading" secondItem="4eB-eD-0jK" secondAttribute="leading" constant="10" id="TKR-N9-vwe"/> <constraint firstItem="wcB-cI-R4k" firstAttribute="leading" secondItem="4eB-eD-0jK" secondAttribute="leading" constant="10" id="TKR-N9-vwe"/>
<constraint firstAttribute="bottom" secondItem="DgE-EN-bNM" secondAttribute="bottom" constant="10" id="V7u-1h-Wao"/> <constraint firstAttribute="bottom" secondItem="DgE-EN-bNM" secondAttribute="bottom" constant="10" id="V7u-1h-Wao"/>
<constraint firstItem="dI2-oA-MBA" firstAttribute="leading" secondItem="0GH-vY-2Du" secondAttribute="trailing" constant="40" id="Xfh-FQ-K5c"/> <constraint firstItem="dI2-oA-MBA" firstAttribute="leading" secondItem="0GH-vY-2Du" secondAttribute="trailing" constant="40" id="Xfh-FQ-K5c"/>
<constraint firstAttribute="height" constant="70" id="aAs-sr-I65"/> <constraint firstAttribute="height" constant="100" id="aAs-sr-I65"/>
<constraint firstAttribute="bottom" secondItem="wcB-cI-R4k" secondAttribute="bottom" constant="20" id="dNh-UY-vd5"/> <constraint firstAttribute="bottom" secondItem="wcB-cI-R4k" secondAttribute="bottom" constant="20" id="dNh-UY-vd5"/>
<constraint firstItem="noJ-fx-c1b" firstAttribute="leading" secondItem="4eB-eD-0jK" secondAttribute="leading" constant="10" id="g3a-hl-jaM"/> <constraint firstItem="noJ-fx-c1b" firstAttribute="leading" secondItem="4eB-eD-0jK" secondAttribute="leading" constant="10" id="g3a-hl-jaM"/>
<constraint firstItem="0GH-vY-2Du" firstAttribute="centerY" secondItem="dI2-oA-MBA" secondAttribute="centerY" id="gSx-8h-MYg"/> <constraint firstItem="0GH-vY-2Du" firstAttribute="centerY" secondItem="dI2-oA-MBA" secondAttribute="centerY" id="gSx-8h-MYg"/>
@ -297,65 +297,15 @@ DQ
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="9um-4T-X2f">
<rect key="frame" x="20" y="34" width="396" height="70"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SgA-b8-eJs">
<rect key="frame" x="8" y="42" width="145" height="18"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="Location Access Header" id="7pI-Kk-oBQ">
<font key="font" size="13" name="Avenir-Roman"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="749" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="9Ie-8h-fWA">
<rect key="frame" x="8" y="10" width="380" height="22"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" placeholderString="Location Access Detail" id="Zoo-Zk-g9u">
<font key="font" size="12" name="Avenir-Book"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="Sen-hp-UcJ">
<rect key="frame" x="261" y="43" width="16" height="16"/>
</progressIndicator>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6uz-cF-WQm">
<rect key="frame" x="310" y="34" width="73" height="32"/>
<buttonCell key="cell" type="push" title="Action" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="nwp-cj-6Tb">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="locationAction:" target="HDG-wD-Hct" id="AFX-SQ-eUZ"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="9Ie-8h-fWA" firstAttribute="leading" secondItem="9um-4T-X2f" secondAttribute="leading" constant="10" id="1hB-n7-9D2"/>
<constraint firstItem="SgA-b8-eJs" firstAttribute="leading" secondItem="9um-4T-X2f" secondAttribute="leading" constant="10" id="83R-jt-hd4"/>
<constraint firstItem="SgA-b8-eJs" firstAttribute="top" secondItem="9um-4T-X2f" secondAttribute="top" constant="10" id="DDs-lc-yQ2"/>
<constraint firstItem="6uz-cF-WQm" firstAttribute="leading" secondItem="Sen-hp-UcJ" secondAttribute="trailing" constant="40" id="Hwz-51-ghV"/>
<constraint firstAttribute="trailing" secondItem="6uz-cF-WQm" secondAttribute="trailing" constant="20" id="KBv-zG-HBf"/>
<constraint firstAttribute="bottom" secondItem="9Ie-8h-fWA" secondAttribute="bottom" constant="10" id="NgL-7j-3ds"/>
<constraint firstAttribute="trailing" secondItem="9Ie-8h-fWA" secondAttribute="trailing" constant="10" id="OF7-Zm-3kj"/>
<constraint firstItem="Sen-hp-UcJ" firstAttribute="centerY" secondItem="6uz-cF-WQm" secondAttribute="centerY" id="bij-v4-plx"/>
<constraint firstItem="9Ie-8h-fWA" firstAttribute="top" secondItem="SgA-b8-eJs" secondAttribute="bottom" constant="10" id="e6V-lF-wMa"/>
<constraint firstItem="6uz-cF-WQm" firstAttribute="centerY" secondItem="SgA-b8-eJs" secondAttribute="centerY" id="rsA-pg-jx6"/>
<constraint firstAttribute="height" constant="70" id="twS-2k-pnz"/>
</constraints>
</customView>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="iMf-Uy-zAf" firstAttribute="top" secondItem="pC3-D3-DSa" secondAttribute="bottom" constant="-5" id="1U9-K8-Cis"/> <constraint firstItem="iMf-Uy-zAf" firstAttribute="top" secondItem="pC3-D3-DSa" secondAttribute="bottom" constant="-5" id="1U9-K8-Cis"/>
<constraint firstAttribute="trailing" secondItem="mF9-1w-sxR" secondAttribute="trailing" constant="20" id="6Eh-Fo-RdG"/> <constraint firstAttribute="trailing" secondItem="mF9-1w-sxR" secondAttribute="trailing" constant="20" id="6Eh-Fo-RdG"/>
<constraint firstItem="iMf-Uy-zAf" firstAttribute="leading" secondItem="pC3-D3-DSa" secondAttribute="leading" constant="2" id="70x-kK-e8k"/> <constraint firstItem="iMf-Uy-zAf" firstAttribute="leading" secondItem="pC3-D3-DSa" secondAttribute="leading" constant="2" id="70x-kK-e8k"/>
<constraint firstItem="4eB-eD-0jK" firstAttribute="leading" secondItem="mF9-1w-sxR" secondAttribute="leading" id="HVv-ry-gqb"/> <constraint firstItem="4eB-eD-0jK" firstAttribute="leading" secondItem="mF9-1w-sxR" secondAttribute="leading" id="HVv-ry-gqb"/>
<constraint firstItem="9um-4T-X2f" firstAttribute="leading" secondItem="4eB-eD-0jK" secondAttribute="leading" id="KSZ-EO-1Ot"/>
<constraint firstItem="9um-4T-X2f" firstAttribute="top" secondItem="4eB-eD-0jK" secondAttribute="bottom" constant="20" id="Mpb-0A-bFX"/>
<constraint firstItem="XfU-36-tPs" firstAttribute="top" secondItem="sib-OR-ym5" secondAttribute="top" constant="20" id="Ps0-DI-VvS"/> <constraint firstItem="XfU-36-tPs" firstAttribute="top" secondItem="sib-OR-ym5" secondAttribute="top" constant="20" id="Ps0-DI-VvS"/>
<constraint firstItem="4eB-eD-0jK" firstAttribute="trailing" secondItem="mF9-1w-sxR" secondAttribute="trailing" id="Twh-8s-2qe"/> <constraint firstItem="4eB-eD-0jK" firstAttribute="trailing" secondItem="mF9-1w-sxR" secondAttribute="trailing" id="Twh-8s-2qe"/>
<constraint firstItem="mF9-1w-sxR" firstAttribute="top" secondItem="iMf-Uy-zAf" secondAttribute="bottom" constant="40" id="X3I-8c-Qgd"/> <constraint firstItem="mF9-1w-sxR" firstAttribute="top" secondItem="iMf-Uy-zAf" secondAttribute="bottom" constant="40" id="X3I-8c-Qgd"/>
<constraint firstItem="9um-4T-X2f" firstAttribute="trailing" secondItem="4eB-eD-0jK" secondAttribute="trailing" id="dd3-9x-yz8"/>
<constraint firstItem="4eB-eD-0jK" firstAttribute="top" secondItem="mF9-1w-sxR" secondAttribute="bottom" constant="20" id="eDT-5v-xZY"/> <constraint firstItem="4eB-eD-0jK" firstAttribute="top" secondItem="mF9-1w-sxR" secondAttribute="bottom" constant="20" id="eDT-5v-xZY"/>
<constraint firstItem="pC3-D3-DSa" firstAttribute="leading" secondItem="XfU-36-tPs" secondAttribute="trailing" constant="20" id="lUs-se-BHO"/> <constraint firstItem="pC3-D3-DSa" firstAttribute="leading" secondItem="XfU-36-tPs" secondAttribute="trailing" constant="20" id="lUs-se-BHO"/>
<constraint firstItem="XfU-36-tPs" firstAttribute="leading" secondItem="sib-OR-ym5" secondAttribute="leading" constant="20" id="o7n-nQ-6TG"/> <constraint firstItem="XfU-36-tPs" firstAttribute="leading" secondItem="sib-OR-ym5" secondAttribute="leading" constant="20" id="o7n-nQ-6TG"/>
@ -371,11 +321,6 @@ DQ
<outlet property="calendarGrantButton" destination="dI2-oA-MBA" id="kwb-fA-6hY"/> <outlet property="calendarGrantButton" destination="dI2-oA-MBA" id="kwb-fA-6hY"/>
<outlet property="calendarHeaderLabel" destination="noJ-fx-c1b" id="um0-dZ-q3r"/> <outlet property="calendarHeaderLabel" destination="noJ-fx-c1b" id="um0-dZ-q3r"/>
<outlet property="calendarView" destination="4eB-eD-0jK" id="jpn-uQ-Dk1"/> <outlet property="calendarView" destination="4eB-eD-0jK" id="jpn-uQ-Dk1"/>
<outlet property="locationActivityIndicator" destination="Sen-hp-UcJ" id="Pg3-mB-nxI"/>
<outlet property="locationDetailLabel" destination="9Ie-8h-fWA" id="v7D-Yc-ZBf"/>
<outlet property="locationGrantButton" destination="6uz-cF-WQm" id="wec-8h-Pj6"/>
<outlet property="locationHeaderLabel" destination="SgA-b8-eJs" id="GT4-Bv-oJ3"/>
<outlet property="locationView" destination="9um-4T-X2f" id="BMp-aJ-HdT"/>
<outlet property="onboardingTypeLabel" destination="iMf-Uy-zAf" id="saQ-ta-oT8"/> <outlet property="onboardingTypeLabel" destination="iMf-Uy-zAf" id="saQ-ta-oT8"/>
<outlet property="reminderActivityIndicator" destination="Zhi-9z-C2u" id="GRE-KJ-HT7"/> <outlet property="reminderActivityIndicator" destination="Zhi-9z-C2u" id="GRE-KJ-HT7"/>
<outlet property="reminderDetailLabel" destination="gHR-Pd-9pP" id="smO-us-iu1"/> <outlet property="reminderDetailLabel" destination="gHR-Pd-9pP" id="smO-us-iu1"/>

59
Clocker/Onboarding/OnboardingPermissionsViewController.swift

@ -6,7 +6,6 @@ import CoreLoggerKit
class OnboardingPermissionsViewController: NSViewController { class OnboardingPermissionsViewController: NSViewController {
@IBOutlet var reminderGrantButton: NSButton! @IBOutlet var reminderGrantButton: NSButton!
@IBOutlet var calendarGrantButton: NSButton! @IBOutlet var calendarGrantButton: NSButton!
@IBOutlet var locationGrantButton: NSButton!
@IBOutlet var reminderView: NSView! @IBOutlet var reminderView: NSView!
@IBOutlet var calendarView: NSView! @IBOutlet var calendarView: NSView!
@ -32,7 +31,7 @@ class OnboardingPermissionsViewController: NSViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
[calendarView, reminderView, locationView].forEach { $0?.applyShadow() } [calendarView, reminderView].forEach { $0?.applyShadow() }
setup() setup()
} }
@ -46,29 +45,25 @@ class OnboardingPermissionsViewController: NSViewController {
onboardingTypeLabel.stringValue = "Your data doesn't leave your device 🔐" onboardingTypeLabel.stringValue = "Your data doesn't leave your device 🔐"
reminderHeaderLabel.stringValue = NSLocalizedString("Reminders Access Title",comment: "Title for Reminders Access Label") reminderHeaderLabel.stringValue = NSLocalizedString("Reminders Access Title",comment: "Title for Reminders Access Label")
reminderDetailLabel.stringValue = "Set reminders in the timezone of the location of your choice." reminderDetailLabel.stringValue = "Set reminders in the timezone of the location of your choice. Your reminders are stored in the default Reminders app."
calendarHeaderLabel.stringValue = NSLocalizedString("Calendar Access Title",comment: "Title for Calendar access label") calendarHeaderLabel.stringValue = NSLocalizedString("Calendar Access Title",comment: "Title for Calendar access label")
calendarDetailLabel.stringValue = "Calendar Detail".localized() calendarDetailLabel.stringValue = "Calendar Detail".localized()
locationHeaderLabel.stringValue = "Location Access"
locationDetailLabel.stringValue = "Accurately track your local time; especially useful if you travel."
[calendarHeaderLabel, calendarDetailLabel, privacyLabel, reminderDetailLabel, reminderHeaderLabel, onboardingTypeLabel, appLabel].forEach { $0?.textColor = Themer.shared().mainTextColor() [calendarHeaderLabel, calendarDetailLabel, privacyLabel, reminderDetailLabel, reminderHeaderLabel, onboardingTypeLabel, appLabel].forEach { $0?.textColor = Themer.shared().mainTextColor()
} }
} }
private func setupButtons() { private func setupButtons() {
let locationController = LocationController.shared() // if LocationController.sharedInstance.locationAccessGranted() {
if locationController.locationAccessGranted() { // locationButton.title = "Granted"
locationGrantButton.title = "Granted" // } else if LocationController.sharedInstance.locationAccessDenied() {
} else if locationController.locationAccessDenied() { // locationButton.title = "Denied"
locationGrantButton.title = "Denied" // } else if LocationController.sharedInstance.locationAccessNotDetermined() {
} else if locationController.locationAccessNotDetermined() { // locationButton.title = "Grant"
locationGrantButton.title = "Grant" // } else {
} else { // locationButton.title = "Unexpected"
locationGrantButton.title = "Unexpected" // }
}
if EventCenter.sharedCenter().calendarAccessGranted() { if EventCenter.sharedCenter().calendarAccessGranted() {
calendarGrantButton.title = "Granted".localized() calendarGrantButton.title = "Granted".localized()
@ -153,36 +148,4 @@ class OnboardingPermissionsViewController: NSViewController {
reminderGrantButton.title = "Denied".localized() reminderGrantButton.title = "Denied".localized()
} }
} }
@IBAction func locationAction(_: NSButton) {
let locationController = LocationController.shared()
if locationController.locationAccessNotDetermined() {
locationController.delegate = self
locationActivityIndicator.startAnimation(nil)
locationController.determineAndRequestLocationAuthorization()
} else if locationController.locationAccessDenied() {
locationGrantButton.title = "Denied".localized()
} else if locationController.locationAccessGranted() {
locationGrantButton.title = "Granted".localized()
}
}
private func setupLocationButton() {
let locationController = LocationController.shared()
if locationController.locationAccessNotDetermined() {
locationGrantButton.title = "Grant".localized()
} else if locationController.locationAccessDenied() {
locationGrantButton.title = "Denied".localized()
} else if locationController.locationAccessGranted() {
locationGrantButton.title = "Granted".localized()
}
}
}
extension OnboardingPermissionsViewController: LocationControllerDelegate {
func didChangeAuthorizationStatus() {
locationActivityIndicator.stopAnimation(nil)
setupLocationButton()
}
} }

Loading…
Cancel
Save