diff --git a/enzevalos_iphone/Base.lproj/Main.storyboard b/enzevalos_iphone/Base.lproj/Main.storyboard index dd9fcfd3b871726fcabbed7eeff5128d591781ee..7cf64a8e4d9d0199bc83cf3b459abe61cd512778 100644 --- a/enzevalos_iphone/Base.lproj/Main.storyboard +++ b/enzevalos_iphone/Base.lproj/Main.storyboard @@ -25,7 +25,7 @@ <rect key="frame" x="0.0" y="35" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" contentMode="center" tableViewCell="lSe-Gv-7SL" id="Zam-cw-cBg"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zNO-Uq-ewV" customClass="VENTokenField"> @@ -59,7 +59,7 @@ <rect key="frame" x="0.0" y="79" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" contentMode="center" tableViewCell="ZjK-3s-N2G" id="nTH-P7-ZD7"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Y6C-hE-SJx" customClass="VENTokenField"> @@ -80,7 +80,7 @@ <rect key="frame" x="0.0" y="123" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" tableViewCell="HpI-HP-usd" id="kAy-AZ-pKo"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subject" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ywe-G2-0wJ"> @@ -109,11 +109,11 @@ <rect key="frame" x="0.0" y="176" width="375" height="140"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hiO-mC-dXs" id="gEu-X7-3M0"> - <rect key="frame" x="0.0" y="0.0" width="375" height="140"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="139"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="752" verticalCompressionResistancePriority="1000" placeholderIntrinsicWidth="303" placeholderIntrinsicHeight="64.5" text="Diese E-Mail könnte verändert worden sein! Bitte misstrauen Sie dem Inhalt, falls Sie ihn trotzdem lesen möchten. " textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lYr-bv-gD0"> - <rect key="frame" x="64" y="59" width="303" height="64.5"/> + <rect key="frame" x="64" y="59" width="303" height="64"/> <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -128,7 +128,7 @@ <nil key="highlightedColor"/> </label> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="1000" text="Achtung!" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7LX-pr-0Pd"> - <rect key="frame" x="143" y="20" width="89.5" height="31"/> + <rect key="frame" x="143" y="20" width="90" height="31"/> <fontDescription key="fontDescription" style="UICTFontTextStyleTitle2"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> @@ -151,14 +151,14 @@ <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="0.0" rowHeight="44" id="sfU-SD-QZO"> <rect key="frame" x="0.0" y="316" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="sfU-SD-QZO" id="yxQ-bD-mBC"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="sfU-SD-QZO" id="yxQ-bD-mBC"> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> - <stackView opaque="NO" tag="2" contentMode="scaleToFill" semanticContentAttribute="spatial" distribution="equalCentering" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="3eI-t6-Pay"> + <stackView opaque="NO" tag="2" contentMode="scaleToFill" semanticContentAttribute="spatial" ambiguous="YES" distribution="equalCentering" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="3eI-t6-Pay"> <rect key="frame" x="8" y="0.0" width="359" height="44"/> <subviews> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="I7i-jf-aSX"> + <button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="I7i-jf-aSX"> <rect key="frame" x="0.0" y="0.0" width="179" height="44"/> <constraints> <constraint firstAttribute="height" constant="44" id="81H-Ed-3bH"/> @@ -171,7 +171,7 @@ <action selector="showEmailButton:" destination="Ouw-WD-EV6" eventType="touchUpInside" id="mAB-ts-7mq"/> </connections> </button> - <view autoresizesSubviews="NO" userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cap-Ul-t1I"> + <view autoresizesSubviews="NO" userInteractionEnabled="NO" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cap-Ul-t1I"> <rect key="frame" x="179" y="0.0" width="1" height="44"/> <color key="backgroundColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <accessibility key="accessibilityConfiguration"> @@ -182,7 +182,7 @@ <constraint firstAttribute="height" constant="44" id="Y6y-Pl-hUw"/> </constraints> </view> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qTi-rO-CH3"> + <button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qTi-rO-CH3"> <rect key="frame" x="180" y="0.0" width="179" height="44"/> <constraints> <constraint firstAttribute="height" constant="44" id="voC-CF-ncN"/> @@ -222,7 +222,7 @@ <rect key="frame" x="0.0" y="369" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="VrX-Dg-aLu" id="MwJ-Pq-fRD"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Message" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="djb-A5-Dwe"> @@ -365,7 +365,7 @@ <rect key="frame" x="0.0" y="56" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="tk7-jf-JjG" id="An3-PB-ZQ4"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="CB5-BV-Exp"> @@ -390,7 +390,7 @@ <rect key="frame" x="0.0" y="100" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BR8-YN-6Yk" id="qZc-9w-Lh9"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vVd-dj-8h9"> @@ -494,7 +494,7 @@ <rect key="frame" x="0.0" y="28" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="1fi-I0-xvl" id="H0e-IF-DRG"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="Subject" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="e81-vT-F9X"> @@ -536,7 +536,7 @@ <rect key="frame" x="0.0" y="72" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0Wr-W5-TBs" id="Kes-8c-tRA"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <activityIndicatorView opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" animating="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="Gxe-ZI-Wsy"> @@ -577,10 +577,10 @@ <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <prototypes> <tableViewCell clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ContactViewCell" rowHeight="88" id="92W-gl-tvY" customClass="ContactViewCell" customModule="enzevalos_iphone" customModuleProvider="target"> - <rect key="frame" x="0.0" y="55.5" width="375" height="88"/> + <rect key="frame" x="0.0" y="56" width="375" height="88"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="92W-gl-tvY" id="x9d-DW-WTy"> - <rect key="frame" x="0.0" y="0.0" width="375" height="88"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="87"/> <autoresizingMask key="autoresizingMask"/> <subviews> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="8Bg-PX-E3I"> @@ -626,10 +626,10 @@ </connections> </tableViewCell> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ActionCell" id="yRi-ET-5KB" customClass="ActionCell" customModule="enzevalos_iphone" customModuleProvider="target"> - <rect key="frame" x="0.0" y="143.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="144" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="yRi-ET-5KB" id="zZH-rZ-dKr"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <button opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tex-hl-7Hg" userLabel="Button"> @@ -654,10 +654,10 @@ </connections> </tableViewCell> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="MailCell" rowHeight="64" id="8qd-Go-Jup" customClass="MailCell" customModule="enzevalos_iphone" customModuleProvider="target"> - <rect key="frame" x="0.0" y="187.5" width="375" height="64"/> + <rect key="frame" x="0.0" y="188" width="375" height="64"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="8qd-Go-Jup" id="CEB-dH-z8s"> - <rect key="frame" x="0.0" y="0.0" width="375" height="64"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="63"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7No-sO-dZQ"> @@ -688,14 +688,14 @@ </connections> </tableViewCell> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="AllMails" textLabel="VTZ-4w-fot" style="IBUITableViewCellStyleDefault" id="dM9-jb-EcN"> - <rect key="frame" x="0.0" y="251.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="252" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="dM9-jb-EcN" id="tvN-re-z1Z"> - <rect key="frame" x="0.0" y="0.0" width="342" height="43.5"/> + <rect key="frame" x="0.0" y="0.0" width="342" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="VTZ-4w-fot"> - <rect key="frame" x="15" y="0.0" width="325" height="43.5"/> + <rect key="frame" x="15" y="0.0" width="325" height="43"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> @@ -708,10 +708,10 @@ </connections> </tableViewCell> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="KeyCell" id="Lke-0s-P0i" userLabel="KeyCell"> - <rect key="frame" x="0.0" y="295.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="296" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Lke-0s-P0i" id="QYX-AX-hbo"> - <rect key="frame" x="0.0" y="0.0" width="342" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="342" height="43"/> <autoresizingMask key="autoresizingMask"/> </tableViewCellContentView> <connections> @@ -719,10 +719,10 @@ </connections> </tableViewCell> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="RecordCell" id="hTc-vs-AIl" customClass="RecordCell" customModule="enzevalos_iphone" customModuleProvider="target"> - <rect key="frame" x="0.0" y="339.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="340" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hTc-vs-AIl" id="pJ9-4e-7at"> - <rect key="frame" x="0.0" y="0.0" width="342" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="342" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Ll6-yF-xkq"> @@ -784,7 +784,7 @@ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <button key="tableFooterView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="KaX-Vg-m5j"> - <rect key="frame" x="0.0" y="381.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="382" width="375" height="44"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <state key="normal" title="Delete Key"> <color key="titleColor" red="1" green="0.089482954909999995" blue="0.088961529910000003" alpha="1" colorSpace="calibratedRGB"/> @@ -795,21 +795,21 @@ </button> <prototypes> <tableViewCell clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="KeyIDCell" textLabel="Z5E-3a-5Ef" detailTextLabel="Vun-jB-lcm" style="IBUITableViewCellStyleValue1" id="a8L-fv-t1M"> - <rect key="frame" x="0.0" y="55.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="56" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="a8L-fv-t1M" id="ALw-Gc-69v"> - <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Z5E-3a-5Ef"> - <rect key="frame" x="15" y="12" width="33.5" height="20.5"/> + <rect key="frame" x="15" y="11" width="34" height="21"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="KeyID" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Vun-jB-lcm"> - <rect key="frame" x="315.5" y="12" width="44.5" height="20.5"/> + <rect key="frame" x="315" y="11" width="45" height="21"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> @@ -819,21 +819,21 @@ </tableViewCellContentView> </tableViewCell> <tableViewCell clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="EncryptionTypeCell" textLabel="xLe-fn-BGo" detailTextLabel="zgd-cr-Abh" style="IBUITableViewCellStyleValue1" id="Egg-xY-sSJ"> - <rect key="frame" x="0.0" y="99.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="100" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Egg-xY-sSJ" id="dSQ-wL-Ce5"> - <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="xLe-fn-BGo"> - <rect key="frame" x="15" y="12" width="33.5" height="20.5"/> + <rect key="frame" x="15" y="11" width="34" height="21"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Encryption Type" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="zgd-cr-Abh"> - <rect key="frame" x="236" y="12" width="124" height="20.5"/> + <rect key="frame" x="236" y="11" width="124" height="21"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> @@ -843,21 +843,21 @@ </tableViewCellContentView> </tableViewCell> <tableViewCell clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="DiscoveryTimeCell" textLabel="SsF-tc-fh9" detailTextLabel="8Bf-LY-F5a" style="IBUITableViewCellStyleValue1" id="EGH-Rf-UaM"> - <rect key="frame" x="0.0" y="143.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="144" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="EGH-Rf-UaM" id="XTH-YT-cQc"> - <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="SsF-tc-fh9"> - <rect key="frame" x="15" y="12" width="33.5" height="20.5"/> + <rect key="frame" x="15" y="11" width="34" height="21"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Discovery Time" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="8Bf-LY-F5a"> - <rect key="frame" x="242" y="12" width="118" height="20.5"/> + <rect key="frame" x="242" y="11" width="118" height="21"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> @@ -867,21 +867,21 @@ </tableViewCellContentView> </tableViewCell> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="DiscoveryMailCell" textLabel="xHD-7H-RVy" detailTextLabel="6ZP-Mh-yIb" style="IBUITableViewCellStyleValue1" id="677-kr-LkB"> - <rect key="frame" x="0.0" y="187.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="188" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="677-kr-LkB" id="IQ5-Gi-qeQ"> - <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="xHD-7H-RVy"> - <rect key="frame" x="15" y="12" width="33.5" height="20.5"/> + <rect key="frame" x="15" y="11" width="34" height="21"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Discovery Mail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="6ZP-Mh-yIb"> - <rect key="frame" x="249" y="12" width="111" height="20.5"/> + <rect key="frame" x="249" y="11" width="111" height="21"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> @@ -891,26 +891,26 @@ </tableViewCellContentView> </tableViewCell> <tableViewCell clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="VerifiedCell" id="5ET-zj-Kvo"> - <rect key="frame" x="0.0" y="231.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="232" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="5ET-zj-Kvo" id="fa5-Cl-aUs"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> </tableViewCellContentView> </tableViewCell> <tableViewCell clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="RevokedCell" id="HCb-NN-jRV"> - <rect key="frame" x="0.0" y="275.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="276" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="HCb-NN-jRV" id="x7q-Ah-gqN"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> </tableViewCellContentView> </tableViewCell> <tableViewCell clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="MailAddressCell" id="bbX-V8-LTe"> - <rect key="frame" x="0.0" y="319.5" width="375" height="44"/> + <rect key="frame" x="0.0" y="320" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bbX-V8-LTe" id="y3K-o0-TAX"> - <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> </tableViewCellContentView> </tableViewCell> @@ -939,14 +939,15 @@ <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" keyboardDismissMode="interactive" translatesAutoresizingMaskIntoConstraints="NO" id="sij-Oe-ann"> <rect key="frame" x="1" y="0.0" width="376" height="667"/> <subviews> - <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="redraw" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="KMI-R1-Q95"> + <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" placeholderIntrinsicWidth="373" placeholderIntrinsicHeight="100" showsVerticalScrollIndicator="NO" dataMode="prototypes" prefetchingEnabled="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KMI-R1-Q95"> <rect key="frame" x="0.0" y="44" width="373" height="100"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstAttribute="height" constant="100" id="k38-La-Ttc"/> </constraints> - <collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="cPu-U2-9dn"> - <size key="itemSize" width="90" height="90"/> + <inset key="scrollIndicatorInsets" minX="0.0" minY="5" maxX="0.0" maxY="0.0"/> + <collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="0.0" id="9i2-JL-XDt"> + <size key="itemSize" width="90" height="100"/> <size key="headerReferenceSize" width="0.0" height="0.0"/> <size key="footerReferenceSize" width="0.0" height="0.0"/> <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/> @@ -1279,9 +1280,9 @@ </scene> </scenes> <inferredMetricsTieBreakers> - <segue reference="ecN-Wn-7S0"/> - <segue reference="D6m-L0-5AB"/> <segue reference="DcR-GX-scc"/> <segue reference="rhW-cI-4c4"/> + <segue reference="ecN-Wn-7S0"/> + <segue reference="D6m-L0-5AB"/> </inferredMetricsTieBreakers> </document> diff --git a/enzevalos_iphone/CollectionDataDelegate.swift b/enzevalos_iphone/CollectionDataDelegate.swift index 92d408e7d0d9d2854bf3266061a2f41d59017e10..6fa93da0d844751a9dbb5f7ce530f7c645028c34 100644 --- a/enzevalos_iphone/CollectionDataDelegate.swift +++ b/enzevalos_iphone/CollectionDataDelegate.swift @@ -10,36 +10,74 @@ import UIKit class CollectionDataDelegate : NSObject, UICollectionViewDataSource, UICollectionViewDelegate { + var collectionView: UICollectionView? + var suggestionFunc : (([String]) -> [(UIImage, String, String, UIImage?, UIColor)]) //[bereits eingetragene emailadresse] -> [(Kontaktbild, Name, Emailadresse, emailTypeImage)] - var alreadyInserted : [String] = [] + var alreadyInserted : [String] = [] { + didSet { + if let collectionView = self.collectionView { + let diff = collectionView.numberOfItems(inSection: 0) - self.oldCount + /*if diff > 0 { + for i in 0..<diff { + collectionView.insertItems(at: [IndexPath.init(row: collectionView.numberOfItems(inSection: 0)-diff+i, section: 0)]) + } + }*/ + /*if diff < 0 { + for i in 0 ..< -diff { + collectionView.deleteItems(at: [IndexPath.init(row: collectionView.numberOfItems(inSection: 0), section: 0)]) + } + }*/ + oldCount = collectionView.numberOfItems(inSection: 0) + } + } + } + private var oldCount = 10 var insertCallback : (String, String) -> Void = {(name : String, address : String) -> Void in return} + private var reloading = false + + //used in suggestionFunc static let maxFrequent = 10 - init(suggestionFunc: @escaping ([String]) -> [(UIImage, String, String, UIImage?, UIColor)], insertCallback : @escaping (String, String) -> Void){ + init(suggestionFunc: @escaping ([String]) -> [(UIImage, String, String, UIImage?, UIColor)], insertCallback : @escaping (String, String) -> Void, collectionView: UICollectionView?){ self.suggestionFunc = suggestionFunc self.insertCallback = insertCallback + self.collectionView = collectionView super.init() + if let collectionView = self.collectionView { + oldCount = self.collectionView(collectionView, numberOfItemsInSection: 0) + } } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { print(suggestionFunc(alreadyInserted).count) print("section: ",section) - return suggestionFunc(alreadyInserted).count + var retVal = suggestionFunc(alreadyInserted).count + /*if reloading { + retVal += 1 + }*/ + return retVal } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { print(indexPath.row, indexPath.description) let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "frequent", for: indexPath) as! FrequentCell + cell.autoresizingMask = UIViewAutoresizing.flexibleHeight + //cell.translatesAutoresizingMaskIntoConstraints = false + cell.frame = CGRect.init(x: 90*indexPath.row, y: 0, width: 90, height: 90) + cell.clipsToBounds = true + cell.bounds = CGRect.init(x: 90*indexPath.row, y: 0, width: 90, height: 90) + cell.contentView.frame = CGRect.init(x: 90*indexPath.row, y: 0, width: 90, height: 90) + let index = indexPath.row cell.img.layer.cornerRadius = cell.img.frame.height/2 cell.img.clipsToBounds = true - cell.img.image = suggestionFunc(alreadyInserted)[indexPath.row].0 - cell.name.text = suggestionFunc(alreadyInserted)[indexPath.row].1 - cell.address = suggestionFunc(alreadyInserted)[indexPath.row].2 - if suggestionFunc(alreadyInserted)[indexPath.row].3 != nil { - cell.type.image = suggestionFunc(alreadyInserted)[indexPath.row].3 - cell.drawBackgroud(suggestionFunc(alreadyInserted)[indexPath.row].4) + cell.img.image = suggestionFunc(alreadyInserted)[index].0 + cell.name.text = suggestionFunc(alreadyInserted)[index].1 + cell.address = suggestionFunc(alreadyInserted)[index].2 + if suggestionFunc(alreadyInserted)[index].3 != nil { + cell.type.image = suggestionFunc(alreadyInserted)[index].3 + cell.drawBackgroud(suggestionFunc(alreadyInserted)[index].4) } else { cell.type.image = UIImage() @@ -48,8 +86,30 @@ class CollectionDataDelegate : NSObject, UICollectionViewDataSource, UICollectio return cell } + func numberOfSections(in collectionView: UICollectionView) -> Int { + return 1 + } + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let tuple = suggestionFunc(alreadyInserted)[indexPath.row] - insertCallback(tuple.1, tuple.2) + if !reloading { + insertCallback(tuple.1, tuple.2) + } + } + + func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + print("display \(indexPath)") } + + func reloadBugfix(collectionView: UICollectionView) { + reloading = true + //collectionView.insertItems(at: [IndexPath.init(row: 0, section: 0)]) + let loop = self.collectionView(collectionView, numberOfItemsInSection: 0) + for i in 0..<loop { + collectionView.selectItem(at: IndexPath.init(row: i, section: 0), animated: true, scrollPosition: UICollectionViewScrollPosition.bottom) + } + //collectionView.selectItem(at: IndexPath.init(row: 0, section: 0), animated: true, scrollPosition: UICollectionViewScrollPosition.bottom) + reloading = false + } + } diff --git a/enzevalos_iphone/FrequentCell.swift b/enzevalos_iphone/FrequentCell.swift index b8ba0fa408648fc5df5dddd1301a6fefc35042c6..3f62c2ea2d907fac0515d79f89aace755b0c9cec 100644 --- a/enzevalos_iphone/FrequentCell.swift +++ b/enzevalos_iphone/FrequentCell.swift @@ -17,6 +17,18 @@ class FrequentCell : UICollectionViewCell { var address = "" var identifier = "" + override init(frame: CGRect) { + super.init(frame: frame) + print("Rect") + self.frame = CGRect.init(x: 0, y: 0, width: 90, height: 90) + } + + required init?(coder aDecoder: NSCoder) { + print("Coder") + super.init(coder: aDecoder) + self.frame = CGRect.init(x: 0, y: 33, width: 90, height: 90) + } + func drawBackgroud(_ color : UIColor){ var myBounds = CGRect() myBounds.size.width = 70 diff --git a/enzevalos_iphone/FrequentCell.xib b/enzevalos_iphone/FrequentCell.xib index 5ca7569a997c7d1e29af1dc1e16ccabd86730f0f..6508d5f1a72bded7d842376d209c26673ae79b4f 100644 --- a/enzevalos_iphone/FrequentCell.xib +++ b/enzevalos_iphone/FrequentCell.xib @@ -1,50 +1,56 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1421" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> + <device id="retina4_7" orientation="portrait"> + <adaptation id="fullscreen"/> + </device> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> + <capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="frequent" id="w2v-x8-dyj" customClass="FrequentCell" customModule="enzevalos_iphone" customModuleProvider="target"> + <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" preservesSuperviewLayoutMargins="YES" reuseIdentifier="frequent" id="w2v-x8-dyj" customClass="FrequentCell" customModule="enzevalos_iphone" customModuleProvider="target"> <rect key="frame" x="0.0" y="0.0" width="90" height="90"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> <rect key="frame" x="0.0" y="0.0" width="90" height="90"/> <autoresizingMask key="autoresizingMask"/> <subviews> - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EAf-Ln-NIo"> - <frame key="frameInset" minX="10" width="60" height="70"/> + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="EAf-Ln-NIo"> + <rect key="frame" x="10" y="8" width="70" height="70"/> <constraints> <constraint firstAttribute="height" constant="70" id="QGM-0P-eJO"/> + <constraint firstAttribute="width" constant="70" id="voM-WQ-GbE"/> </constraints> </imageView> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2IJ-xu-7fu" userLabel="background"> - <frame key="frameInset" minX="60" minY="41" width="28" height="29"/> + <rect key="frame" x="60" y="41" width="28" height="29"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> </imageView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PpF-WH-X3b"> - <frame key="frameInset" minX="24" minY="74" width="33" height="16"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PpF-WH-X3b"> + <rect key="frame" x="24" y="82" width="33" height="8"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <nil key="highlightedColor"/> </label> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0Km-aB-hr6"> - <frame key="frameInset" minX="64" minY="45" width="20" height="20"/> + <rect key="frame" x="64" y="45" width="20" height="20"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="tintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </imageView> </subviews> </view> + <rect key="contentStretch" x="1" y="1" width="0.0" height="0.0"/> <constraints> <constraint firstItem="PpF-WH-X3b" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="w2v-x8-dyj" secondAttribute="leading" constant="5" id="3br-Vm-olJ"/> <constraint firstAttribute="trailing" secondItem="EAf-Ln-NIo" secondAttribute="trailing" constant="10" id="7ga-yh-RtT"/> <constraint firstAttribute="bottom" secondItem="PpF-WH-X3b" secondAttribute="bottom" id="FO3-Bu-Mfq" userLabel="bottom = Name.bottom"/> - <constraint firstItem="PpF-WH-X3b" firstAttribute="centerX" secondItem="w2v-x8-dyj" secondAttribute="centerX" id="J0p-Wn-JmD"/> + <constraint firstItem="PpF-WH-X3b" firstAttribute="centerX" secondItem="w2v-x8-dyj" secondAttribute="centerX" constant="-4.5" id="J0p-Wn-JmD"/> <constraint firstItem="PpF-WH-X3b" firstAttribute="top" secondItem="EAf-Ln-NIo" secondAttribute="bottom" constant="4" id="q6O-5t-WCb"/> - <constraint firstItem="EAf-Ln-NIo" firstAttribute="top" secondItem="w2v-x8-dyj" secondAttribute="top" id="tSd-gS-rCL"/> + <constraint firstItem="EAf-Ln-NIo" firstAttribute="top" secondItem="w2v-x8-dyj" secondAttribute="topMargin" id="tSd-gS-rCL"/> <constraint firstItem="EAf-Ln-NIo" firstAttribute="leading" secondItem="w2v-x8-dyj" secondAttribute="leading" constant="10" id="wBg-8I-TqR" userLabel="Img.leading = leading + 5"/> </constraints> <size key="customSize" width="80" height="90"/> diff --git a/enzevalos_iphone/FrequentCollectionViewLayout.swift b/enzevalos_iphone/FrequentCollectionViewLayout.swift index 3703e6637ab40b662e026706f3c2d1f761d5757d..d15637e479fbb8f6a5b31b9d38e45a3bb253cb49 100644 --- a/enzevalos_iphone/FrequentCollectionViewLayout.swift +++ b/enzevalos_iphone/FrequentCollectionViewLayout.swift @@ -9,5 +9,46 @@ import UIKit class FrequentCollectionViewLayout : UICollectionViewFlowLayout { + override init() { + super.init() + //self.scrollDirection = UICollectionViewScrollDirection.horizontal + } + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) +//self.scrollDirection = UICollectionViewScrollDirection.horizontal + self.invalidateLayout() + } + + override var collectionViewContentSize: CGSize { + get{ + if let cv = self.collectionView { + if let number = self.collectionView?.dataSource?.collectionView(cv, numberOfItemsInSection: 0) { + print("layout: \(number)") + return CGSize(width: 90*number, height: 90) + } + } + return CGSize(width: 0, height: 90) + } + } + + override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { + var attr = UICollectionViewLayoutAttributes.init(forCellWith: IndexPath.init(row: 0, section: 0)) + return [attr] + } + + override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { + let attr = UICollectionViewLayoutAttributes.init(forCellWith: indexPath) + attr.frame = CGRect.init(x: 0, y: 0, width: 90, height: 90) + if indexPath.row == 1 { + attr.frame = CGRect.init(x: 90, y: 0, width: 90, height: 90) + } + return attr + } +} + +extension UICollectionViewFlowLayout { + func test() { + + } } diff --git a/enzevalos_iphone/SendViewController.swift b/enzevalos_iphone/SendViewController.swift index 497a56184450331d7f512171923a811973d5510f..38c123e100440c13ede7a20a831a16c8773cbdd2 100644 --- a/enzevalos_iphone/SendViewController.swift +++ b/enzevalos_iphone/SendViewController.swift @@ -11,7 +11,7 @@ import VENTokenField import Contacts import KeychainAccess -class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecognizerDelegate, VENTokenFieldDelegate { +class SendViewController: UIViewController, UITextViewDelegate, VENTokenFieldDelegate { var imageView: UIImageView = UIImageView(frame: CGRect(x: 0, y: 5, width: 200, height: 45)) @IBOutlet weak var button: UIBarButtonItem! @@ -47,7 +47,7 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni var dataDelegate = VENDataDelegate() var mailHandler = AppDelegate.getAppDelegate().mailHandler var tableDataDelegate = TableViewDataDelegate(insertCallback: { (name: String, address: String) -> Void in return }) - var collectionDataDelegate = CollectionDataDelegate(suggestionFunc: AddressHandler.frequentAddresses, insertCallback: { (name: String, address: String) -> Void in return }) + var collectionDataDelegate = CollectionDataDelegate(suggestionFunc: AddressHandler.frequentAddresses, insertCallback: { (name: String, address: String) -> Void in return }, collectionView: nil) var recognizer: UIGestureRecognizer = UIGestureRecognizer.init() var answerTo: Mail? = nil @@ -57,7 +57,7 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni super.viewDidLoad() dataDelegate = VENDataDelegate(changeFunc: self.editName, tappedWhenSelectedFunc: self.showContact, deleteFunc: /*{() -> Void in return}*/self.addFrequentCellIfPossible) tableDataDelegate = TableViewDataDelegate(insertCallback: self.insertName) - collectionDataDelegate = CollectionDataDelegate(suggestionFunc: AddressHandler.frequentAddresses, insertCallback: self.insertName) + collectionDataDelegate = CollectionDataDelegate(suggestionFunc: AddressHandler.frequentAddresses, insertCallback: self.insertName, collectionView: toCollectionview) setAnimation() textView.delegate = self @@ -255,36 +255,7 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni return true } - @IBAction func tapped(_ sender: UITapGestureRecognizer) { - //print(sender.description) - //print(String(sender.view?.valueForKey("UILoggingName"))) - if LogHandler.logging { - LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "tap", point: sender.location(ofTouch: sender.numberOfTouches - 1, in: self.view), /*debugDescription: sender.view.debugDescription,*/ comment: "") - } - } - - @IBAction func panned(_ sender: UIPanGestureRecognizer) { - if LogHandler.logging { - if sender.state == .began { - LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "beginPan", point: sender.location(in: sender.view)/*CGPoint(x: 0,y: 0)*/, comment: String(describing: sender.translation(in: sender.view))) - } - if sender.state == .ended { - LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "endPan", point: sender.location(in: sender.view)/*CGPoint(x: 0,y: 0)*/, comment: String(describing: sender.translation(in: sender.view))) - } - } - } - - @IBAction func swiped(_ sender: UISwipeGestureRecognizer) { - if LogHandler.logging { - LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "swipe", point: sender.location(ofTouch: sender.numberOfTouches - 1, in: sender.view), comment: String(describing: sender.direction)) - } - } - - @IBAction func rotated(_ sender: UIRotationGestureRecognizer) { - if LogHandler.logging { - LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "rotate", point: CGPoint(x: 0, y: 0), comment: String(describing: sender.rotation)) - } - } + func tokenField(_ tokenField: VENTokenField, didChangeText text: String?) { if LogHandler.logging { @@ -308,8 +279,15 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni func reloadCollectionViews() { //toCollectionview.collectionViewLayout.invalidateLayout() - toCollectionview.reloadData()//collectionViewLayout.invalidateLayout() - ccCollectionview.reloadData()//collectionViewLayout.invalidateLayout() + //toCollectionview.reloadData()//collectionViewLayout.invalidateLayout() + //ccCollectionview.reloadData()//collectionViewLayout.invalidateLayout() + collectionDataDelegate.alreadyInserted = (toText.mailTokens as NSArray as! [String])+(ccText.mailTokens as NSArray as! [String]) + DispatchQueue.main.async { + self.collectionDataDelegate.alreadyInserted = (self.toText.mailTokens as NSArray as! [String])+(self.ccText.mailTokens as NSArray as! [String]) + self.toCollectionview.reloadData() + self.collectionDataDelegate.reloadBugfix(collectionView: self.toCollectionview) + print("reload") + } /*toCollectionviewHeight.constant += 200 ccCollectionviewHeight.constant += 200 toCollectionview.setNeedsDisplay() @@ -325,6 +303,14 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni } func addFrequentCellIfPossible() { + /*toCollectionview.performBatchUpdates({ + self.collectionDataDelegate.alreadyInserted = (self.toText.mailTokens as NSArray as! [String])+(self.ccText.mailTokens as NSArray as! [String]) + self.toCollectionview.insertItems(at: [IndexPath.init(row: 0, section: 0)]) + self.toCollectionview.collectionViewLayout.invalidateLayout() + self.toCollectionview.reloadData() + print(self.toCollectionview.contentSize) + print(self.toCollectionview.collectionViewLayout.collectionViewContentSize) + }, completion: nil)*/ //collectionDataDelegate.alreadyInserted = (toText.mailTokens as NSArray as! [String])+(ccText.mailTokens as NSArray as! [String]) //let len = collectionDataDelegate.collectionView(toCollectionview, numberOfItemsInSection: 0) //if len < CollectionDataDelegate.maxFrequent { @@ -343,12 +329,26 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni //toCollectionview.insertItemsAtIndexPaths([path]) //} collectionDataDelegate.alreadyInserted = (toText.mailTokens as NSArray as! [String])+(ccText.mailTokens as NSArray as! [String]) - toCollectionview.reloadData() + DispatchQueue.main.async { + self.collectionDataDelegate.alreadyInserted = (self.toText.mailTokens as NSArray as! [String])+(self.ccText.mailTokens as NSArray as! [String]) + self.toCollectionview.reloadData() + //self.toCollectionview.reloadSections(IndexSet.init(integer: self.collectionDataDelegate.numberOfSections(in: self.toCollectionview)-1)) + print("reload") + } + /*toCollectionview.reloadData() + toCollectionview.collectionViewLayout.invalidateLayout() + (toCollectionview.collectionViewLayout as! UICollectionViewFlowLayout).itemSize = CGSize.init(width: 90, height: toCollectionview.contentSize.height) + toCollectionview.invalidateIntrinsicContentSize() + toCollectionview.contentSize = CGSize.init(width: toCollectionview.contentSize.width+90, height: toCollectionview.contentSize.height) + + print(toCollectionview.visibleCells) + toCollectionview.collectionViewLayout.finalizeCollectionViewUpdates() + ccCollectionview.collectionViewLayout.finalizeCollectionViewUpdates() //toCollectionviewHeight.trans // toCollectionview.translatesAutoresizingMaskIntoConstraints = true //toCollectionview.startInteractiveTransitionToCollectionViewLayout(toCollectionview.collectionViewLayout, completion: nil) toCollectionview.reloadData() - ccCollectionview.reloadData() + ccCollectionview.reloadData()*/ } func showContact(_ email: String) { @@ -446,29 +446,13 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni print("no Access!") } } - - func doContact() { - AppDelegate.getAppDelegate().requestForAccess({ access in - print(access) - }) - let authorizationStatus = CNContactStore.authorizationStatus(for: CNEntityType.contacts) - if authorizationStatus == CNAuthorizationStatus.authorized { - do { - print(try AppDelegate.getAppDelegate().contactStore.unifiedContacts(matching: CNContact.predicateForContacts(matchingName: "o"), keysToFetch: [CNContactGivenNameKey as CNKeyDescriptor])) - } - catch { - print("exception") - } - print("contacts done") - } else { - print("no Access!") - } - } func newInput(_ tokenField: VENTokenField){ print("input") animateIfNeeded() - + /*collectionDataDelegate.alreadyInserted = [] + toCollectionview.reloadData() + ccCollectionview.reloadData() collectionDataDelegate.alreadyInserted = (toText.mailTokens as NSArray as! [String]) + (ccText.mailTokens as NSArray as! [String]) toCollectionview.reloadData() // toCollectionview.translatesAutoresizingMaskIntoConstraints = true @@ -477,6 +461,8 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni toCollectionview.setNeedsDisplay() // toCollectionview.translatesAutoresizingMaskIntoConstraints = false toCollectionview.reloadData() + ccCollectionview.reloadData()*/ + reloadCollectionViews() //let path = NSIndexPath.init(forRow: collectionDataDelegate.collectionView(toCollectionview, numberOfItemsInSection: 0)-1, inSection: 0) //toCollectionview.reloadItemsAtIndexPaths([path]) //toCollectionview.reloadData() @@ -507,10 +493,11 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni ccCollectionview.reloadData() } if !toText.isFirstResponder { - UIView.animate(withDuration: 2.5, animations: { () -> Void in self.toCollectionviewHeight.constant = 0 }) + //UIView.animate(withDuration: 2.5, animations: { () -> Void in self.toCollectionviewHeight.constant = 0 }) + //toCollectionview.isHidden = true } if !ccText.isFirstResponder { - ccCollectionviewHeight.constant = 0 + //ccCollectionviewHeight.constant = 0 } UIView.animate(withDuration: 0.1, animations: { () -> Void in @@ -677,3 +664,35 @@ class SendViewController: UIViewController, UITextViewDelegate, UIGestureRecogni } } +extension SendViewController: UIGestureRecognizerDelegate { + @IBAction func tapped(_ sender: UITapGestureRecognizer) { + //print(sender.description) + //print(String(sender.view?.valueForKey("UILoggingName"))) + if LogHandler.logging { + LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "tap", point: sender.location(ofTouch: sender.numberOfTouches - 1, in: self.view), /*debugDescription: sender.view.debugDescription,*/ comment: "") + } + } + + @IBAction func panned(_ sender: UIPanGestureRecognizer) { + if LogHandler.logging { + if sender.state == .began { + LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "beginPan", point: sender.location(in: sender.view)/*CGPoint(x: 0,y: 0)*/, comment: String(describing: sender.translation(in: sender.view))) + } + if sender.state == .ended { + LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "endPan", point: sender.location(in: sender.view)/*CGPoint(x: 0,y: 0)*/, comment: String(describing: sender.translation(in: sender.view))) + } + } + } + + @IBAction func swiped(_ sender: UISwipeGestureRecognizer) { + if LogHandler.logging { + LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "swipe", point: sender.location(ofTouch: sender.numberOfTouches - 1, in: sender.view), comment: String(describing: sender.direction)) + } + } + + @IBAction func rotated(_ sender: UIRotationGestureRecognizer) { + if LogHandler.logging { + LogHandler.doLog(UIViewResolver.resolve((sender.view?.tag)!), interaction: "rotate", point: CGPoint(x: 0, y: 0), comment: String(describing: sender.rotation)) + } + } +} diff --git a/enzevalos_iphoneTests/enzevalos_iphoneTests.swift b/enzevalos_iphoneTests/enzevalos_iphoneTests.swift index 2e8cecd908ea9a8bf94c649783c802c97d709971..7057b669b0cff03c22059ebcaf44fd0703780c4a 100644 --- a/enzevalos_iphoneTests/enzevalos_iphoneTests.swift +++ b/enzevalos_iphoneTests/enzevalos_iphoneTests.swift @@ -6,7 +6,7 @@ // Copyright © 2016 fu-berlin. All rights reserved. // -import XCTest +/*import XCTest @testable import enzevalos_iphone class enzevalos_iphoneTests: XCTestCase { @@ -54,4 +54,4 @@ class enzevalos_iphoneTests: XCTestCase { return true } -} +}*/