mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-19 20:25:31 +00:00
Added option button to training overview
This commit is contained in:
@@ -783,11 +783,20 @@
|
||||
<constraint firstItem="d4m-uX-YSN" firstAttribute="top" secondItem="Pwd-JR-SVL" secondAttribute="bottom" constant="20" id="q0p-hA-kVh"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="RMd-Zd-4qh">
|
||||
<barButtonItem key="rightBarButtonItem" image="settings" id="dhN-kh-8lm">
|
||||
<connections>
|
||||
<action selector="optionButtonTapped:" destination="1ba-kX-Lnq" id="AeH-kX-eiy"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
<connections>
|
||||
<outlet property="addButton" destination="Pwd-JR-SVL" id="oQ2-6e-NCD"/>
|
||||
<outlet property="footerTextView" destination="AW1-r0-JWj" id="BoM-tz-fRo"/>
|
||||
<outlet property="headerTitleLabel" destination="bx9-EY-ljk" id="91C-Q7-cME"/>
|
||||
<outlet property="tableView" destination="bav-TA-AP5" id="MUP-iZ-LeY"/>
|
||||
<segue destination="dfN-Ch-vpm" kind="presentation" identifier="About" id="TEI-KO-T29"/>
|
||||
<segue destination="4Fb-v3-mkB" kind="presentation" identifier="Settings" id="Xy1-6R-10o"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="1Kb-cO-cLT" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
@@ -830,7 +839,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Mark Name Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="12" adjustsLetterSpacingToFitWidth="YES" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="BQe-Id-ec3">
|
||||
<rect key="frame" x="101.5" y="290.5" width="173" height="22"/>
|
||||
<rect key="frame" x="101" y="290.5" width="173" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="22" id="g3A-7J-yFy"/>
|
||||
</constraints>
|
||||
@@ -1036,7 +1045,7 @@
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6rV-hv-c3D" userLabel="Countdown View">
|
||||
<rect key="frame" x="6.5" y="38" width="363" height="50"/>
|
||||
<rect key="frame" x="6" y="38" width="363" height="50"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pjH-rV-MGI" userLabel="Days View">
|
||||
<rect key="frame" x="0.0" y="0.0" width="121" height="50"/>
|
||||
@@ -1451,13 +1460,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Status Title Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="r6d-OU-cRI">
|
||||
<rect key="frame" x="20" y="15" width="134.5" height="23.5"/>
|
||||
<rect key="frame" x="20" y="14.5" width="134.5" height="23.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Status Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="5Xu-6g-tqP">
|
||||
<rect key="frame" x="259" y="15" width="96" height="23.5"/>
|
||||
<rect key="frame" x="259" y="14.5" width="96" height="23.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="17"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
@@ -1483,13 +1492,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Mode Title Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="Xww-rc-pOA">
|
||||
<rect key="frame" x="20" y="15" width="130.5" height="23.5"/>
|
||||
<rect key="frame" x="20" y="14.5" width="130.5" height="23.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Mode Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="tJY-RR-vpe">
|
||||
<rect key="frame" x="262" y="15" width="93" height="23.5"/>
|
||||
<rect key="frame" x="262" y="14.5" width="93" height="23.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="17"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
@@ -1515,13 +1524,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GPS Fixes Title Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="Ujw-jg-ilY">
|
||||
<rect key="frame" x="20" y="15" width="161" height="23.5"/>
|
||||
<rect key="frame" x="20" y="14.5" width="161" height="23.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GPS Fixes Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="dz3-w7-CCh">
|
||||
<rect key="frame" x="232" y="15" width="123" height="23.5"/>
|
||||
<rect key="frame" x="232" y="14.5" width="123" height="23.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="17"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
@@ -1547,13 +1556,13 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GPS Accuracy Title Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="Z1d-5I-pbj">
|
||||
<rect key="frame" x="20" y="15" width="191.5" height="23.5"/>
|
||||
<rect key="frame" x="20" y="14.5" width="191.5" height="23.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GPS Accuracy Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DiM-MR-SGV">
|
||||
<rect key="frame" x="181.5" y="15" width="153.5" height="23.5"/>
|
||||
<rect key="frame" x="181.5" y="14.5" width="153.5" height="23.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -1665,7 +1674,7 @@
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Value Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="48" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="mUm-EE-6Is" userLabel="Time Label">
|
||||
<rect key="frame" x="3" y="243.5" width="369" height="98.5"/>
|
||||
<rect key="frame" x="3" y="244" width="369" height="98.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans-Light" family="Open Sans" pointSize="72"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -1707,7 +1716,7 @@
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Value Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l5u-i3-029">
|
||||
<rect key="frame" x="3" y="243.5" width="369" height="98.5"/>
|
||||
<rect key="frame" x="3" y="244" width="369" height="98.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans-Light" family="Open Sans" pointSize="72"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -1748,7 +1757,7 @@
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Value Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sGK-xV-9a0">
|
||||
<rect key="frame" x="3" y="243.5" width="369" height="98.5"/>
|
||||
<rect key="frame" x="3" y="244" width="369" height="98.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans-Light" family="Open Sans" pointSize="72"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -2224,9 +2233,9 @@
|
||||
<image name="settings" width="22" height="22"/>
|
||||
</resources>
|
||||
<inferredMetricsTieBreakers>
|
||||
<segue reference="Xxn-jp-xEB"/>
|
||||
<segue reference="QMa-LQ-D8c"/>
|
||||
<segue reference="fgS-yf-c3u"/>
|
||||
<segue reference="TEI-KO-T29"/>
|
||||
<segue reference="Xy1-6R-10o"/>
|
||||
</inferredMetricsTieBreakers>
|
||||
<color key="tintColor" red="0.0" green="0.61568627450980395" blue="0.8784313725490196" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</document>
|
||||
|
||||
@@ -36,11 +36,18 @@ class SignUpController: NSObject {
|
||||
fileprivate let requestManager = SignUpRequestManager(baseURLString: "https://dev.sapsailing.com")
|
||||
|
||||
func loginWithViewController(_ controller: UIViewController) {
|
||||
let storyboard = UIStoryboard(name: "SignUp", bundle: nil)
|
||||
let loginNC = storyboard.instantiateInitialViewController() as! UINavigationController
|
||||
let loginVC = loginNC.viewControllers[0] as! LoginViewController
|
||||
loginVC.signUpController = self
|
||||
controller.present(loginNC, animated: true, completion: nil)
|
||||
do {
|
||||
let accessToken = try Keychain.userAccessToken.readPassword()
|
||||
print(accessToken)
|
||||
controller.presentingViewController?.dismiss(animated: true)
|
||||
self.delegate?.signUpControllerDidFinish(self)
|
||||
} catch {
|
||||
let storyboard = UIStoryboard(name: "SignUp", bundle: nil)
|
||||
let loginNC = storyboard.instantiateInitialViewController() as! UINavigationController
|
||||
let loginVC = loginNC.viewControllers[0] as! LoginViewController
|
||||
loginVC.signUpController = self
|
||||
controller.present(loginNC, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func showAlert(forError error: Error, andMessage message: String?, withViewController controller: UIViewController) {
|
||||
|
||||
@@ -10,6 +10,11 @@ import UIKit
|
||||
|
||||
class TrainingTableViewController: UIViewController {
|
||||
|
||||
fileprivate struct Segue {
|
||||
static let About = "About"
|
||||
static let Settings = "Settings"
|
||||
}
|
||||
|
||||
var login = true
|
||||
|
||||
@IBOutlet weak var headerTitleLabel: UILabel!
|
||||
@@ -35,11 +40,31 @@ class TrainingTableViewController: UIViewController {
|
||||
fileprivate func setup() {
|
||||
setupAddButton()
|
||||
}
|
||||
|
||||
|
||||
fileprivate func setupAddButton() {
|
||||
makeViewRoundWithShadow(addButton)
|
||||
}
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@IBAction func optionButtonTapped(_ sender: Any) {
|
||||
let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
|
||||
if let popoverController = alertController.popoverPresentationController {
|
||||
popoverController.barButtonItem = sender as? UIBarButtonItem
|
||||
}
|
||||
let settingsAction = UIAlertAction(title: Translation.SettingsView.Title.String, style: .default) { [weak self] action in
|
||||
self?.performSegue(withIdentifier: Segue.Settings, sender: alertController)
|
||||
}
|
||||
let aboutAction = UIAlertAction(title: Translation.Common.Info.String, style: .default) { [weak self] action in
|
||||
self?.performSegue(withIdentifier: Segue.About, sender: alertController)
|
||||
}
|
||||
let cancelAction = UIAlertAction(title: Translation.Common.Cancel.String, style: .cancel, handler: nil)
|
||||
alertController.addAction(settingsAction)
|
||||
alertController.addAction(aboutAction)
|
||||
alertController.addAction(cancelAction)
|
||||
present(alertController, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
fileprivate lazy var signUpController: SignUpController = {
|
||||
|
||||
Reference in New Issue
Block a user