IOS-1716 using TableViewController always f...s me up IOS-1716
authorbuff <andreas@pep-project.org>
Wed, 14 Aug 2019 12:02:45 +0200
branchIOS-1716
changeset 966928bb4671b45c
parent 9668 8605c2cf484b
child 9670 a5e61721ca3e
IOS-1716 using TableViewController always f...s me up
pEpForiOS.xcodeproj/project.pbxproj
pEpForiOS/Base.lproj/Settings.storyboard
pEpForiOS/UI/Settings/Setting/ExtraKeysSetting/ExtraKeysSettingTableViewController.swift
pEpForiOS/UI/Settings/Setting/ExtraKeysSetting/ExtraKeysSettingViewController.swift
pEpForiOS/UI/Settings/Setting/ExtraKeysSetting/ExtraKeysSettingViewModel.swift
pEpForiOS/UI/Settings/SettingsTableViewController.swift
     1.1 --- a/pEpForiOS.xcodeproj/project.pbxproj	Tue Aug 13 18:59:12 2019 +0200
     1.2 +++ b/pEpForiOS.xcodeproj/project.pbxproj	Wed Aug 14 12:02:45 2019 +0200
     1.3 @@ -64,7 +64,7 @@
     1.4  		151F7200202A06760057C74D /* TestUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 151F71F5202A06750057C74D /* TestUtil.swift */; };
     1.5  		151F7201202A06760057C74D /* CdAccount+TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 151F71F6202A06750057C74D /* CdAccount+TestUtils.swift */; };
     1.6  		151F7205202A070E0057C74D /* PantomimeFolderAttribute+ExtensionsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 151F7204202A070E0057C74D /* PantomimeFolderAttribute+ExtensionsTest.swift */; };
     1.7 -		152295542302F72900204FD3 /* ExtraKeysSettingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152295532302F72900204FD3 /* ExtraKeysSettingTableViewController.swift */; };
     1.8 +		152295542302F72900204FD3 /* ExtraKeysSettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152295532302F72900204FD3 /* ExtraKeysSettingViewController.swift */; };
     1.9  		152295572302F7E200204FD3 /* ExtraKeysSettingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152295562302F7E200204FD3 /* ExtraKeysSettingViewModel.swift */; };
    1.10  		15255B031F825CD100A2CFC9 /* IdentityImageTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15255B021F825CD100A2CFC9 /* IdentityImageTool.swift */; };
    1.11  		15265962216230B1006A78DF /* ContactCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15265949216230B0006A78DF /* ContactCell.swift */; };
    1.12 @@ -544,7 +544,7 @@
    1.13  		151F71F6202A06750057C74D /* CdAccount+TestUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CdAccount+TestUtils.swift"; sourceTree = "<group>"; };
    1.14  		151F7204202A070E0057C74D /* PantomimeFolderAttribute+ExtensionsTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PantomimeFolderAttribute+ExtensionsTest.swift"; sourceTree = "<group>"; };
    1.15  		152130531FD00B7A00688DF2 /* DisplayUserError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayUserError.swift; sourceTree = "<group>"; };
    1.16 -		152295532302F72900204FD3 /* ExtraKeysSettingTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtraKeysSettingTableViewController.swift; sourceTree = "<group>"; };
    1.17 +		152295532302F72900204FD3 /* ExtraKeysSettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtraKeysSettingViewController.swift; sourceTree = "<group>"; };
    1.18  		152295562302F7E200204FD3 /* ExtraKeysSettingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtraKeysSettingViewModel.swift; sourceTree = "<group>"; };
    1.19  		15255B021F825CD100A2CFC9 /* IdentityImageTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdentityImageTool.swift; sourceTree = "<group>"; };
    1.20  		15265949216230B0006A78DF /* ContactCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactCell.swift; sourceTree = "<group>"; };
    1.21 @@ -1115,7 +1115,7 @@
    1.22  		152295552302F73400204FD3 /* ExtraKeysSetting */ = {
    1.23  			isa = PBXGroup;
    1.24  			children = (
    1.25 -				152295532302F72900204FD3 /* ExtraKeysSettingTableViewController.swift */,
    1.26 +				152295532302F72900204FD3 /* ExtraKeysSettingViewController.swift */,
    1.27  				152295562302F7E200204FD3 /* ExtraKeysSettingViewModel.swift */,
    1.28  			);
    1.29  			path = ExtraKeysSetting;
    1.30 @@ -2742,7 +2742,7 @@
    1.31  				4351C2D61F4441190053381F /* man.c in Sources */,
    1.32  				150B8EB31FCEB93D00374438 /* UIUtils.swift in Sources */,
    1.33  				43AAC22A1F7A5AEE00F435F4 /* BaseTableViewController.swift in Sources */,
    1.34 -				152295542302F72900204FD3 /* ExtraKeysSettingTableViewController.swift in Sources */,
    1.35 +				152295542302F72900204FD3 /* ExtraKeysSettingViewController.swift in Sources */,
    1.36  				220DCE351E0AB5CC002FE716 /* MessageContentCell.swift in Sources */,
    1.37  				1526597A21623652006A78DF /* SuggestViewModel.swift in Sources */,
    1.38  				4351C2D31F4441190053381F /* inlines.c in Sources */,
     2.1 --- a/pEpForiOS/Base.lproj/Settings.storyboard	Tue Aug 13 18:59:12 2019 +0200
     2.2 +++ b/pEpForiOS/Base.lproj/Settings.storyboard	Wed Aug 14 12:02:45 2019 +0200
     2.3 @@ -126,7 +126,7 @@
     2.4                          <segue destination="pQb-5p-QId" kind="showDetail" identifier="segueShowSettingDefaultAccount" id="qiY-7g-nll"/>
     2.5                          <segue destination="95U-QI-nlr" kind="showDetail" identifier="segueShowSettingTrustedServers" id="tvG-bN-ITt"/>
     2.6                          <segue destination="cMW-fr-EKn" kind="showDetail" identifier="segueSetOwnKey" id="D3B-Zt-U43"/>
     2.7 -                        <segue destination="uzc-58-YKg" kind="show" identifier="segueExtraKeys" id="OfN-k9-B9h"/>
     2.8 +                        <segue destination="4fP-ku-UtU" kind="showDetail" identifier="segueExtraKeys" id="DPP-UI-qfC"/>
     2.9                      </connections>
    2.10                  </tableViewController>
    2.11                  <placeholder placeholderIdentifier="IBFirstResponder" id="BPe-Zm-lKR" userLabel="First Responder" sceneMemberID="firstResponder"/>
    2.12 @@ -134,6 +134,88 @@
    2.13              </objects>
    2.14              <point key="canvasLocation" x="-1327" y="-1170"/>
    2.15          </scene>
    2.16 +        <!--Extra Keys Setting View Controller-->
    2.17 +        <scene sceneID="KkR-yF-e30">
    2.18 +            <objects>
    2.19 +                <viewController id="4fP-ku-UtU" customClass="ExtraKeysSettingViewController" customModule="pEpForiOS" customModuleProvider="target" sceneMemberID="viewController">
    2.20 +                    <view key="view" contentMode="scaleToFill" id="MFw-tL-ska">
    2.21 +                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
    2.22 +                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
    2.23 +                        <subviews>
    2.24 +                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="xwh-71-o4X">
    2.25 +                                <rect key="frame" x="0.0" y="0.0" width="375" height="567"/>
    2.26 +                                <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
    2.27 +                                <prototypes>
    2.28 +                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="ExtraKeysSettingFprCell" textLabel="hHr-Jq-PRg" style="IBUITableViewCellStyleDefault" id="ux3-4L-chV">
    2.29 +                                        <rect key="frame" x="0.0" y="28" width="375" height="44"/>
    2.30 +                                        <autoresizingMask key="autoresizingMask"/>
    2.31 +                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="ux3-4L-chV" id="cho-gl-9KY">
    2.32 +                                            <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
    2.33 +                                            <autoresizingMask key="autoresizingMask"/>
    2.34 +                                            <subviews>
    2.35 +                                                <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="hHr-Jq-PRg">
    2.36 +                                                    <rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
    2.37 +                                                    <autoresizingMask key="autoresizingMask"/>
    2.38 +                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
    2.39 +                                                    <nil key="textColor"/>
    2.40 +                                                    <nil key="highlightedColor"/>
    2.41 +                                                </label>
    2.42 +                                            </subviews>
    2.43 +                                        </tableViewCellContentView>
    2.44 +                                    </tableViewCell>
    2.45 +                                </prototypes>
    2.46 +                            </tableView>
    2.47 +                            <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="PG6-XN-MQm">
    2.48 +                                <rect key="frame" x="0.0" y="567" width="375" height="100"/>
    2.49 +                                <subviews>
    2.50 +                                    <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" text="FPRFPRFPRFPRFPRFPRFPRFPRFPRFPRFPRFPRFPRFPRFPRFPRFPRFPR" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="zHk-jf-vFQ">
    2.51 +                                        <rect key="frame" x="0.0" y="0.0" width="375" height="70"/>
    2.52 +                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
    2.53 +                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
    2.54 +                                        <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
    2.55 +                                    </textView>
    2.56 +                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="J2v-Vi-URg">
    2.57 +                                        <rect key="frame" x="0.0" y="70" width="375" height="30"/>
    2.58 +                                        <state key="normal" title="add Fingerprint"/>
    2.59 +                                        <connections>
    2.60 +                                            <action selector="addExtraKeyButtonPressed:" destination="4fP-ku-UtU" eventType="touchUpInside" id="Q5c-il-RpN"/>
    2.61 +                                        </connections>
    2.62 +                                    </button>
    2.63 +                                </subviews>
    2.64 +                                <constraints>
    2.65 +                                    <constraint firstAttribute="height" constant="100" id="A7G-lK-k6l"/>
    2.66 +                                    <constraint firstItem="J2v-Vi-URg" firstAttribute="centerX" secondItem="PG6-XN-MQm" secondAttribute="centerX" id="Dnt-Wf-gJD"/>
    2.67 +                                    <constraint firstItem="zHk-jf-vFQ" firstAttribute="top" secondItem="PG6-XN-MQm" secondAttribute="top" id="IHk-U2-dvC"/>
    2.68 +                                    <constraint firstItem="zHk-jf-vFQ" firstAttribute="leading" secondItem="PG6-XN-MQm" secondAttribute="leading" id="QSX-Hp-UqL"/>
    2.69 +                                    <constraint firstItem="J2v-Vi-URg" firstAttribute="top" secondItem="zHk-jf-vFQ" secondAttribute="bottom" id="Yx5-BL-EoH"/>
    2.70 +                                    <constraint firstAttribute="trailing" secondItem="zHk-jf-vFQ" secondAttribute="trailing" id="g2w-X2-stM"/>
    2.71 +                                    <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="100" id="xQW-kk-bIV"/>
    2.72 +                                </constraints>
    2.73 +                            </stackView>
    2.74 +                        </subviews>
    2.75 +                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
    2.76 +                        <constraints>
    2.77 +                            <constraint firstItem="kNC-Mm-Vwn" firstAttribute="trailing" secondItem="xwh-71-o4X" secondAttribute="trailing" id="6dj-HV-KIE"/>
    2.78 +                            <constraint firstItem="xwh-71-o4X" firstAttribute="top" secondItem="MFw-tL-ska" secondAttribute="top" id="Dlj-xX-Arp"/>
    2.79 +                            <constraint firstItem="PG6-XN-MQm" firstAttribute="trailing" secondItem="kNC-Mm-Vwn" secondAttribute="trailing" id="ZS1-ex-qZP"/>
    2.80 +                            <constraint firstItem="PG6-XN-MQm" firstAttribute="leading" secondItem="kNC-Mm-Vwn" secondAttribute="leading" id="bqW-S5-e7M"/>
    2.81 +                            <constraint firstItem="xwh-71-o4X" firstAttribute="leading" secondItem="kNC-Mm-Vwn" secondAttribute="leading" id="h7D-Db-2bK"/>
    2.82 +                            <constraint firstAttribute="bottomMargin" secondItem="PG6-XN-MQm" secondAttribute="bottom" id="icq-he-U1m"/>
    2.83 +                            <constraint firstItem="PG6-XN-MQm" firstAttribute="top" secondItem="xwh-71-o4X" secondAttribute="bottom" id="vLH-8z-dxl"/>
    2.84 +                        </constraints>
    2.85 +                        <viewLayoutGuide key="safeArea" id="kNC-Mm-Vwn"/>
    2.86 +                    </view>
    2.87 +                    <connections>
    2.88 +                        <outlet property="addExtraKeyButton" destination="J2v-Vi-URg" id="y2f-4x-YZS"/>
    2.89 +                        <outlet property="addFprView" destination="PG6-XN-MQm" id="Xdx-jc-jYu"/>
    2.90 +                        <outlet property="fpr" destination="zHk-jf-vFQ" id="bca-yo-WNG"/>
    2.91 +                        <outlet property="tableView" destination="xwh-71-o4X" id="Tiv-pl-sxU"/>
    2.92 +                    </connections>
    2.93 +                </viewController>
    2.94 +                <placeholder placeholderIdentifier="IBFirstResponder" id="LCO-IG-Rwh" userLabel="First Responder" sceneMemberID="firstResponder"/>
    2.95 +            </objects>
    2.96 +            <point key="canvasLocation" x="-476" y="-1891"/>
    2.97 +        </scene>
    2.98          <!--Set Own Key View Controller-->
    2.99          <scene sceneID="k12-LM-gr9">
   2.100              <objects>
   2.101 @@ -713,57 +795,5 @@
   2.102              </objects>
   2.103              <point key="canvasLocation" x="-391.19999999999999" y="-388.15592203898052"/>
   2.104          </scene>
   2.105 -        <!--Extra Keys Table View Controller-->
   2.106 -        <scene sceneID="oPN-rz-GTz">
   2.107 -            <objects>
   2.108 -                <tableViewController storyboardIdentifier="ExtraKeysTableViewController" id="uzc-58-YKg" customClass="ExtraKeysTableViewController" customModule="pEpForiOS" customModuleProvider="target" sceneMemberID="viewController">
   2.109 -                    <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="deG-Tt-VmN">
   2.110 -                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
   2.111 -                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
   2.112 -                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
   2.113 -                        <view key="tableHeaderView" contentMode="scaleToFill" id="NV8-u2-BdN">
   2.114 -                            <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
   2.115 -                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
   2.116 -                            <subviews>
   2.117 -                                <textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="AAAA" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="GfF-QP-aFc">
   2.118 -                                    <rect key="frame" x="139" y="7" width="97" height="30"/>
   2.119 -                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
   2.120 -                                    <nil key="textColor"/>
   2.121 -                                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
   2.122 -                                    <textInputTraits key="textInputTraits"/>
   2.123 -                                </textField>
   2.124 -                            </subviews>
   2.125 -                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
   2.126 -                        </view>
   2.127 -                        <prototypes>
   2.128 -                            <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="ExtraKeysSettingFprCell" textLabel="GEq-nv-Mbi" style="IBUITableViewCellStyleDefault" id="vpK-ct-FhS">
   2.129 -                                <rect key="frame" x="0.0" y="72" width="375" height="44"/>
   2.130 -                                <autoresizingMask key="autoresizingMask"/>
   2.131 -                                <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="vpK-ct-FhS" id="xJE-OM-d4U">
   2.132 -                                    <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
   2.133 -                                    <autoresizingMask key="autoresizingMask"/>
   2.134 -                                    <subviews>
   2.135 -                                        <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="GEq-nv-Mbi">
   2.136 -                                            <rect key="frame" x="16" y="0.0" width="343" height="43.5"/>
   2.137 -                                            <autoresizingMask key="autoresizingMask"/>
   2.138 -                                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
   2.139 -                                            <nil key="textColor"/>
   2.140 -                                            <nil key="highlightedColor"/>
   2.141 -                                        </label>
   2.142 -                                    </subviews>
   2.143 -                                </tableViewCellContentView>
   2.144 -                            </tableViewCell>
   2.145 -                        </prototypes>
   2.146 -                        <sections/>
   2.147 -                        <connections>
   2.148 -                            <outlet property="dataSource" destination="uzc-58-YKg" id="aBi-C7-0V9"/>
   2.149 -                            <outlet property="delegate" destination="uzc-58-YKg" id="w7K-nn-boK"/>
   2.150 -                        </connections>
   2.151 -                    </tableView>
   2.152 -                </tableViewController>
   2.153 -                <placeholder placeholderIdentifier="IBFirstResponder" id="ry7-IZ-RNV" userLabel="First Responder" sceneMemberID="firstResponder"/>
   2.154 -            </objects>
   2.155 -            <point key="canvasLocation" x="-476" y="-1848"/>
   2.156 -        </scene>
   2.157      </scenes>
   2.158  </document>
     3.1 --- a/pEpForiOS/UI/Settings/Setting/ExtraKeysSetting/ExtraKeysSettingTableViewController.swift	Tue Aug 13 18:59:12 2019 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,45 +0,0 @@
     3.4 -//
     3.5 -//  ExtraKeysSettingTableViewController.swift
     3.6 -//  pEp
     3.7 -//
     3.8 -//  Created by Andreas Buff on 13.08.19.
     3.9 -//  Copyright © 2019 p≡p Security S.A. All rights reserved.
    3.10 -//
    3.11 -
    3.12 -import Foundation
    3.13 -
    3.14 -class ExtraKeysSettingTableViewController: BaseTableViewController {
    3.15 -    static private let uiTableViewCellID = "ExtraKeysSettingFprCell"
    3.16 -    private var viewModel: ExtraKeysSettingViewModel?
    3.17 -
    3.18 -    override func viewDidLoad() {
    3.19 -        super.viewDidLoad()
    3.20 -        viewModel = ExtraKeysSettingViewModel()
    3.21 -    }
    3.22 -}
    3.23 -
    3.24 -// MARK: - UITableViewDataSource
    3.25 -
    3.26 -extension ExtraKeysSettingTableViewController {
    3.27 -
    3.28 -    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    3.29 -        return viewModel?.numRows ?? 0
    3.30 -    }
    3.31 -
    3.32 -    override func tableView(_ tableView: UITableView,
    3.33 -                            cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    3.34 -        let cell =
    3.35 -            tableView.dequeueReusableCell(withIdentifier: ExtraKeysSettingTableViewController.uiTableViewCellID,
    3.36 -                                          for: indexPath)
    3.37 -        cell.textLabel?.text = viewModel?[indexPath.row]
    3.38 -
    3.39 -        return cell
    3.40 -    }
    3.41 -}
    3.42 -
    3.43 -
    3.44 -//// MARK: - UITableViewDelegate
    3.45 -//
    3.46 -//extension ExtraKeysSettingTableViewController: UITableViewDelegate {
    3.47 -//
    3.48 -//}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/pEpForiOS/UI/Settings/Setting/ExtraKeysSetting/ExtraKeysSettingViewController.swift	Wed Aug 14 12:02:45 2019 +0200
     4.3 @@ -0,0 +1,75 @@
     4.4 +//
     4.5 +//  ExtraKeysSettingViewController.swift
     4.6 +//  pEp
     4.7 +//
     4.8 +//  Created by Andreas Buff on 13.08.19.
     4.9 +//  Copyright © 2019 p≡p Security S.A. All rights reserved.
    4.10 +//
    4.11 +
    4.12 +import Foundation
    4.13 +
    4.14 +class ExtraKeysSettingViewController: BaseViewController {
    4.15 +    static private let uiTableViewCellID = "ExtraKeysSettingFprCell"
    4.16 +
    4.17 +    @IBOutlet weak var addExtraKeyButton: UIButton!
    4.18 +    @IBOutlet weak var addFprView: UIStackView!
    4.19 +    @IBOutlet weak var fpr: UITextView!
    4.20 +    @IBOutlet weak var tableView: UITableView!
    4.21 +
    4.22 +    private var viewModel: ExtraKeysSettingViewModel?
    4.23 +
    4.24 +//    override func viewDidLoad() {
    4.25 +//        super.viewDidLoad()
    4.26 +//
    4.27 +//    }
    4.28 +
    4.29 +    override func viewWillAppear(_ animated: Bool) {
    4.30 +        super.viewWillAppear(animated)
    4.31 +        setup()
    4.32 +        tableView.reloadData()
    4.33 +    }
    4.34 +
    4.35 +    @IBAction func addExtraKeyButtonPressed(_ sender: UIButton) {
    4.36 +        fatalError("Unimplemented stub")
    4.37 +    }
    4.38 +}
    4.39 +
    4.40 +// MARK: - Private
    4.41 +
    4.42 +extension ExtraKeysSettingViewController {
    4.43 +    private func setup() {
    4.44 +        tableView.dataSource = self
    4.45 +        tableView.delegate = self
    4.46 +
    4.47 +        addExtraKeyButton.tintColor = UIColor.pEpGreen
    4.48 +//        addFprView.isHidden = !(viewModel?.isEditable ?? false)
    4.49 +
    4.50 +        viewModel = ExtraKeysSettingViewModel()
    4.51 +    }
    4.52 +}
    4.53 +
    4.54 +// MARK: - UITableViewDataSource
    4.55 +
    4.56 +extension ExtraKeysSettingViewController: UITableViewDataSource {
    4.57 +
    4.58 +    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    4.59 +        return viewModel?.numRows ?? 0
    4.60 +    }
    4.61 +
    4.62 +    func tableView(_ tableView: UITableView,
    4.63 +                            cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    4.64 +        let cell =
    4.65 +            tableView.dequeueReusableCell(withIdentifier: ExtraKeysSettingViewController.uiTableViewCellID,
    4.66 +                                          for: indexPath)
    4.67 +        cell.textLabel?.text = viewModel?[indexPath.row]
    4.68 +
    4.69 +        return cell
    4.70 +    }
    4.71 +}
    4.72 +
    4.73 +
    4.74 +// MARK: - UITableViewDelegate
    4.75 +
    4.76 +extension ExtraKeysSettingViewController: UITableViewDelegate {
    4.77 +
    4.78 +}
     5.1 --- a/pEpForiOS/UI/Settings/Setting/ExtraKeysSetting/ExtraKeysSettingViewModel.swift	Tue Aug 13 18:59:12 2019 +0200
     5.2 +++ b/pEpForiOS/UI/Settings/Setting/ExtraKeysSetting/ExtraKeysSettingViewModel.swift	Wed Aug 14 12:02:45 2019 +0200
     5.3 @@ -26,18 +26,24 @@
     5.4          return fprsOfExtraKeys.count
     5.5      }
     5.6  
     5.7 +    init() {
     5.8 +        fprsOfExtraKeys = ExtraKeysService.extraKeys.map { $0.fingerprint }
     5.9 +    }
    5.10 +
    5.11      subscript(index: Int) -> Fingerprint {
    5.12          get {
    5.13              return self.fprsOfExtraKeys[index]
    5.14          }
    5.15      }
    5.16  
    5.17 -    init() {
    5.18 -        fprsOfExtraKeys = ExtraKeysService.extraKeys.map { $0.fingerprint }
    5.19 +    var isEditable: Bool {
    5.20 +        return AppSettings.extraKeysEditable
    5.21      }
    5.22  
    5.23  
    5.24  
    5.25 +
    5.26 +
    5.27  }
    5.28  //
    5.29  //// MARK: - Private
     6.1 --- a/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Tue Aug 13 18:59:12 2019 +0200
     6.2 +++ b/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Wed Aug 14 12:02:45 2019 +0200
     6.3 @@ -218,14 +218,14 @@
     6.4              }
     6.5          case .noAccounts,
     6.6               .segueAddNewAccount,
     6.7 -             .sequeShowCredits:
     6.8 +             .sequeShowCredits,
     6.9 +             .segueExtraKeys:
    6.10              guard let destination = segue.destination as? BaseViewController else {
    6.11                  return
    6.12              }
    6.13              destination.appConfig = self.appConfig
    6.14          case .segueShowSettingDefaultAccount,
    6.15 -             .segueShowSettingTrustedServers,
    6.16 -             .segueExtraKeys:
    6.17 +             .segueShowSettingTrustedServers:
    6.18              guard let destination = segue.destination as? BaseTableViewController else {
    6.19                  return
    6.20              }