mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-26 22:07:12 +00:00
Introduced new table layout in home view
This commit is contained in:
1 parent
f8bbb741ff
commit
1376f663e5
4 files changed
+73
-17
No files matched your search
@@ -309,6 +309,7 @@
|
||||
9E95C3D61C723AB30016632B /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E95C3D51C723AB30016632B /* Constants.swift */; };
|
||||
9ECBDDAE1C9C4F0300F76AEB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9ECBDDAD1C9C4F0300F76AEB /* LaunchScreen.storyboard */; };
|
||||
C84936181D40D295000F30E8 /* GPSFixController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84936171D40D295000F30E8 /* GPSFixController.swift */; };
|
||||
C84936291D47645F000F30E8 /* HomeViewRegattaTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84936281D47645F000F30E8 /* HomeViewRegattaTableViewCell.swift */; };
|
||||
C852BAA21CF5E1EA0093B0C5 /* RequestManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C852BAA11CF5E1EA0093B0C5 /* RequestManager.swift */; };
|
||||
C852BAAB1CF736680093B0C5 /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = C852BAAA1CF736680093B0C5 /* Preferences.swift */; };
|
||||
C8603D511C52892A002B2F28 /* Acknowledgements.markdown in Resources */ = {isa = PBXBuildFile; fileRef = C8603D491C528832002B2F28 /* Acknowledgements.markdown */; };
|
||||
@@ -703,6 +704,7 @@
|
||||
9ECBDDAD1C9C4F0300F76AEB /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
B1229BB88872CD20C0AE25DE /* libPods-SAPTracker.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SAPTracker.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C84936171D40D295000F30E8 /* GPSFixController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GPSFixController.swift; sourceTree = "<group>"; };
|
||||
C84936281D47645F000F30E8 /* HomeViewRegattaTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeViewRegattaTableViewCell.swift; sourceTree = "<group>"; };
|
||||
C852BAA11CF5E1EA0093B0C5 /* RequestManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestManager.swift; sourceTree = "<group>"; };
|
||||
C852BAAA1CF736680093B0C5 /* Preferences.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = "<group>"; };
|
||||
C8603D491C528832002B2F28 /* Acknowledgements.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = Acknowledgements.markdown; sourceTree = "<group>"; };
|
||||
@@ -796,6 +798,7 @@
|
||||
7F8CC2071A10D47A00C56D7F /* SettingsViewController.swift */,
|
||||
7FAFA7941A126B5700D230F1 /* AboutViewController.swift */,
|
||||
7F83F15719F154F000C53328 /* HomeViewController.swift */,
|
||||
C84936281D47645F000F30E8 /* HomeViewRegattaTableViewCell.swift */,
|
||||
7F0658FC19F7D6700077FF95 /* ScanViewController.swift */,
|
||||
C89C60101D0FF036002AAAD2 /* Regatta */,
|
||||
);
|
||||
@@ -1866,6 +1869,7 @@
|
||||
C852BAA21CF5E1EA0093B0C5 /* RequestManager.swift in Sources */,
|
||||
C8BBAC791C52649E004CA551 /* LicenseViewController.swift in Sources */,
|
||||
7F23F0881A1A3DEF00F03F1C /* CheckInController.swift in Sources */,
|
||||
C84936291D47645F000F30E8 /* HomeViewRegattaTableViewCell.swift in Sources */,
|
||||
7F2C605A19F160E400C32D93 /* LocationManager.swift in Sources */,
|
||||
C89C5FCC1D06CF0C002AAAD2 /* GPSAccuracyTrackingTableViewCell.swift in Sources */,
|
||||
C8739E041D2AA2A500A89F3C /* Regatta+CoreDataProperties.swift in Sources */,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<string>OpenSans-Bold</string>
|
||||
<string>OpenSans-Bold</string>
|
||||
<string>OpenSans-Bold</string>
|
||||
<string>OpenSans-Bold</string>
|
||||
</mutableArray>
|
||||
<mutableArray key="OpenSans-Light.ttf">
|
||||
<string>OpenSans-Light</string>
|
||||
@@ -50,6 +51,7 @@
|
||||
<string>OpenSans</string>
|
||||
<string>OpenSans</string>
|
||||
<string>OpenSans</string>
|
||||
<string>OpenSans</string>
|
||||
</mutableArray>
|
||||
<mutableArray key="OpenSans-Semibold.ttf">
|
||||
<string>OpenSans-Semibold</string>
|
||||
@@ -73,7 +75,7 @@
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_bg" translatesAutoresizingMaskIntoConstraints="NO" id="npJ-tu-ac3" userLabel="Background Image">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="536"/>
|
||||
</imageView>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="OXU-ft-TXZ">
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="81" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="OXU-ft-TXZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="330.5"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<view key="tableHeaderView" contentMode="scaleToFill" id="mhw-sY-eah" userLabel="Title View">
|
||||
@@ -97,29 +99,55 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<view key="tableFooterView" contentMode="scaleToFill" id="ntQ-jE-XcH">
|
||||
<rect key="frame" x="0.0" y="148" width="600" height="0.0"/>
|
||||
<rect key="frame" x="0.0" y="155" width="600" height="0.0"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<prototypes>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Regatta" textLabel="FzL-oN-acm" rowHeight="74" style="IBUITableViewCellStyleDefault" id="01f-yF-69S" userLabel="Regatta Cell">
|
||||
<rect key="frame" x="0.0" y="74" width="600" height="74"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Regatta" id="01f-yF-69S" userLabel="Regatta Cell" customClass="HomeViewRegattaTableViewCell" customModule="SAPTracker" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="74" width="600" height="81"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="01f-yF-69S" id="vse-xJ-e2c">
|
||||
<rect key="frame" x="0.0" y="0.0" width="567" height="73.5"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" tableViewCell="01f-yF-69S" id="vse-xJ-e2c">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="80.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" id="FzL-oN-acm">
|
||||
<rect key="frame" x="15" y="0.0" width="550" height="73.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="18"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" text="Event Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Xi-He-o21">
|
||||
<rect key="frame" x="20" y="8" width="140.5" height="25"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans-Bold" family="Open Sans" pointSize="18"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Competitor Label" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sNr-Dr-sM5">
|
||||
<rect key="frame" x="168" y="8" width="411.5" height="64.5"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="16"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Leaderboard Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yqN-BN-c2a">
|
||||
<rect key="frame" x="20" y="41" width="140.5" height="31"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans" family="Open Sans" pointSize="16"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="yqN-BN-c2a" secondAttribute="bottom" constant="8" id="2Zs-ss-yHp"/>
|
||||
<constraint firstItem="yqN-BN-c2a" firstAttribute="leading" secondItem="vse-xJ-e2c" secondAttribute="leading" constant="20" id="6wi-Rv-c4K"/>
|
||||
<constraint firstItem="4Xi-He-o21" firstAttribute="top" secondItem="vse-xJ-e2c" secondAttribute="top" constant="8" id="L6x-7R-n97"/>
|
||||
<constraint firstAttribute="trailing" secondItem="sNr-Dr-sM5" secondAttribute="trailing" constant="20" id="NFc-FD-zPd"/>
|
||||
<constraint firstItem="sNr-Dr-sM5" firstAttribute="top" secondItem="vse-xJ-e2c" secondAttribute="top" constant="8" id="QNc-rL-vcf"/>
|
||||
<constraint firstItem="sNr-Dr-sM5" firstAttribute="leading" secondItem="4Xi-He-o21" secondAttribute="trailing" constant="8" id="Xst-QP-CN0"/>
|
||||
<constraint firstItem="sNr-Dr-sM5" firstAttribute="leading" secondItem="yqN-BN-c2a" secondAttribute="trailing" constant="8" id="ZqI-Vl-jhi"/>
|
||||
<constraint firstItem="4Xi-He-o21" firstAttribute="leading" secondItem="vse-xJ-e2c" secondAttribute="leading" constant="20" id="g5X-ph-ew0"/>
|
||||
<constraint firstItem="yqN-BN-c2a" firstAttribute="top" secondItem="4Xi-He-o21" secondAttribute="bottom" constant="8" id="kUK-Km-5Tj"/>
|
||||
<constraint firstAttribute="bottom" secondItem="sNr-Dr-sM5" secondAttribute="bottom" constant="8" id="wMf-aW-CZl"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" red="0.96470588235294119" green="0.98431372549019602" blue="0.98431372549019602" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<connections>
|
||||
<outlet property="competitorLabel" destination="sNr-Dr-sM5" id="XjN-ac-0yL"/>
|
||||
<outlet property="eventLabel" destination="4Xi-He-o21" id="W7y-Nr-cR6"/>
|
||||
<outlet property="leaderboardLabel" destination="yqN-BN-c2a" id="nGQ-81-E6W"/>
|
||||
<segue destination="G3a-SV-Maf" kind="show" id="XWZ-NP-fiD"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
@@ -1976,8 +2004,8 @@ Cg
|
||||
<image name="settings" width="22" height="22"/>
|
||||
</resources>
|
||||
<inferredMetricsTieBreakers>
|
||||
<segue reference="tzB-PL-31j"/>
|
||||
<segue reference="Irs-ey-Uhs"/>
|
||||
<segue reference="Xxn-jp-xEB"/>
|
||||
<segue reference="QMa-LQ-D8c"/>
|
||||
</inferredMetricsTieBreakers>
|
||||
<color key="tintColor" red="0.0" green="0.61568627450980395" blue="0.8784313725490196" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</document>
|
||||
@@ -39,6 +39,7 @@ class HomeViewController: UIViewController {
|
||||
setupButtons()
|
||||
setupLanguage()
|
||||
setupNavigationBar()
|
||||
setupTableView()
|
||||
setupTableViewDataSource()
|
||||
}
|
||||
|
||||
@@ -59,6 +60,11 @@ class HomeViewController: UIViewController {
|
||||
navigationItem.leftBarButtonItem = UIBarButtonItem(customView: UIImageView(image: UIImage(named: "sap_logo")))
|
||||
}
|
||||
|
||||
private func setupTableView() {
|
||||
tableView.rowHeight = UITableViewAutomaticDimension
|
||||
tableView.estimatedRowHeight = 140
|
||||
}
|
||||
|
||||
private func setupTableViewDataSource() {
|
||||
do {
|
||||
try fetchedResultsController.performFetch()
|
||||
@@ -246,8 +252,11 @@ extension HomeViewController: UITableViewDataSource {
|
||||
}
|
||||
|
||||
func configureCell(cell: UITableViewCell, atIndexPath indexPath: NSIndexPath) {
|
||||
guard let regattaCell = cell as? HomeViewRegattaTableViewCell else { return }
|
||||
guard let regatta = fetchedResultsController.objectAtIndexPath(indexPath) as? Regatta else { return }
|
||||
cell.textLabel?.text = regatta.leaderboard.name
|
||||
regattaCell.eventLabel.text = regatta.event.name
|
||||
regattaCell.leaderboardLabel.text = regatta.leaderboard.name
|
||||
regattaCell.competitorLabel.text = regatta.competitor.name
|
||||
}
|
||||
|
||||
}
|
||||
@@ -256,9 +265,7 @@ extension HomeViewController: UITableViewDataSource {
|
||||
|
||||
extension HomeViewController: UITableViewDelegate {
|
||||
|
||||
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
|
||||
return 74
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// HomeViewRegattaTableViewCell.swift
|
||||
// SAPTracker
|
||||
//
|
||||
// Created by Raimund Wege on 26.07.16.
|
||||
// Copyright © 2016 com.sap.sailing. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class HomeViewRegattaTableViewCell: UITableViewCell {
|
||||
|
||||
@IBOutlet weak var eventLabel: UILabel!
|
||||
@IBOutlet weak var leaderboardLabel: UILabel!
|
||||
@IBOutlet weak var competitorLabel: UILabel!
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user