Longpress to copy safety numbers
Nothing else to see here. =) ༼ つ ◕◡◕ ༽つ [swift] // FREEBIE
This commit is contained in:
parent
da82c01f6e
commit
1e417ea93f
|
@ -39,6 +39,7 @@
|
|||
458E383A1D6699FA0094BD24 /* OWSDeviceProvisioningURLParserTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 458E38391D6699FA0094BD24 /* OWSDeviceProvisioningURLParserTest.m */; };
|
||||
459311FC1D75C948008DD4F0 /* OWSDeviceTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 459311FB1D75C948008DD4F0 /* OWSDeviceTableViewCell.m */; };
|
||||
459C3F0D1C9B3A1B003ACF51 /* TSMessageAdapterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 459C3F0C1C9B3A1B003ACF51 /* TSMessageAdapterTest.m */; };
|
||||
45B201761DAECBFE00C461E0 /* CopyableLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45B201751DAECBFE00C461E0 /* CopyableLabel.swift */; };
|
||||
45BFFFA81D898AF0004A12A7 /* OWSStaleNotificationObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 45BFFFA71D898AF0004A12A7 /* OWSStaleNotificationObserver.m */; };
|
||||
45BFFFA91D898AF0004A12A7 /* OWSStaleNotificationObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 45BFFFA71D898AF0004A12A7 /* OWSStaleNotificationObserver.m */; };
|
||||
45C681B71D305A580050903A /* OWSCall.m in Sources */ = {isa = PBXBuildFile; fileRef = 45C681B61D305A580050903A /* OWSCall.m */; };
|
||||
|
@ -577,6 +578,8 @@
|
|||
4597E94E1D8313C100040CDE /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = translations/sq.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
4597E94F1D8313CB00040CDE /* bg */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = bg; path = translations/bg.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
459C3F0C1C9B3A1B003ACF51 /* TSMessageAdapterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TSMessageAdapterTest.m; path = "view controllers/Signals/TSMessageAdapters/TSMessageAdapterTest.m"; sourceTree = "<group>"; };
|
||||
45B201741DAECBFD00C461E0 /* Signal-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Signal-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
45B201751DAECBFE00C461E0 /* CopyableLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CopyableLabel.swift; sourceTree = "<group>"; };
|
||||
45BFFFA61D898AF0004A12A7 /* OWSStaleNotificationObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWSStaleNotificationObserver.h; path = Observers/OWSStaleNotificationObserver.h; sourceTree = "<group>"; };
|
||||
45BFFFA71D898AF0004A12A7 /* OWSStaleNotificationObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OWSStaleNotificationObserver.m; path = Observers/OWSStaleNotificationObserver.m; sourceTree = "<group>"; };
|
||||
45C681B51D305A580050903A /* OWSCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSCall.h; sourceTree = "<group>"; };
|
||||
|
@ -1287,6 +1290,7 @@
|
|||
76EB052B18170B33006006FC /* Views */,
|
||||
76EB04FE18170B33006006FC /* View Controllers */,
|
||||
45BFFFA51D898AB8004A12A7 /* Observers */,
|
||||
45B201741DAECBFD00C461E0 /* Signal-Bridging-Header.h */,
|
||||
);
|
||||
path = src;
|
||||
sourceTree = "<group>";
|
||||
|
@ -1779,6 +1783,7 @@
|
|||
76EB052B18170B33006006FC /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
45B201751DAECBFE00C461E0 /* CopyableLabel.swift */,
|
||||
45C681C11D305C9E0050903A /* OWSDisplayedMessageCollectionViewCell.h */,
|
||||
45C681C21D305C9E0050903A /* OWSDisplayedMessageCollectionViewCell.m */,
|
||||
45C681C31D305C9E0050903A /* OWSDisplayedMessageCollectionViewCell.xib */,
|
||||
|
@ -2447,6 +2452,7 @@
|
|||
TargetAttributes = {
|
||||
D221A088169C9E5E00537ABF = {
|
||||
DevelopmentTeam = U68MSDN6DR;
|
||||
LastSwiftMigration = 0800;
|
||||
SystemCapabilities = {
|
||||
com.apple.DataProtection = {
|
||||
enabled = 1;
|
||||
|
@ -2907,6 +2913,7 @@
|
|||
76EB05C618170B33006006FC /* HelloAckPacket.m in Sources */,
|
||||
76EB05E818170B33006006FC /* CallFailedServerMessage.m in Sources */,
|
||||
76EB05FA18170B33006006FC /* CallConnectUtil_Responder.m in Sources */,
|
||||
45B201761DAECBFE00C461E0 /* CopyableLabel.swift in Sources */,
|
||||
76EB05AE18170B33006006FC /* SrtpStream.m in Sources */,
|
||||
E197B61318BBEC1A00F073E5 /* DesiredBufferDepthController.m in Sources */,
|
||||
76EB064818170B33006006FC /* Zid.m in Sources */,
|
||||
|
@ -3353,7 +3360,9 @@
|
|||
PRODUCT_BUNDLE_IDENTIFIER = org.whispersystems.signal;
|
||||
PRODUCT_NAME = Signal;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Signal/src/Signal-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_AFTER_BUILD = YES;
|
||||
VALID_ARCHS = "arm64 armv7 armv7s i386";
|
||||
WRAPPER_EXTENSION = app;
|
||||
|
@ -3410,6 +3419,8 @@
|
|||
PRODUCT_NAME = Signal;
|
||||
PROVISIONING_PROFILE = "";
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Signal/src/Signal-Bridging-Header.h";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_AFTER_BUILD = YES;
|
||||
VALID_ARCHS = "arm64 armv7 armv7s i386";
|
||||
WRAPPER_EXTENSION = app;
|
||||
|
@ -3420,6 +3431,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = AD2AB1207E8888E4262D781B /* Pods-SignalTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal";
|
||||
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
|
@ -3472,6 +3484,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = E85DB184824BA9DC302EC8B3 /* Pods-SignalTests.app store release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal";
|
||||
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
|
@ -187,13 +187,19 @@
|
|||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="B4o-Rc-z68" userLabel="Instructions Container">
|
||||
<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">
|
||||
<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="CopyableLabel" customModule="Signal" customModuleProvider="target">
|
||||
<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 ">
|
||||
<constraints>
|
||||
|
@ -229,9 +235,6 @@
|
|||
<constraint firstAttribute="trailing" secondItem="e7E-iS-3Oc" secondAttribute="trailing" constant="36" id="daW-7v-6MP"/>
|
||||
<constraint firstItem="DV4-GV-ZPf" firstAttribute="leading" secondItem="B4o-Rc-z68" secondAttribute="leading" constant="16" id="sZ7-tO-0jJ"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outletCollection property="gestureRecognizers" destination="Mg3-ad-PGG" appends="YES" id="fDZ-ZY-J04"/>
|
||||
</connections>
|
||||
</view>
|
||||
<navigationBar contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hFb-r7-ELc">
|
||||
<constraints>
|
||||
|
@ -289,8 +292,6 @@
|
|||
<action selector="closeButtonAction:" destination="urv-62-RsD" id="Odq-bS-LCh"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<tapGestureRecognizer id="fRl-Lt-y39"/>
|
||||
<tapGestureRecognizer id="Mg3-ad-PGG"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-1087" y="-2423"/>
|
||||
</scene>
|
||||
|
@ -352,11 +353,11 @@
|
|||
<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="Dzg-XO-ciX" id="KFb-kN-MV9">
|
||||
<frame key="frameInset" width="342" height="43"/>
|
||||
<frame key="frameInset" width="342" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Verify Safety Numbers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Iq5-ca-zUp">
|
||||
<frame key="frameInset" minX="62" width="278" height="43"/>
|
||||
<frame key="frameInset" minX="62" width="278" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
|
@ -377,7 +378,7 @@
|
|||
<rect key="frame" x="0.0" y="144" width="375" height="108"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="U6h-Xo-HEv" id="Nmz-2u-fOY">
|
||||
<frame key="frameInset" width="375" height="107"/>
|
||||
<frame key="frameInset" width="375" height="108"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Disappearing Messages" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="qbY-qJ-enK" userLabel="Disappearing Messages">
|
||||
|
@ -426,7 +427,7 @@
|
|||
<rect key="frame" x="0.0" y="252" width="375" height="76"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="3dL-aW-P1A" id="2a2-Po-p8O">
|
||||
<frame key="frameInset" width="375" height="75"/>
|
||||
<frame key="frameInset" width="375" height="76"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Messages disappear after 8 hours." lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="c6Q-rV-1LO" userLabel="Keep messages for 8 hours.">
|
||||
|
@ -472,11 +473,11 @@
|
|||
<rect key="frame" x="0.0" y="384" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="XHr-b6-Gvn" id="Epj-vT-UYL">
|
||||
<frame key="frameInset" width="342" height="43"/>
|
||||
<frame key="frameInset" width="342" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Update Group" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="NxZ-wa-xV9">
|
||||
<frame key="frameInset" minX="15" width="325" height="43"/>
|
||||
<frame key="frameInset" minX="15" width="325" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
|
@ -492,11 +493,11 @@
|
|||
<rect key="frame" x="0.0" y="428" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="w57-rz-BWN" id="Pgy-Fc-U25">
|
||||
<frame key="frameInset" width="342" height="43"/>
|
||||
<frame key="frameInset" width="342" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Leave Group" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="geN-YN-TQg">
|
||||
<frame key="frameInset" minX="15" width="325" height="43"/>
|
||||
<frame key="frameInset" minX="15" width="325" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
|
@ -509,11 +510,11 @@
|
|||
<rect key="frame" x="0.0" y="472" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Dnq-Ko-46l" id="VRQ-31-E5Y">
|
||||
<frame key="frameInset" width="342" height="43"/>
|
||||
<frame key="frameInset" width="342" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Group Members" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Zml-Zn-2fd">
|
||||
<frame key="frameInset" minX="15" width="325" height="43"/>
|
||||
<frame key="frameInset" minX="15" width="325" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
|
@ -1927,8 +1928,8 @@
|
|||
</view>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsMultipleSelection="YES" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="cFo-AT-Srf">
|
||||
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<view key="tableHeaderView" contentMode="scaleToFill" misplaced="YES" id="ekO-kw-iHV" userLabel="Header View">
|
||||
<rect key="frame" x="0.0" y="0.0" width="1000" height="40"/>
|
||||
<view key="tableHeaderView" contentMode="scaleToFill" id="ekO-kw-iHV" userLabel="Header View">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Add people" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="daD-wf-IGn">
|
||||
|
@ -1945,15 +1946,15 @@
|
|||
</constraints>
|
||||
</view>
|
||||
<prototypes>
|
||||
<tableViewCell contentMode="scaleToFill" misplaced="YES" selectionStyle="gray" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="GroupSearchCell" textLabel="a4j-OQ-ala" rowHeight="60" style="IBUITableViewCellStyleDefault" id="yfF-Jl-bZ1">
|
||||
<rect key="frame" x="0.0" y="62" width="1000" height="60"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="gray" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="GroupSearchCell" textLabel="a4j-OQ-ala" rowHeight="60" style="IBUITableViewCellStyleDefault" id="yfF-Jl-bZ1">
|
||||
<rect key="frame" x="0.0" y="62" width="375" height="60"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="yfF-Jl-bZ1" id="f0v-od-N9K">
|
||||
<frame key="frameInset" width="1000" height="60"/>
|
||||
<frame key="frameInset" width="375" height="60"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="a4j-OQ-ala">
|
||||
<frame key="frameInset" minX="164" width="672" height="59.5"/>
|
||||
<frame key="frameInset" minX="15" width="345" height="59.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#import "FingerprintViewController.h"
|
||||
#import "DJWActionSheet+OWS.h"
|
||||
#import "OWSConversationSettingsTableViewController.h"
|
||||
#import "Signal-Swift.h"
|
||||
#import <SignalServiceKit/NSDate+millisecondTimeStamp.h>
|
||||
#import <SignalServiceKit/OWSFingerprint.h>
|
||||
#import <SignalServiceKit/TSInfoMessage.h>
|
||||
|
@ -37,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
@property (strong, nonatomic) IBOutlet UIView *qrContainer;
|
||||
@property (strong, nonatomic) IBOutlet UIView *privacyVerificationQRCodeFrame;
|
||||
@property (strong, nonatomic) IBOutlet UIImageView *privacyVerificationQRCode;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *privacyVerificationFingerprint;
|
||||
@property (strong, nonatomic) IBOutlet CopyableLabel *privacyVerificationFingerprint;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *instructionsLabel;
|
||||
@property (strong, nonatomic) IBOutlet UIButton *scanButton;
|
||||
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
// Created by Michael Kirk on 10/12/16.
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
import UIKit
|
||||
|
||||
class CopyableLabel : UILabel {
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self);
|
||||
}
|
||||
|
||||
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(showMenuGesture))
|
||||
addGestureRecognizer(longpressGestureRecognizer)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(hideBorder), name:NSNotification.Name.UIMenuControllerWillHideMenu, object: nil)
|
||||
}
|
||||
|
||||
func showMenuGesture(gestureRecognizer: UILongPressGestureRecognizer) {
|
||||
guard gestureRecognizer.state == .began else {
|
||||
return
|
||||
}
|
||||
|
||||
becomeFirstResponder();
|
||||
showBorder()
|
||||
UIMenuController.shared.setTargetRect(self.frame, in: self.superview!)
|
||||
UIMenuController.shared.setMenuVisible(true, animated: true)
|
||||
}
|
||||
|
||||
// MARK: UIResponder
|
||||
|
||||
override var canBecomeFirstResponder: Bool { return true }
|
||||
|
||||
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
|
||||
return action == #selector(UIResponder.copy(_:))
|
||||
}
|
||||
|
||||
override func copy(_ sender: Any?) {
|
||||
NSLog("Copied safety numbers.")
|
||||
UIPasteboard.general.string = self.text
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue