Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add terms and conditions button in Sign Up VC #532

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Susi/Controllers/SignUpController/SignUpVCMethods.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,18 @@ extension SignUpViewController {
}
}
}

// Terms and Conditions button

func termsButtonClicked() {
termsAndCondButton.addTarget(self, action: #selector(performTandC), for: .touchUpInside)
}

@objc func performTandC() {

let termsURL = NSURL(string: "\(ControllerConstants.CommonURL.susiURL)\(ControllerConstants.Settings.privacy)")! as URL
UIApplication.shared.open(termsURL, options: [:], completionHandler: nil)
}

}

Expand Down
2 changes: 2 additions & 0 deletions Susi/Controllers/SignUpController/SignUpViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ class SignUpViewController: GeneralViewController {
}
}

@IBOutlet weak var termsAndCondButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
addTapGesture()
prepareFields()
prepareSignUpButton()
addDelegates()
termsButtonClicked()
}

override func localizeStrings() {
Expand Down
1 change: 1 addition & 0 deletions Susi/Helpers/ControllerConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class ControllerConstants {
static let miscellaneous = "Miscellaneous"
static let devices = "Devices"
static let about = "About Us"
static let privacy = "/privacy"
}

struct Login {
Expand Down
57 changes: 36 additions & 21 deletions Susi/Storyboards/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="fZv-XU-9rZ" customClass="TextField" customModule="Material">
<rect key="frame" x="16" y="93" width="343" height="30"/>
<rect key="frame" x="16" y="141" width="343" height="30"/>
<accessibility key="accessibilityConfiguration" identifier="email"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
Expand All @@ -338,7 +338,7 @@
</connections>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="N3z-41-ZBS" customClass="TextField" customModule="Material">
<rect key="frame" x="16" y="167" width="343" height="30"/>
<rect key="frame" x="16" y="215" width="343" height="30"/>
<accessibility key="accessibilityConfiguration" identifier="password"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
Expand All @@ -353,7 +353,7 @@
</connections>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="TcY-GF-sf2" customClass="TextField" customModule="Material">
<rect key="frame" x="16" y="241" width="343" height="30"/>
<rect key="frame" x="16" y="289" width="343" height="30"/>
<accessibility key="accessibilityConfiguration" identifier="confirmPassword"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
Expand All @@ -368,7 +368,7 @@
</connections>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="diq-Fb-8ST" customClass="RaisedButton" customModule="Material">
<rect key="frame" x="16" y="347" width="343" height="44"/>
<rect key="frame" x="16" y="395" width="343" height="44"/>
<color key="backgroundColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<accessibility key="accessibilityConfiguration" identifier="signUp"/>
<constraints>
Expand All @@ -379,15 +379,15 @@
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jll-vc-Hx1">
<rect key="frame" x="6" y="44" width="24" height="24"/>
<rect key="frame" x="6" y="44" width="72" height="72"/>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<state key="normal" image="back_arrow"/>
<connections>
<action selector="dismissView" destination="Azo-Yr-Z9r" eventType="touchUpInside" id="ejq-6B-l2r"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mlz-rv-BcH" customClass="M13Checkbox" customModule="M13Checkbox">
<rect key="frame" x="16" y="301" width="24" height="24"/>
<rect key="frame" x="16" y="349" width="24" height="24"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
Expand Down Expand Up @@ -418,7 +418,7 @@
</connections>
</view>
<textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="j46-3i-Hj3" customClass="TextField" customModule="Material">
<rect key="frame" x="48" y="297" width="311" height="30"/>
<rect key="frame" x="48" y="345" width="311" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="4PP-I0-LPd"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="30" id="sZd-Mv-gyk"/>
Expand All @@ -431,24 +431,38 @@
</userDefinedRuntimeAttributes>
</textField>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="whiteLarge" translatesAutoresizingMaskIntoConstraints="NO" id="8w1-Me-Ajd">
<rect key="frame" x="142" y="408" width="92" height="37"/>
<rect key="frame" x="142" y="456" width="92" height="37"/>
</activityIndicatorView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5nt-mi-ZZZ">
<rect key="frame" x="16" y="723" width="343" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="34" id="Hdz-Kq-uFQ"/>
<constraint firstAttribute="width" constant="343" id="YgA-vf-GCN"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" title="Terms and Conditions">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" name="iOSBlue"/>
<color key="tintColor" name="iOSBlue"/>
<constraints>
<constraint firstItem="8w1-Me-Ajd" firstAttribute="leading" secondItem="E81-H1-y6d" secondAttribute="leadingMargin" constant="126" id="331-KH-2Qa"/>
<constraint firstItem="8w1-Me-Ajd" firstAttribute="leading" secondItem="E81-H1-y6d" secondAttribute="leadingMargin" constant="126" id="4Kl-21-Nmj"/>
<constraint firstItem="TcY-GF-sf2" firstAttribute="trailing" secondItem="E81-H1-y6d" secondAttribute="trailingMargin" id="5of-Dl-Uy0"/>
<constraint firstItem="5nt-mi-ZZZ" firstAttribute="trailing" secondItem="E81-H1-y6d" secondAttribute="trailingMargin" id="6N5-lf-6Lg"/>
<constraint firstItem="N3z-41-ZBS" firstAttribute="top" secondItem="fZv-XU-9rZ" secondAttribute="bottom" constant="44" id="9c4-Sm-lE9"/>
<constraint firstItem="diq-Fb-8ST" firstAttribute="leading" secondItem="E81-H1-y6d" secondAttribute="leadingMargin" id="AdH-N5-gCh"/>
<constraint firstItem="j46-3i-Hj3" firstAttribute="leading" secondItem="mlz-rv-BcH" secondAttribute="trailing" constant="8" id="Cej-q3-19v"/>
<constraint firstItem="fZv-XU-9rZ" firstAttribute="leading" secondItem="E81-H1-y6d" secondAttribute="leadingMargin" id="Kgj-8S-Sen"/>
<constraint firstItem="TcY-GF-sf2" firstAttribute="top" secondItem="N3z-41-ZBS" secondAttribute="bottom" constant="44" id="M3w-sw-nGw"/>
<constraint firstItem="KOq-Fe-IWL" firstAttribute="top" secondItem="5nt-mi-ZZZ" secondAttribute="bottom" constant="21" id="MrV-we-4MM"/>
<constraint firstItem="diq-Fb-8ST" firstAttribute="top" secondItem="mlz-rv-BcH" secondAttribute="bottom" constant="22" id="NkC-8p-QSy"/>
<constraint firstItem="mlz-rv-BcH" firstAttribute="top" secondItem="TcY-GF-sf2" secondAttribute="bottom" constant="30" id="Ob4-VO-i9h"/>
<constraint firstItem="N3z-41-ZBS" firstAttribute="trailing" secondItem="E81-H1-y6d" secondAttribute="trailingMargin" id="OiE-bs-1Zi"/>
<constraint firstItem="jll-vc-Hx1" firstAttribute="top" secondItem="eYL-27-FPk" secondAttribute="bottom" id="OpU-0P-FLF"/>
<constraint firstItem="5nt-mi-ZZZ" firstAttribute="leading" secondItem="E81-H1-y6d" secondAttribute="leadingMargin" id="VeN-be-1ti"/>
<constraint firstItem="diq-Fb-8ST" firstAttribute="trailing" secondItem="E81-H1-y6d" secondAttribute="trailingMargin" id="Vub-YC-wBP"/>
<constraint firstItem="mlz-rv-BcH" firstAttribute="leading" secondItem="E81-H1-y6d" secondAttribute="leadingMargin" id="Ypx-xM-XUV"/>
<constraint firstItem="8w1-Me-Ajd" firstAttribute="top" secondItem="diq-Fb-8ST" secondAttribute="bottom" constant="17" id="b9V-Zx-UGN"/>
Expand All @@ -475,11 +489,12 @@
<outlet property="passwordTextField" destination="N3z-41-ZBS" id="YUY-LO-88v"/>
<outlet property="personalServerButton" destination="mlz-rv-BcH" id="UPE-g1-uto"/>
<outlet property="signUpButton" destination="diq-Fb-8ST" id="s94-fS-frq"/>
<outlet property="termsAndCondButton" destination="5nt-mi-ZZZ" id="9VO-9d-rH5"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="MOa-7B-h41" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1157.9710144927537" y="-505.43478260869568"/>
<point key="canvasLocation" x="1157.5999999999999" y="-506.1576354679803"/>
</scene>
<!--Training View Controller-->
<scene sceneID="zOn-LC-e9w">
Expand Down Expand Up @@ -520,40 +535,40 @@
<nil key="highlightedColor"/>
</label>
<imageView clearsContextBeforeDrawing="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="manual_record" translatesAutoresizingMaskIntoConstraints="NO" id="2xw-vb-Rd9">
<rect key="frame" x="32" y="303" width="24" height="24.333333333333314"/>
<rect key="frame" x="32" y="303" width="72" height="72"/>
<color key="tintColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</imageView>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Listening... say &quot;SUSI&quot;" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZFw-Ph-8b4">
<rect key="frame" x="79" y="305" width="264" height="20.333333333333314"/>
<rect key="frame" x="127" y="305" width="216" height="68"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="MkY-mN-xiY">
<rect key="frame" x="34" y="305" width="20" height="20"/>
<rect key="frame" x="34" y="305" width="68" height="20"/>
</activityIndicatorView>
<imageView clearsContextBeforeDrawing="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="manual_record" translatesAutoresizingMaskIntoConstraints="NO" id="bWp-VC-efB">
<rect key="frame" x="32" y="347.33333333333331" width="24" height="24"/>
<rect key="frame" x="32" y="395" width="72" height="72"/>
<color key="tintColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</imageView>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Say &quot;SUSI&quot; again" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cbj-q3-I0O">
<rect key="frame" x="79" y="349.33333333333331" width="264" height="21"/>
<rect key="frame" x="127" y="397" width="216" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="kU6-Vs-OHY">
<rect key="frame" x="34" y="349.33333333333331" width="20" height="20"/>
<rect key="frame" x="34" y="397" width="68" height="20"/>
</activityIndicatorView>
<imageView clearsContextBeforeDrawing="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="manual_record" translatesAutoresizingMaskIntoConstraints="NO" id="FIR-6f-0Z4">
<rect key="frame" x="32" y="391.33333333333331" width="24" height="24"/>
<rect key="frame" x="32" y="487" width="72" height="72"/>
<color key="tintColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</imageView>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="grs-I7-eRe">
<rect key="frame" x="34" y="393.33333333333331" width="20" height="20"/>
<rect key="frame" x="34" y="489" width="68" height="20"/>
</activityIndicatorView>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Say &quot;SUSI&quot; one last time" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tIR-x8-YXs">
<rect key="frame" x="79" y="394.33333333333331" width="264" height="21"/>
<rect key="frame" x="127" y="442" width="216" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -2921,11 +2936,11 @@
</scene>
</scenes>
<resources>
<image name="back_arrow" width="24" height="24"/>
<image name="back_arrow" width="72" height="72"/>
<image name="mail-icon" width="80" height="64"/>
<image name="manual_record" width="24" height="24"/>
<image name="manual_record" width="72" height="72"/>
<image name="placeholder" width="800" height="600"/>
<image name="record" width="100" height="100"/>
<image name="record" width="300" height="300"/>
<image name="star_empty" width="22" height="22"/>
<image name="star_full" width="22" height="22"/>
<image name="star_full_gray" width="12" height="12"/>
Expand Down