Convert FingerprintViewController to programmatic layout.

// FREEBIE
pull/1/head
Matthew Chen 7 years ago
parent 1ed0b16045
commit 3508feaec3

@ -159,7 +159,6 @@
45A6DAD71EBBF85500893231 /* ReminderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45A6DAD51EBBF85500893231 /* ReminderView.swift */; };
45AE48511E0732D6004D96C2 /* TurnServerInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45AE48501E0732D6004D96C2 /* TurnServerInfo.swift */; };
45AE48521E0732D6004D96C2 /* TurnServerInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45AE48501E0732D6004D96C2 /* TurnServerInfo.swift */; };
45B201761DAECBFE00C461E0 /* HighlightableLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45B201751DAECBFE00C461E0 /* HighlightableLabel.swift */; };
45BB93381E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45BB93371E688E14001E3939 /* UIDevice+featureSupport.swift */; };
45BB93391E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45BB93371E688E14001E3939 /* UIDevice+featureSupport.swift */; };
45BD60821DE9547E00A8F436 /* Contacts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45BD60811DE9547E00A8F436 /* Contacts.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
@ -582,7 +581,6 @@
45A6DAD51EBBF85500893231 /* ReminderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReminderView.swift; sourceTree = "<group>"; };
45AE48501E0732D6004D96C2 /* TurnServerInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TurnServerInfo.swift; sourceTree = "<group>"; };
45B201741DAECBFD00C461E0 /* Signal-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Signal-Bridging-Header.h"; sourceTree = "<group>"; };
45B201751DAECBFE00C461E0 /* HighlightableLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HighlightableLabel.swift; sourceTree = "<group>"; };
45BB93371E688E14001E3939 /* UIDevice+featureSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIDevice+featureSupport.swift"; sourceTree = "<group>"; };
45BD60811DE9547E00A8F436 /* Contacts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Contacts.framework; path = System/Library/Frameworks/Contacts.framework; sourceTree = SDKROOT; };
45BFFFA61D898AF0004A12A7 /* OWSStaleNotificationObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSStaleNotificationObserver.h; path = Observers/OWSStaleNotificationObserver.h; sourceTree = "<group>"; };
@ -1355,7 +1353,6 @@
451764281DE939FD00EDB8B9 /* ContactCell.xib */,
76EB052E18170B33006006FC /* ContactTableViewCell.h */,
76EB052F18170B33006006FC /* ContactTableViewCell.m */,
45B201751DAECBFE00C461E0 /* HighlightableLabel.swift */,
4531C9C21DD8E6D800F08304 /* JSQMessagesCollectionViewCell+OWS.h */,
4531C9C31DD8E6D800F08304 /* JSQMessagesCollectionViewCell+OWS.m */,
3453D8E91EC0D4ED003F9E6F /* OWSAlerts.swift */,
@ -2218,7 +2215,6 @@
45666F7B1D9C0533008FE134 /* OWSDatabaseMigration.m in Sources */,
B90418E6183E9DD40038554A /* DateUtil.m in Sources */,
34F3089C1ECA4CDB00BB7697 /* TSUnreadIndicatorInteraction.m in Sources */,
45B201761DAECBFE00C461E0 /* HighlightableLabel.swift in Sources */,
459311FC1D75C948008DD4F0 /* OWSDeviceTableViewCell.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;

@ -1,21 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="tuk-0x-yCb">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="tuk-0x-yCb">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="Menlo.ttc">
<string>Menlo-Regular</string>
</array>
</customFonts>
<scenes>
<!--Conversations-->
<scene sceneID="82U-Xj-21R">
@ -172,209 +167,6 @@
</objects>
<point key="canvasLocation" x="-1790" y="-2348"/>
</scene>
<!--Fingerprint View Controller-->
<scene sceneID="ldP-mt-Vsq">
<objects>
<viewController storyboardIdentifier="FingerprintViewController" extendedLayoutIncludesOpaqueBars="YES" modalPresentationStyle="overCurrentContext" id="urv-62-RsD" customClass="FingerprintViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="8Oc-YZ-y0M"/>
<viewControllerLayoutGuide type="bottom" id="hdo-6G-gXy"/>
</layoutGuides>
<view key="view" clipsSubviews="YES" contentMode="scaleToFill" id="StY-nr-mRe">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<visualEffectView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IeR-8W-ae8">
<rect key="frame" x="0.0" y="-40" width="375" height="663"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="0sM-dw-N3Z">
<rect key="frame" x="0.0" y="0.0" width="375" height="663"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view>
<blurEffect style="dark"/>
</visualEffectView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8DU-2J-HAz" userLabel="Scanner Container">
<rect key="frame" x="0.0" y="-334" width="375" height="334"/>
<subviews>
<containerView hidden="YES" opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MhA-kC-nBb" userLabel="Scanner">
<rect key="frame" x="0.0" y="64" width="375" height="270"/>
<connections>
<segue destination="EFG-13-FgR" kind="embed" identifier="embedIdentityQRScanner" id="0sF-Is-2kw"/>
</connections>
</containerView>
</subviews>
<constraints>
<constraint firstItem="MhA-kC-nBb" firstAttribute="leading" secondItem="8DU-2J-HAz" secondAttribute="leading" id="EwE-x7-nyJ"/>
<constraint firstAttribute="trailing" secondItem="MhA-kC-nBb" secondAttribute="trailing" id="Hj7-wD-3wR"/>
<constraint firstItem="MhA-kC-nBb" firstAttribute="top" secondItem="8DU-2J-HAz" secondAttribute="top" constant="64" id="JTj-zm-L8f"/>
<constraint firstAttribute="bottom" secondItem="MhA-kC-nBb" secondAttribute="bottom" id="RuO-nQ-fOf"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="b7W-j4-3S1" userLabel="QR Container">
<rect key="frame" x="0.0" y="0.0" width="375" height="334"/>
<subviews>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Scan the QR Code on your contact's device." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="NXP-Ue-iml">
<rect key="frame" x="16" y="16" width="343" height="21"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lA7-b4-o6C" userLabel="QR Frame">
<rect key="frame" x="61" y="72" width="254" height="254"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="btnQRShow--white" highlightedImage="btnQRShow--white-1" translatesAutoresizingMaskIntoConstraints="NO" id="YOs-e5-ee3" userLabel="Privacy Verification QR">
<rect key="frame" x="42" y="43" width="169" height="169"/>
<constraints>
<constraint firstAttribute="width" secondItem="YOs-e5-ee3" secondAttribute="height" multiplier="1:1" id="lN0-BE-w2c"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" secondItem="lA7-b4-o6C" secondAttribute="height" multiplier="1:1" id="01p-Ui-d1b"/>
<constraint firstItem="YOs-e5-ee3" firstAttribute="centerY" secondItem="lA7-b4-o6C" secondAttribute="centerY" id="ZRp-fU-qZu"/>
<constraint firstItem="YOs-e5-ee3" firstAttribute="centerX" secondItem="lA7-b4-o6C" secondAttribute="centerX" id="oWJ-Z4-8ke"/>
<constraint firstItem="YOs-e5-ee3" firstAttribute="height" secondItem="lA7-b4-o6C" secondAttribute="height" multiplier="2/3" id="svC-b9-cy9"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="lA7-b4-o6C" firstAttribute="top" relation="greaterThanOrEqual" secondItem="NXP-Ue-iml" secondAttribute="bottom" constant="16" id="IDA-9e-419"/>
<constraint firstItem="lA7-b4-o6C" firstAttribute="top" secondItem="b7W-j4-3S1" secondAttribute="top" constant="72" id="Kai-I1-2Fj"/>
<constraint firstAttribute="bottom" secondItem="lA7-b4-o6C" secondAttribute="bottom" constant="8" id="O2s-eE-YTr"/>
<constraint firstItem="NXP-Ue-iml" firstAttribute="leading" secondItem="b7W-j4-3S1" secondAttribute="leading" constant="16" id="atk-3T-Ckr"/>
<constraint firstAttribute="trailing" secondItem="NXP-Ue-iml" secondAttribute="trailing" constant="16" id="qK7-id-dnA"/>
<constraint firstItem="NXP-Ue-iml" firstAttribute="top" secondItem="b7W-j4-3S1" secondAttribute="top" constant="16" id="rvZ-u1-kQD"/>
<constraint firstItem="lA7-b4-o6C" firstAttribute="centerX" secondItem="b7W-j4-3S1" secondAttribute="centerX" id="zzE-ab-Qv9"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="B4o-Rc-z68" userLabel="Instructions Container">
<rect key="frame" x="0.0" y="334" width="375" height="289"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12345 54432 83456 89456 24327 87547 90123 31523 91052 84930 89304 00234" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e7E-iS-3Oc" userLabel="Privacy Verification Key Text" customClass="OWSHighlightableLabel">
<rect key="frame" x="36" y="0.0" width="303" height="70"/>
<gestureRecognizers/>
<constraints>
<constraint firstAttribute="height" constant="70" id="k9r-Fg-1QJ"/>
</constraints>
<fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="23"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Scan the code on your contact's device, or ask them to scan your code to verify that your messages are end-to-end encrypted." lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="DV4-GV-ZPf" userLabel="Instructions ">
<rect key="frame" x="16" y="78" width="343" height="109"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="bif-t1-qQO"/>
</constraints>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="top" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RX6-CJ-FV1">
<rect key="frame" x="143" y="207" width="89" height="70"/>
<constraints>
<constraint firstAttribute="height" constant="70" id="g0E-XL-o8K"/>
</constraints>
<inset key="titleEdgeInsets" minX="0.0" minY="44" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="43" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="Scan Code">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="didTouchUpInsideScanButton:" destination="urv-62-RsD" eventType="touchUpInside" id="YJi-1a-Pg7"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="btnCamera--white" translatesAutoresizingMaskIntoConstraints="NO" id="bwn-WS-pPa">
<rect key="frame" x="161" y="207" width="52" height="40"/>
</imageView>
</subviews>
<gestureRecognizers/>
<constraints>
<constraint firstItem="RX6-CJ-FV1" firstAttribute="centerX" secondItem="B4o-Rc-z68" secondAttribute="centerX" id="3Tz-CS-vgs"/>
<constraint firstItem="e7E-iS-3Oc" firstAttribute="leading" secondItem="B4o-Rc-z68" secondAttribute="leading" constant="36" id="7cQ-4a-DIS"/>
<constraint firstAttribute="bottom" secondItem="RX6-CJ-FV1" secondAttribute="bottom" constant="12" id="IFA-AS-nVw"/>
<constraint firstItem="e7E-iS-3Oc" firstAttribute="top" secondItem="B4o-Rc-z68" secondAttribute="top" id="NVF-Sc-fff"/>
<constraint firstItem="DV4-GV-ZPf" firstAttribute="top" secondItem="e7E-iS-3Oc" secondAttribute="bottom" constant="8" id="WaE-z7-y2j"/>
<constraint firstItem="RX6-CJ-FV1" firstAttribute="top" secondItem="DV4-GV-ZPf" secondAttribute="bottom" constant="20" id="XN2-Ok-U7y"/>
<constraint firstAttribute="trailing" secondItem="DV4-GV-ZPf" secondAttribute="trailing" constant="16" id="dFu-ak-X2j"/>
<constraint firstAttribute="trailing" secondItem="e7E-iS-3Oc" secondAttribute="trailing" constant="36" id="daW-7v-6MP"/>
<constraint firstItem="bwn-WS-pPa" firstAttribute="top" secondItem="RX6-CJ-FV1" secondAttribute="top" id="kP9-ti-KFk"/>
<constraint firstItem="bwn-WS-pPa" firstAttribute="centerX" secondItem="RX6-CJ-FV1" secondAttribute="centerX" id="rzB-mc-mHJ"/>
<constraint firstItem="DV4-GV-ZPf" firstAttribute="leading" secondItem="B4o-Rc-z68" secondAttribute="leading" constant="16" id="sZ7-tO-0jJ"/>
</constraints>
</view>
<navigationBar contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hFb-r7-ELc">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="TPT-Ir-ox2"/>
</constraints>
<items>
<navigationItem title="Title" id="d4h-j7-SJg"/>
</items>
</navigationBar>
</subviews>
<constraints>
<constraint firstItem="8DU-2J-HAz" firstAttribute="leading" secondItem="StY-nr-mRe" secondAttribute="leading" id="00e-Rm-0Uk"/>
<constraint firstAttribute="trailing" secondItem="IeR-8W-ae8" secondAttribute="trailing" id="14T-uq-nf6"/>
<constraint firstAttribute="trailing" secondItem="B4o-Rc-z68" secondAttribute="trailing" id="3ii-xe-El5"/>
<constraint firstItem="hdo-6G-gXy" firstAttribute="top" secondItem="B4o-Rc-z68" secondAttribute="bottom" id="ChJ-qg-hLJ"/>
<constraint firstItem="b7W-j4-3S1" firstAttribute="leading" secondItem="StY-nr-mRe" secondAttribute="leading" id="H4U-cb-hW7"/>
<constraint firstAttribute="trailing" secondItem="hFb-r7-ELc" secondAttribute="trailing" id="K1f-rb-8GL"/>
<constraint firstItem="B4o-Rc-z68" firstAttribute="leading" secondItem="StY-nr-mRe" secondAttribute="leading" id="KhC-UZ-RCj"/>
<constraint firstAttribute="trailing" secondItem="b7W-j4-3S1" secondAttribute="trailing" id="PRX-ZC-wpQ"/>
<constraint firstItem="B4o-Rc-z68" firstAttribute="top" secondItem="b7W-j4-3S1" secondAttribute="bottom" id="V05-1p-r0f"/>
<constraint firstItem="IeR-8W-ae8" firstAttribute="top" secondItem="8Oc-YZ-y0M" secondAttribute="bottom" constant="-60" id="a3D-CO-t78"/>
<constraint firstItem="hFb-r7-ELc" firstAttribute="top" secondItem="8Oc-YZ-y0M" secondAttribute="bottom" id="bBx-33-RaJ"/>
<constraint firstItem="b7W-j4-3S1" firstAttribute="top" secondItem="StY-nr-mRe" secondAttribute="topMargin" id="byY-vN-ywN"/>
<constraint firstItem="8DU-2J-HAz" firstAttribute="bottom" secondItem="b7W-j4-3S1" secondAttribute="top" id="fOH-xt-epL"/>
<constraint firstItem="IeR-8W-ae8" firstAttribute="leading" secondItem="StY-nr-mRe" secondAttribute="leading" id="noU-je-pMr"/>
<constraint firstAttribute="trailing" secondItem="8DU-2J-HAz" secondAttribute="trailing" id="s7e-Xw-wGe"/>
<constraint firstItem="8DU-2J-HAz" firstAttribute="height" secondItem="StY-nr-mRe" secondAttribute="height" multiplier="1/2" id="sBp-BU-UlW"/>
<constraint firstItem="hdo-6G-gXy" firstAttribute="top" secondItem="IeR-8W-ae8" secondAttribute="bottom" id="vE7-Zn-0bf"/>
<constraint firstItem="hFb-r7-ELc" firstAttribute="leading" secondItem="StY-nr-mRe" secondAttribute="leading" id="vIc-tj-wK4"/>
<constraint firstItem="b7W-j4-3S1" firstAttribute="height" secondItem="StY-nr-mRe" secondAttribute="height" multiplier="1/2" id="wXF-0d-U9i"/>
</constraints>
</view>
<toolbarItems/>
<navigationItem key="navigationItem" id="Gye-4f-x42"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="dismissModalButton" destination="kAa-FW-3Am" id="1rW-zn-Xoh"/>
<outlet property="instructionsContainer" destination="B4o-Rc-z68" id="Rc4-wf-8jw"/>
<outlet property="instructionsLabel" destination="DV4-GV-ZPf" id="f1p-P7-QOi"/>
<outlet property="modalNavigationBar" destination="hFb-r7-ELc" id="P4F-u6-H6q"/>
<outlet property="privacyVerificationFingerprint" destination="e7E-iS-3Oc" id="IA0-ZU-vKJ"/>
<outlet property="privacyVerificationQRCode" destination="YOs-e5-ee3" id="Sbg-HQ-tnD"/>
<outlet property="privacyVerificationQRCodeFrame" destination="lA7-b4-o6C" id="xgr-YI-DIC"/>
<outlet property="qrContainer" destination="b7W-j4-3S1" id="IpY-w1-yk6"/>
<outlet property="qrScanningView" destination="MhA-kC-nBb" id="gNX-7s-wIG"/>
<outlet property="scanButton" destination="RX6-CJ-FV1" id="BKY-4g-g3U"/>
<outlet property="scanningContainer" destination="8DU-2J-HAz" id="FH9-yo-8uI"/>
<outlet property="scanningInstructions" destination="NXP-Ue-iml" id="Iqf-NS-kzM"/>
<outlet property="shareButton" destination="k9L-LH-YS4" id="kPI-Du-1Lk"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="sd1-mY-rAe" userLabel="First Responder" sceneMemberID="firstResponder"/>
<barButtonItem systemItem="stop" id="kAa-FW-3Am" userLabel="Dismiss Button">
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="closeButtonAction:" destination="urv-62-RsD" id="Odq-bS-LCh"/>
</connections>
</barButtonItem>
<barButtonItem systemItem="action" id="k9L-LH-YS4" userLabel="Share Button">
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="didTapShareButton" destination="urv-62-RsD" id="Oqj-ag-vEG"/>
</connections>
</barButtonItem>
</objects>
<point key="canvasLocation" x="-860" y="-1285"/>
</scene>
<!--Signals Navigation Controller-->
<scene sceneID="miN-Ma-3eR">
<objects>
@ -594,29 +386,8 @@
</objects>
<point key="canvasLocation" x="-1632" y="-3228"/>
</scene>
<!--Identity QR Scanner-->
<scene sceneID="BBm-xb-dFO">
<objects>
<viewController title="Identity QR Scanner" id="EFG-13-FgR" customClass="OWSQRCodeScanningViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="xM5-Dm-A1I"/>
<viewControllerLayoutGuide type="bottom" id="w3c-y6-c5W"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Z7D-4g-GIf">
<rect key="frame" x="0.0" y="0.0" width="375" height="270"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ExB-N2-kxx" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-612" y="-2546"/>
</scene>
</scenes>
<resources>
<image name="btnCamera--white" width="52" height="40"/>
<image name="btnQRShow--white" width="66" height="66"/>
<image name="btnQRShow--white-1" width="66" height="66"/>
<image name="contact-options-action" width="44" height="44"/>
<image name="ic_devices_ios" width="180" height="119"/>
<image name="settings" width="44" height="44"/>

@ -12,8 +12,4 @@ extension UIStoryboard {
class var main: UIStoryboard {
return UIStoryboard(name: StoryboardName.main.rawValue, bundle: Bundle.main)
}
class func instantiateFingerprintViewController() -> FingerprintViewController {
return self.main.instantiateViewController(withIdentifier: "FingerprintViewController") as! FingerprintViewController
}
}

@ -28,6 +28,11 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value);
- (void)autoHCenterInSuperview;
- (void)autoVCenterInSuperview;
- (void)autoPinWidthToWidthOfView:(UIView *)view;
- (void)autoPinHeightToHeightOfView:(UIView *)view;
- (NSLayoutConstraint *)autoPinToSquareAspectRatio;
#pragma mark - Content Hugging and Compression Resistance
- (void)setContentHuggingLow;

@ -65,6 +65,37 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
[self autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.superview];
}
- (void)autoPinWidthToWidthOfView:(UIView *)view
{
OWSAssert(view);
[self autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:view];
[self autoPinEdge:ALEdgeRight toEdge:ALEdgeRight ofView:view];
}
- (void)autoPinHeightToHeightOfView:(UIView *)view
{
OWSAssert(view);
[self autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:view];
[self autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:view];
}
- (NSLayoutConstraint *)autoPinToSquareAspectRatio
{
self.translatesAutoresizingMaskIntoConstraints = NO;
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual
toItem:self
attribute:NSLayoutAttributeHeight
multiplier:1.f
constant:0.f];
[constraint autoInstall];
return constraint;
}
#pragma mark - Content Hugging and Compression Resistance
- (void)setContentHuggingLow

@ -416,6 +416,10 @@ typedef enum : NSUInteger {
[self initializeToolbars];
[self createScrollDownButton];
dispatch_async(dispatch_get_main_queue(), ^{
[self showConversationSettings];
});
}
- (void)registerCustomMessageNibs
@ -1180,16 +1184,11 @@ typedef enum : NSUInteger {
// return from FingerprintViewController.
[self dismissKeyBoard];
UIViewController *viewController =
[[UIStoryboard main] instantiateViewControllerWithIdentifier:@"FingerprintViewController"];
if (![viewController isKindOfClass:[FingerprintViewController class]]) {
OWSAssert(NO);
DDLogError(@"%@ expecting fingerprint view controller, but got: %@", self.tag, viewController);
return;
}
FingerprintViewController *fingerprintViewController = (FingerprintViewController *)viewController;
FingerprintViewController *fingerprintViewController = [FingerprintViewController new];
[fingerprintViewController configureWithRecipientId:recipientId];
[self presentViewController:fingerprintViewController animated:YES completion:nil];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:fingerprintViewController];
[self presentViewController:navigationController animated:YES completion:nil];
}
#pragma mark - Calls

@ -4,6 +4,8 @@
#import <JSQMessagesViewController/JSQMessagesViewController.h>
NS_ASSUME_NONNULL_BEGIN
@class SignalAttachment;
@protocol OWSTextViewPasteDelegate <NSObject>
@ -21,3 +23,5 @@
@property (weak, nonatomic) id<OWSTextViewPasteDelegate> textViewPasteDelegate;
@end
NS_ASSUME_NONNULL_END

@ -5,6 +5,8 @@
#import "OWSMessagesComposerTextView.h"
#import "Signal-Swift.h"
NS_ASSUME_NONNULL_BEGIN
@implementation OWSMessagesComposerTextView
- (BOOL)canBecomeFirstResponder
@ -19,7 +21,7 @@
return ([SignalAttachment pasteboardHasPossibleAttachment] && ![SignalAttachment pasteboardHasText]);
}
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
- (BOOL)canPerformAction:(SEL)action withSender:(nullable id)sender
{
if (action == @selector(paste:)) {
if ([self pasteboardHasPossibleAttachment]) {
@ -29,7 +31,7 @@
return [super canPerformAction:action withSender:sender];
}
- (void)paste:(id)sender
- (void)paste:(nullable id)sender
{
if ([self pasteboardHasPossibleAttachment]) {
SignalAttachment *attachment = [SignalAttachment attachmentFromPasteboard];
@ -66,3 +68,5 @@
}
@end
NS_ASSUME_NONNULL_END

@ -4,6 +4,8 @@
#import <JSQMessagesViewController/JSQMessagesViewController.h>
NS_ASSUME_NONNULL_BEGIN
@interface OWSMessagesInputToolbar : JSQMessagesInputToolbar
- (void)showVoiceMemoUI;
@ -13,3 +15,5 @@
- (void)setVoiceMemoUICancelAlpha:(CGFloat)cancelAlpha;
@end
NS_ASSUME_NONNULL_END

@ -10,6 +10,8 @@
#import "ViewControllerUtils.h"
#import <SignalServiceKit/NSTimer+OWS.h>
NS_ASSUME_NONNULL_BEGIN
@interface OWSMessagesInputToolbar () <OWSSendMessageGestureDelegate>
@property (nonatomic) UIView *voiceMemoUI;
@ -229,3 +231,5 @@
}
@end
NS_ASSUME_NONNULL_END

@ -4,6 +4,8 @@
#import <JSQMessagesViewController/JSQMessagesViewController.h>
NS_ASSUME_NONNULL_BEGIN
@protocol OWSVoiceMemoGestureDelegate <NSObject>
- (void)voiceMemoGestureDidStart;
@ -39,3 +41,5 @@
- (void)cancelVoiceMemoIfNecessary;
@end
NS_ASSUME_NONNULL_END

@ -5,6 +5,8 @@
#import "OWSMessagesToolbarContentView.h"
#import "UIColor+OWS.h"
NS_ASSUME_NONNULL_BEGIN
@interface OWSMessagesToolbarContentView () <UIGestureRecognizerDelegate>
@property (nonatomic) BOOL shouldShowVoiceMemoButton;
@ -216,3 +218,5 @@
}
@end
NS_ASSUME_NONNULL_END

@ -710,10 +710,11 @@ NS_ASSUME_NONNULL_BEGIN
signedPreKeyId:0
signedPreKeySignature:[self createRandomNSDataOfSize:16]
identityKey:[self createRandomNSDataOfSize:16]];
[result addObject:[TSInvalidIdentityKeySendingErrorMessage untrustedKeyWithOutgoingMessage:outgoingMessage
inThread:thread
forRecipient:@"+19174054215"
preKeyBundle:preKeyBundle]];
// [result addObject:[TSInvalidIdentityKeySendingErrorMessage
// untrustedKeyWithOutgoingMessage:outgoingMessage
// inThread:thread
// forRecipient:@"+19174054215"
// preKeyBundle:preKeyBundle]];
}
return result;

@ -4,7 +4,9 @@
#import "FingerprintViewController.h"
#import "Environment.h"
#import "OWSBezierPathView.h"
#import "OWSConversationSettingsTableViewController.h"
#import "OWSQRCodeScanningViewController.h"
#import "Signal-Swift.h"
#import "UIUtil.h"
#import "UIViewController+CameraPermissions.h"
@ -19,26 +21,41 @@
NS_ASSUME_NONNULL_BEGIN
@interface FingerprintViewController () <OWSHighlightableLabelDelegate, OWSCompareSafetyNumbersActivityDelegate>
typedef void (^CustomLayoutBlock)();
@interface CustomLayoutView : UIView
@property (nonatomic) CustomLayoutBlock layoutBlock;
@end
#pragma mark -
@implementation CustomLayoutView
- (void)layoutSubviews
{
self.layoutBlock();
}
@end
#pragma mark -
@interface FingerprintViewController () <OWSCompareSafetyNumbersActivityDelegate>
@property (nonatomic) TSStorageManager *storageManager;
@property (nonatomic) OWSFingerprint *fingerprint;
@property (nonatomic) NSString *contactName;
@property (nonatomic) OWSQRCodeScanningViewController *qrScanningController;
@property (nonatomic) IBOutlet UINavigationBar *modalNavigationBar;
@property (nonatomic) IBOutlet UIBarButtonItem *dismissModalButton;
@property (nonatomic) IBOutlet UIBarButtonItem *shareButton;
@property (nonatomic) IBOutlet UIView *qrScanningView;
@property (nonatomic) IBOutlet UILabel *scanningInstructions;
@property (nonatomic) IBOutlet UIView *scanningContainer;
@property (nonatomic) IBOutlet UIView *instructionsContainer;
@property (nonatomic) IBOutlet UIView *qrContainer;
@property (nonatomic) IBOutlet UIView *privacyVerificationQRCodeFrame;
@property (nonatomic) IBOutlet UIImageView *privacyVerificationQRCode;
@property (nonatomic) IBOutlet OWSHighlightableLabel *privacyVerificationFingerprint;
@property (nonatomic) IBOutlet UILabel *instructionsLabel;
@property (nonatomic) IBOutlet UIButton *scanButton;
@property (nonatomic) UIBarButtonItem *shareButton;
@property (nonatomic) UIView *mainView;
@property (nonatomic) UIView *referenceView;
@property (nonatomic) UIView *cameraView;
@property (nonatomic) NSLayoutConstraint *verticalAlignmentConstraint;
@property (nonatomic) BOOL isScanning;
@end
@ -63,59 +80,236 @@ NS_ASSUME_NONNULL_BEGIN
[builder fingerprintWithTheirSignalId:recipientId theirIdentityKey:recipientIdentity.identityKey];
}
- (void)viewDidLoad
- (void)loadView
{
[super viewDidLoad];
[super loadView];
self.title = NSLocalizedString(@"PRIVACY_VERIFICATION_TITLE", @"Navbar title");
self.navigationItem.leftBarButtonItem = self.dismissModalButton;
self.navigationItem.leftBarButtonItem =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
target:self
action:@selector(closeButton)];
self.shareButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
target:self
action:@selector(didTapShareButton)];
self.navigationItem.rightBarButtonItem = self.shareButton;
[self.modalNavigationBar pushNavigationItem:self.navigationItem animated:NO];
// HACK for transparent navigation bar.
[self.modalNavigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.modalNavigationBar.shadowImage = [UIImage new];
self.modalNavigationBar.translucent = YES;
// HACK to get full width preview layer
CGRect oldFrame = self.qrScanningView.frame;
CGRect newFrame = CGRectMake(oldFrame.origin.x,
oldFrame.origin.y,
self.view.frame.size.width,
self.view.frame.size.height / 2.0f - oldFrame.origin.y);
self.qrScanningView.frame = newFrame;
// END HACK to get full width preview layer
self.title = NSLocalizedString(@"PRIVACY_VERIFICATION_TITLE", @"Navbar title");
NSString *instructionsFormat = NSLocalizedString(@"PRIVACY_VERIFICATION_INSTRUCTIONS",
@"Paragraph(s) shown alongside the safety number when verifying privacy with {{contact name}}");
self.instructionsLabel.text = [NSString stringWithFormat:instructionsFormat, self.contactName];
[self createViews];
}
NSString *scanTitle = NSLocalizedString(@"SCAN_CODE_ACTION",
@"Button label presented with camera icon while verifying privacy credentials. Shows the camera interface.");
[self.scanButton setTitle:scanTitle forState:UIControlStateNormal];
self.scanningInstructions.text
- (void)createViews
{
UIColor *darkGrey = [UIColor colorWithRGBHex:0x404040];
self.view.backgroundColor = [UIColor whiteColor];
UIView *referenceView = [UIView new];
self.referenceView = referenceView;
[self.view addSubview:referenceView];
[referenceView autoPinWidthToSuperview];
[referenceView autoPinToTopLayoutGuideOfViewController:self withInset:0];
[referenceView autoPinToBottomLayoutGuideOfViewController:self withInset:0];
UIView *mainView = [UIView new];
self.mainView = mainView;
mainView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:mainView];
[mainView autoPinWidthToSuperview];
[[NSLayoutConstraint constraintWithItem:mainView
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:referenceView
attribute:NSLayoutAttributeHeight
multiplier:1.0
constant:0.f] autoInstall];
[mainView
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(mainViewTapped:)]];
mainView.userInteractionEnabled = YES;
UIView *cameraView = [UIView new];
self.cameraView = cameraView;
cameraView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:cameraView];
[cameraView autoPinWidthToSuperview];
[cameraView autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:mainView];
[cameraView autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:mainView];
self.qrScanningController = [OWSQRCodeScanningViewController new];
self.qrScanningController.scanDelegate = self;
[cameraView addSubview:self.qrScanningController.view];
[self.qrScanningController.view autoPinWidthToSuperview];
[self.qrScanningController.view autoSetDimension:ALDimensionHeight toSize:270];
[self.qrScanningController.view autoPinEdgeToSuperviewEdge:ALEdgeTop];
UILabel *cameraInstructionLabel = [UILabel new];
cameraInstructionLabel.text
= NSLocalizedString(@"SCAN_CODE_INSTRUCTIONS", @"label presented once scanning (camera) view is visible.");
cameraInstructionLabel.font = [UIFont ows_regularFontWithSize:14.f];
cameraInstructionLabel.textColor = darkGrey;
cameraInstructionLabel.textAlignment = NSTextAlignmentCenter;
cameraInstructionLabel.numberOfLines = 0;
cameraInstructionLabel.lineBreakMode = NSLineBreakByWordWrapping;
[cameraView addSubview:cameraInstructionLabel];
[cameraInstructionLabel autoPinWidthToSuperviewWithMargin:16.f];
[cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:10.f];
[cameraInstructionLabel autoPinEdge:ALEdgeTop
toEdge:ALEdgeBottom
ofView:self.qrScanningController.view
withOffset:10.f];
// Scan Button
UIView *scanButton = [UIView new];
[scanButton
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(scanButtonTapped:)]];
[mainView addSubview:scanButton];
[scanButton autoPinWidthToSuperview];
[scanButton autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:12.f];
UILabel *scanButtonLabel = [UILabel new];
scanButtonLabel.text = NSLocalizedString(@"SCAN_CODE_ACTION",
@"Button label presented with camera icon while verifying privacy credentials. Shows the camera interface.");
scanButtonLabel.font = [UIFont ows_regularFontWithSize:18.f];
scanButtonLabel.textColor = darkGrey;
[scanButton addSubview:scanButtonLabel];
[scanButtonLabel autoHCenterInSuperview];
[scanButtonLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom];
UIImage *scanButtonImage = [UIImage imageNamed:@"btnCamera--white"];
OWSAssert(scanButtonImage);
UIImageView *scanButtonImageView = [UIImageView new];
scanButtonImageView.image = [scanButtonImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
scanButtonImageView.tintColor = darkGrey;
[scanButton addSubview:scanButtonImageView];
[scanButtonImageView autoHCenterInSuperview];
[scanButtonImageView autoPinEdgeToSuperviewEdge:ALEdgeTop];
[scanButtonImageView autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:scanButtonLabel withOffset:-5.f];
// Instructions
NSString *instructionsFormat = NSLocalizedString(@"PRIVACY_VERIFICATION_INSTRUCTIONS",
@"Paragraph(s) shown alongside the safety number when verifying privacy with {{contact name}}");
UILabel *instructionsLabel = [UILabel new];
instructionsLabel.text = [NSString stringWithFormat:instructionsFormat, self.contactName];
UIFont *instructionsFont = [UIFont ows_dynamicTypeBodyFont];
instructionsFont = [instructionsFont fontWithSize:instructionsFont.pointSize * 0.65f];
instructionsLabel.font = instructionsFont;
instructionsLabel.textColor = darkGrey;
instructionsLabel.textAlignment = NSTextAlignmentCenter;
instructionsLabel.numberOfLines = 0;
instructionsLabel.lineBreakMode = NSLineBreakByWordWrapping;
[mainView addSubview:instructionsLabel];
[instructionsLabel autoPinWidthToSuperviewWithMargin:16.f];
[instructionsLabel autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:scanButton withOffset:-20.f];
// Fingerprint Label
UILabel *fingerprintLabel = [UILabel new];
fingerprintLabel.text = self.fingerprint.displayableText;
fingerprintLabel.font = [UIFont fontWithName:@"Menlo-Regular" size:23.f];
fingerprintLabel.textColor = darkGrey;
fingerprintLabel.numberOfLines = 3;
fingerprintLabel.lineBreakMode = NSLineBreakByTruncatingTail;
fingerprintLabel.adjustsFontSizeToFitWidth = YES;
[fingerprintLabel
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(fingerprintLabelTapped:)]];
fingerprintLabel.userInteractionEnabled = YES;
[mainView addSubview:fingerprintLabel];
[fingerprintLabel autoPinWidthToSuperviewWithMargin:36.f];
[fingerprintLabel autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:instructionsLabel withOffset:-8.f];
// Fingerprint Image
CustomLayoutView *fingerprintView = [CustomLayoutView new];
[mainView addSubview:fingerprintView];
[fingerprintView autoPinWidthToSuperview];
[fingerprintView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:10.f];
[fingerprintView autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:fingerprintLabel withOffset:-10.f];
[fingerprintView
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(fingerprintViewTapped:)]];
fingerprintView.userInteractionEnabled = YES;
OWSBezierPathView *fingerprintCircle = [OWSBezierPathView new];
[fingerprintCircle setConfigureShapeLayerBlock:^(CAShapeLayer *layer, CGRect bounds) {
layer.fillColor = darkGrey.CGColor;
CGFloat size = MIN(bounds.size.width, bounds.size.height);
CGRect circle = CGRectMake((bounds.size.width - size) * 0.5f, (bounds.size.height - size) * 0.5f, size, size);
layer.path = [UIBezierPath bezierPathWithOvalInRect:circle].CGPath;
}];
[fingerprintView addSubview:fingerprintCircle];
[fingerprintCircle autoPinWidthToSuperview];
[fingerprintCircle autoPinHeightToSuperview];
UIImageView *fingerprintImageView = [UIImageView new];
fingerprintImageView.image = self.fingerprint.image;
fingerprintImageView.layer.magnificationFilter = kCAFilterNearest;
fingerprintImageView.layer.minificationFilter = kCAFilterNearest;
[fingerprintView addSubview:fingerprintImageView];
fingerprintView.layoutBlock = ^{
CGFloat size = round(MIN(fingerprintView.width, fingerprintView.height) * 0.65f);
fingerprintImageView.frame = CGRectMake(
round((fingerprintView.width - size) * 0.5f), round((fingerprintView.height - size) * 0.5f), size, size);
};
// Safety numbers and QR Code
self.privacyVerificationFingerprint.text = self.fingerprint.displayableText;
self.privacyVerificationQRCode.image = self.fingerprint.image;
[self updateLayoutForIsScanning:NO animated:NO];
}
// Don't antialias QRCode
self.privacyVerificationQRCode.layer.magnificationFilter = kCAFilterNearest;
- (void)showScanningViews
{
[self updateLayoutForIsScanning:YES animated:YES];
}
self.privacyVerificationFingerprint.delegate = self;
- (void)hideScanningViews
{
[self updateLayoutForIsScanning:NO animated:YES];
}
- (void)viewDidLayoutSubviews
- (void)updateLayoutForIsScanning:(BOOL)isScanning animated:(BOOL)animated
{
[super viewDidLayoutSubviews];
// On iOS8, the QRCodeFrame hasn't been layed out yet (causing the QRCode to be hidden), force it here.
[self.privacyVerificationQRCodeFrame setNeedsLayout];
[self.privacyVerificationQRCodeFrame layoutIfNeeded];
// Round QR Code.
self.privacyVerificationQRCodeFrame.layer.masksToBounds = YES;
self.privacyVerificationQRCodeFrame.layer.cornerRadius = self.privacyVerificationQRCodeFrame.frame.size.height / 2;
self.isScanning = isScanning;
if (self.verticalAlignmentConstraint) {
[NSLayoutConstraint deactivateConstraints:@[ self.verticalAlignmentConstraint ]];
}
if (isScanning) {
self.verticalAlignmentConstraint =
[self.cameraView autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.referenceView];
} else {
self.verticalAlignmentConstraint =
[self.mainView autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.referenceView];
}
[self.view setNeedsLayout];
// Show scanning views immediately.
if (isScanning) {
self.shareButton.enabled = NO;
self.cameraView.hidden = NO;
}
void (^completion)() = ^{
if (!isScanning) {
// Hide scanning views after they are offscreen.
self.shareButton.enabled = YES;
self.cameraView.hidden = YES;
}
};
if (animated) {
[UIView animateWithDuration:0.4
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
[self.view layoutSubviews];
}
completion:^(BOOL finished) {
if (finished) {
completion();
}
}];
} else {
completion();
}
}
- (void)viewWillAppear:(BOOL)animated
@ -132,23 +326,8 @@ NS_ASSUME_NONNULL_BEGIN
}
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(nullable id)sender
{
if ([segue.identifier isEqualToString:@"embedIdentityQRScanner"]) {
OWSQRCodeScanningViewController *qrScanningController
= (OWSQRCodeScanningViewController *)segue.destinationViewController;
self.qrScanningController = qrScanningController;
qrScanningController.scanDelegate = self;
}
}
#pragma mark - HilightableLableDelegate
- (void)didHighlightLabel:(OWSHighlightableLabel *)label completion:(nullable void (^)(void))completionHandler
{
[self showSharingActivityWithCompletion:completionHandler];
}
- (void)showSharingActivityWithCompletion:(nullable void (^)(void))completionHandler
{
DDLogDebug(@"%@ Sharing safety numbers", self.tag);
@ -197,21 +376,16 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Action
- (IBAction)closeButtonAction:(id)sender
- (void)closeButton
{
[self dismissViewControllerAnimated:YES completion:nil];
}
- (IBAction)didTapShareButton
- (void)didTapShareButton
{
[self showSharingActivityWithCompletion:nil];
}
- (IBAction)didTouchUpInsideScanButton:(id)sender
{
[self showScanner];
}
- (void)showScanner
{
[self ows_askForCameraPermissions:^{
@ -219,21 +393,11 @@ NS_ASSUME_NONNULL_BEGIN
// Camera stops capturing when "sharing" while in capture mode.
// Also, it's less obvious whats being "shared" at this point,
// so just disable sharing when in capture mode.
self.shareButton.enabled = NO;
DDLogInfo(@"%@ Showing Scanner", self.tag);
self.qrScanningView.hidden = NO;
self.scanningInstructions.hidden = NO;
[UIView animateWithDuration:0.4
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
self.scanningContainer.frame = self.qrContainer.frame;
self.qrContainer.frame = self.instructionsContainer.frame;
self.instructionsContainer.alpha = 0.0f;
}
completion:nil];
[self showScanningViews];
[self.qrScanningController startCapture];
}
alertActionHandler:nil];
@ -293,17 +457,7 @@ NS_ASSUME_NONNULL_BEGIN
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:dismissText style:UIAlertActionStyleCancel handler: ^(UIAlertAction *action){
// Restore previous layout
self.shareButton.enabled = YES;
self.qrScanningView.hidden = YES;
self.scanningInstructions.hidden = YES;
[UIView animateWithDuration:0.4
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
self.instructionsContainer.alpha = 1.0f;
self.qrContainer.frame = self.scanningContainer.frame;
}
completion:nil];
[self hideScanningViews];
}];
[failureAlertController addAction:dismissAction];
@ -321,10 +475,48 @@ NS_ASSUME_NONNULL_BEGIN
- (void)dismissViewControllerAnimated:(BOOL)flag completion:(nullable void (^)(void))completion
{
self.qrScanningView.hidden = YES;
[self updateLayoutForIsScanning:NO animated:NO];
[super dismissViewControllerAnimated:flag completion:completion];
}
- (void)scanButtonTapped:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer.state == UIGestureRecognizerStateRecognized) {
[self showScanner];
}
}
- (void)fingerprintLabelTapped:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer.state == UIGestureRecognizerStateRecognized) {
if (self.isScanning) {
[self hideScanningViews];
return;
}
[self showSharingActivityWithCompletion:nil];
}
}
- (void)fingerprintViewTapped:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer.state == UIGestureRecognizerStateRecognized) {
if (self.isScanning) {
[self hideScanningViews];
return;
}
[self showSharingActivityWithCompletion:nil];
}
}
- (void)mainViewTapped:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer.state == UIGestureRecognizerStateRecognized) {
if (self.isScanning) {
[self hideScanningViews];
}
}
}
#pragma mark - Logging
+ (NSString *)tag

@ -194,6 +194,15 @@ NS_ASSUME_NONNULL_BEGIN
}
[self updateTableContents];
dispatch_async(dispatch_get_main_queue(), ^{
FingerprintViewController *fingerprintViewController = [FingerprintViewController new];
[fingerprintViewController configureWithRecipientId:self.thread.contactIdentifier];
fingerprintViewController.dismissDelegate = self;
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:fingerprintViewController];
[self presentViewController:navigationController animated:YES completion:nil];
});
}
- (void)updateTableContents
@ -222,11 +231,12 @@ NS_ASSUME_NONNULL_BEGIN
if (!strongSelf) {
return;
}
FingerprintViewController *fingerprintViewController = [[UIStoryboard main]
instantiateViewControllerWithIdentifier:@"FingerprintViewController"];
FingerprintViewController *fingerprintViewController = [FingerprintViewController new];
[fingerprintViewController configureWithRecipientId:strongSelf.thread.contactIdentifier];
fingerprintViewController.dismissDelegate = strongSelf;
[strongSelf presentViewController:fingerprintViewController animated:YES completion:nil];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:fingerprintViewController];
[strongSelf presentViewController:navigationController animated:YES completion:nil];
}]];
}

@ -1,9 +1,9 @@
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSQRCodeScanningViewController.h"
#import "UIColor+OWS.h"
//#import <ZXingObjC/ZXingObjC.h>
@interface OWSQRCodeScanningViewController ()
@ -12,9 +12,10 @@
@property UIView *maskingView;
@property CALayer *maskingLayer;
@end
#pragma mark -
@implementation OWSQRCodeScanningViewController
- (void)dealloc

@ -82,11 +82,10 @@ class SafetyNumberConfirmationAlert: NSObject {
}
public func presentSafetyNumberViewController(theirIdentityKey: Data, theirRecipientId: String, theirDisplayName: String, completion: (() -> Void)? = nil) {
let fingerprintViewController = UIStoryboard.instantiateFingerprintViewController()
let fingerprintViewController = FingerprintViewController()
fingerprintViewController.configure(recipientId: theirRecipientId)
UIApplication.shared.frontmostViewController?.present(fingerprintViewController, animated: true, completion: completion)
let navigationController = UINavigationController(rootViewController:fingerprintViewController)
UIApplication.shared.frontmostViewController?.present(navigationController, animated: true, completion: completion)
}
private func untrustedIdentityForSending(recipientIds: [String]) -> OWSRecipientIdentity? {

@ -202,6 +202,10 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS
object:nil];
[self updateBarButtonItems];
dispatch_async(dispatch_get_main_queue(), ^{
[self tableView:nil didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
});
}
- (void)updateBarButtonItems {

@ -1,65 +0,0 @@
// Created by Michael Kirk on 10/12/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
import UIKit
@objc(OWSHighlightableLabelDelegate)
protocol HighlightableLabelDelegate {
func didHighlightLabel(_ label:HighlightableLabel, completion: (()->())?) -> ()
}
@objc(OWSHighlightableLabel)
class HighlightableLabel : UILabel {
deinit {
NotificationCenter.default.removeObserver(self);
}
var delegate: HighlightableLabelDelegate?
override init(frame: CGRect) {
super.init(frame: frame)
setupGestureRecognizer()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setupGestureRecognizer()
}
@IBInspectable var borderColor: UIColor? {
didSet {
layer.borderColor = borderColor?.cgColor
}
}
override func drawText(in rect: CGRect) {
let insets = UIEdgeInsets.init(top: 5, left: 5, bottom: 5, right: 5)
super.drawText(in: UIEdgeInsetsInsetRect(rect, insets))
}
func hideBorder() {
layer.borderWidth = 0
}
func showBorder() {
layer.borderWidth = 1.0
}
func setupGestureRecognizer() {
isUserInteractionEnabled = true
let longpressGestureRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(highlightGesture))
addGestureRecognizer(longpressGestureRecognizer)
NotificationCenter.default.addObserver(self, selector: #selector(hideBorder), name:NSNotification.Name.UIMenuControllerWillHideMenu, object: nil)
}
func highlightGesture(gestureRecognizer: UILongPressGestureRecognizer) {
guard gestureRecognizer.state == .began else {
return
}
becomeFirstResponder();
showBorder()
self.delegate?.didHighlightLabel(self, completion:{ self.hideBorder() })
}
}

@ -4,6 +4,8 @@
typedef void (^ConfigureShapeLayerBlock)(CAShapeLayer *layer, CGRect bounds);
NS_ASSUME_NONNULL_BEGIN
@interface OWSBezierPathView : UIView
// Configure the view with this method if it uses a single Bezier path.
@ -20,3 +22,5 @@ typedef void (^ConfigureShapeLayerBlock)(CAShapeLayer *layer, CGRect bounds);
- (void)updateLayers;
@end
NS_ASSUME_NONNULL_END

@ -4,12 +4,16 @@
#import "OWSBezierPathView.h"
NS_ASSUME_NONNULL_BEGIN
@interface OWSBezierPathView ()
@property (nonatomic) NSArray<ConfigureShapeLayerBlock> *configureShapeLayerBlocks;
@end
#pragma mark -
@implementation OWSBezierPathView
- (id)init
@ -109,3 +113,5 @@
}
@end
NS_ASSUME_NONNULL_END

@ -5,6 +5,8 @@
#import <JSQMessagesViewController/JSQMessagesCollectionViewCell.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class TSInteraction;
@protocol OWSSystemMessageCellDelegate <NSObject>
@ -26,3 +28,5 @@
+ (CGSize)cellSizeForInteraction:(TSInteraction *)interaction collectionViewWidth:(CGFloat)collectionViewWidth;
@end
NS_ASSUME_NONNULL_END

@ -16,6 +16,8 @@
#import <SignalServiceKit/TSErrorMessage.h>
#import <SignalServiceKit/TSInfoMessage.h>
NS_ASSUME_NONNULL_BEGIN
@interface OWSSystemMessageCell ()
@property (nonatomic, nullable) TSInteraction *interaction;
@ -280,3 +282,5 @@
}
@end
NS_ASSUME_NONNULL_END

@ -5,6 +5,8 @@
#import <JSQMessagesViewController/JSQMessagesCollectionViewCell.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class TSUnreadIndicatorInteraction;
@interface OWSUnreadIndicatorCell : JSQMessagesCollectionViewCell
@ -17,3 +19,5 @@
collectionViewWidth:(CGFloat)collectionViewWidth;
@end
NS_ASSUME_NONNULL_END

@ -10,6 +10,8 @@
#import "UIView+OWS.h"
#import <JSQMessagesViewController/UIView+JSQMessages.h>
NS_ASSUME_NONNULL_BEGIN
@interface OWSUnreadIndicatorCell ()
@property (nonatomic, nullable) TSUnreadIndicatorInteraction *interaction;
@ -246,3 +248,5 @@
}
@end
NS_ASSUME_NONNULL_END

Loading…
Cancel
Save