From 64ab73baebc97490d0704500e5eb70f294e4d60c Mon Sep 17 00:00:00 2001 From: dtsbourg Date: Thu, 20 Nov 2014 17:07:04 +0100 Subject: [PATCH] General: Unused View controller clean up --- Signal.xcodeproj/project.pbxproj | 40 -- Signal/src/Storyboard/Storyboard.storyboard | 2 +- .../ContactDetailViewController.h | 28 -- .../ContactDetailViewController.m | 163 -------- .../PreferenceListViewController.xib | 35 -- .../view controllers/RegisterViewController.h | 39 -- .../view controllers/RegisterViewController.m | 377 ------------------ .../xibs/ContactDetailTableViewCell.xib | 47 --- .../xibs/ContactDetailViewController.xib | 69 ---- .../xibs/RegisterViewController.xib | 293 -------------- 10 files changed, 1 insertion(+), 1092 deletions(-) delete mode 100644 Signal/src/view controllers/ContactDetailViewController.h delete mode 100644 Signal/src/view controllers/ContactDetailViewController.m delete mode 100644 Signal/src/view controllers/PreferenceListViewController.xib delete mode 100644 Signal/src/view controllers/RegisterViewController.h delete mode 100644 Signal/src/view controllers/RegisterViewController.m delete mode 100644 Signal/src/view controllers/xibs/ContactDetailTableViewCell.xib delete mode 100644 Signal/src/view controllers/xibs/ContactDetailViewController.xib delete mode 100644 Signal/src/view controllers/xibs/RegisterViewController.xib diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 76d0c83ac..35a3ab540 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -29,7 +29,6 @@ 765052B3182BF839008313E1 /* HelveticaNeueLTStd-Th.otf in Resources */ = {isa = PBXBuildFile; fileRef = 765052B1182BF839008313E1 /* HelveticaNeueLTStd-Th.otf */; }; 768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 768A1A2A17FC9CD300E00ED8 /* libz.dylib */; }; 76919BF71805D190008C664A /* ContactManagerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 76919BF61805D190008C664A /* ContactManagerTest.m */; }; - 76B818A1182C39460088060E /* PreferenceListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76B8189D182C39460088060E /* PreferenceListViewController.xib */; }; 76C87F19181EFCE600C4ACAB /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */; }; 76D713E7182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D713E6182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m */; }; 76D713E8182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D713E6182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m */; }; @@ -229,22 +228,15 @@ 76EB064718170B33006006FC /* TimeUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04FA18170B33006006FC /* TimeUtil.m */; }; 76EB064818170B33006006FC /* Zid.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04FD18170B33006006FC /* Zid.m */; }; 76EB064918170B33006006FC /* Zid.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04FD18170B33006006FC /* Zid.m */; }; - 76EB064E18170B34006006FC /* ContactDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050418170B33006006FC /* ContactDetailViewController.m */; }; - 76EB064F18170B34006006FC /* ContactDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050418170B33006006FC /* ContactDetailViewController.m */; }; 76EB065018170B34006006FC /* DialerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050618170B33006006FC /* DialerViewController.m */; }; 76EB065118170B34006006FC /* DialerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050618170B33006006FC /* DialerViewController.m */; }; 76EB065618170B34006006FC /* InCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050C18170B33006006FC /* InCallViewController.m */; }; 76EB065718170B34006006FC /* InCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB050C18170B33006006FC /* InCallViewController.m */; }; 76EB065A18170B34006006FC /* NextResponderScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051018170B33006006FC /* NextResponderScrollView.m */; }; 76EB065B18170B34006006FC /* NextResponderScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051018170B33006006FC /* NextResponderScrollView.m */; }; - 76EB066018170B34006006FC /* RegisterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051618170B33006006FC /* RegisterViewController.m */; }; - 76EB066118170B34006006FC /* RegisterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB051618170B33006006FC /* RegisterViewController.m */; }; 76EB066918170B34006006FC /* CallAudioManagerDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051D18170B33006006FC /* CallAudioManagerDemo.xib */; }; - 76EB066D18170B34006006FC /* ContactDetailTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051F18170B33006006FC /* ContactDetailTableViewCell.xib */; }; - 76EB066F18170B34006006FC /* ContactDetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052018170B33006006FC /* ContactDetailViewController.xib */; }; 76EB067118170B34006006FC /* DialerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052118170B33006006FC /* DialerViewController.xib */; }; 76EB067918170B34006006FC /* InCallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052518170B33006006FC /* InCallViewController.xib */; }; - 76EB068118170B34006006FC /* RegisterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052918170B33006006FC /* RegisterViewController.xib */; }; 76EB068418170B34006006FC /* ContactDetailTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB052D18170B33006006FC /* ContactDetailTableViewCell.m */; }; 76EB068518170B34006006FC /* ContactDetailTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB052D18170B33006006FC /* ContactDetailTableViewCell.m */; }; 76EB068618170B34006006FC /* ContactTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB052F18170B33006006FC /* ContactTableViewCell.m */; }; @@ -566,13 +558,9 @@ E14874FE18A06951002CC4F3 /* PreferenceListTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76D713E9182D3E5100C9C9C8 /* PreferenceListTableViewCell.xib */; }; E14874FF18A06951002CC4F3 /* UnseenWhisperUserCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B9EB5AC81884D387007CBB57 /* UnseenWhisperUserCell.xib */; }; E148750018A06966002CC4F3 /* CallAudioManagerDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051D18170B33006006FC /* CallAudioManagerDemo.xib */; }; - E148750318A06966002CC4F3 /* ContactDetailTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB051F18170B33006006FC /* ContactDetailTableViewCell.xib */; }; - E148750418A06966002CC4F3 /* ContactDetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052018170B33006006FC /* ContactDetailViewController.xib */; }; E148750518A06966002CC4F3 /* CountryCodeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B97CBFA718860EA3008E0DE9 /* CountryCodeViewController.xib */; }; E148750618A06966002CC4F3 /* DialerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052118170B33006006FC /* DialerViewController.xib */; }; E148750A18A06966002CC4F3 /* InCallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052518170B33006006FC /* InCallViewController.xib */; }; - E148750D18A06966002CC4F3 /* PreferenceListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76B8189D182C39460088060E /* PreferenceListViewController.xib */; }; - E148750E18A06966002CC4F3 /* RegisterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76EB052918170B33006006FC /* RegisterViewController.xib */; }; E148751218A06AFD002CC4F3 /* HelveticaNeueLTStd-Bd.otf in Resources */ = {isa = PBXBuildFile; fileRef = B96A30FE187DA1B600648F3E /* HelveticaNeueLTStd-Bd.otf */; }; E148751318A06AFD002CC4F3 /* HelveticaNeueLTStd-Th.otf in Resources */ = {isa = PBXBuildFile; fileRef = 765052B1182BF839008313E1 /* HelveticaNeueLTStd-Th.otf */; }; E148751418A06AFD002CC4F3 /* HelveticaNeueLTStd-Lt.otf in Resources */ = {isa = PBXBuildFile; fileRef = 765052A518294C9F008313E1 /* HelveticaNeueLTStd-Lt.otf */; }; @@ -699,7 +687,6 @@ 765052B1182BF839008313E1 /* HelveticaNeueLTStd-Th.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "HelveticaNeueLTStd-Th.otf"; sourceTree = ""; }; 768A1A2A17FC9CD300E00ED8 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 76919BF61805D190008C664A /* ContactManagerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ContactManagerTest.m; path = contact/ContactManagerTest.m; sourceTree = ""; }; - 76B8189D182C39460088060E /* PreferenceListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = PreferenceListViewController.xib; path = ../PreferenceListViewController.xib; sourceTree = ""; }; 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; 76D713E5182D3E3F00C9C9C8 /* PreferenceListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferenceListTableViewCell.h; sourceTree = ""; }; 76D713E6182D3E3F00C9C9C8 /* PreferenceListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferenceListTableViewCell.m; sourceTree = ""; }; @@ -910,22 +897,15 @@ 76EB04FB18170B33006006FC /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = ""; }; 76EB04FC18170B33006006FC /* Zid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Zid.h; sourceTree = ""; }; 76EB04FD18170B33006006FC /* Zid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Zid.m; sourceTree = ""; }; - 76EB050318170B33006006FC /* ContactDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailViewController.h; sourceTree = ""; }; - 76EB050418170B33006006FC /* ContactDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailViewController.m; sourceTree = ""; }; 76EB050518170B33006006FC /* DialerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DialerViewController.h; sourceTree = ""; }; 76EB050618170B33006006FC /* DialerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DialerViewController.m; sourceTree = ""; }; 76EB050B18170B33006006FC /* InCallViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InCallViewController.h; sourceTree = ""; }; 76EB050C18170B33006006FC /* InCallViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InCallViewController.m; sourceTree = ""; }; 76EB050F18170B33006006FC /* NextResponderScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NextResponderScrollView.h; sourceTree = ""; }; 76EB051018170B33006006FC /* NextResponderScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NextResponderScrollView.m; sourceTree = ""; }; - 76EB051518170B33006006FC /* RegisterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterViewController.h; sourceTree = ""; }; - 76EB051618170B33006006FC /* RegisterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegisterViewController.m; sourceTree = ""; }; 76EB051D18170B33006006FC /* CallAudioManagerDemo.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CallAudioManagerDemo.xib; sourceTree = ""; }; - 76EB051F18170B33006006FC /* ContactDetailTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactDetailTableViewCell.xib; sourceTree = ""; }; - 76EB052018170B33006006FC /* ContactDetailViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactDetailViewController.xib; sourceTree = ""; }; 76EB052118170B33006006FC /* DialerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DialerViewController.xib; sourceTree = ""; }; 76EB052518170B33006006FC /* InCallViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InCallViewController.xib; sourceTree = ""; }; - 76EB052918170B33006006FC /* RegisterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RegisterViewController.xib; sourceTree = ""; }; 76EB052C18170B33006006FC /* ContactDetailTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailTableViewCell.h; sourceTree = ""; }; 76EB052D18170B33006006FC /* ContactDetailTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailTableViewCell.m; sourceTree = ""; }; 76EB052E18170B33006006FC /* ContactTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactTableViewCell.h; sourceTree = ""; }; @@ -2072,8 +2052,6 @@ 76EB04FE18170B33006006FC /* view controllers */ = { isa = PBXGroup; children = ( - 76EB050318170B33006006FC /* ContactDetailViewController.h */, - 76EB050418170B33006006FC /* ContactDetailViewController.m */, B97CBFA518860EA3008E0DE9 /* CountryCodeViewController.h */, B97CBFA618860EA3008E0DE9 /* CountryCodeViewController.m */, 76EB050518170B33006006FC /* DialerViewController.h */, @@ -2082,8 +2060,6 @@ 76EB050C18170B33006006FC /* InCallViewController.m */, 76EB050F18170B33006006FC /* NextResponderScrollView.h */, 76EB051018170B33006006FC /* NextResponderScrollView.m */, - 76EB051518170B33006006FC /* RegisterViewController.h */, - 76EB051618170B33006006FC /* RegisterViewController.m */, 76EB051C18170B33006006FC /* xibs */, ); path = "view controllers"; @@ -2093,13 +2069,9 @@ isa = PBXGroup; children = ( 76EB051D18170B33006006FC /* CallAudioManagerDemo.xib */, - 76EB051F18170B33006006FC /* ContactDetailTableViewCell.xib */, - 76EB052018170B33006006FC /* ContactDetailViewController.xib */, B97CBFA718860EA3008E0DE9 /* CountryCodeViewController.xib */, 76EB052118170B33006006FC /* DialerViewController.xib */, 76EB052518170B33006006FC /* InCallViewController.xib */, - 76B8189D182C39460088060E /* PreferenceListViewController.xib */, - 76EB052918170B33006006FC /* RegisterViewController.xib */, ); path = xibs; sourceTree = ""; @@ -3543,9 +3515,7 @@ B633C5E91A1D190B0059AC12 /* spinner_connecting_flash.png in Resources */, B633C5E61A1D190B0059AC12 /* speaker_on@2x.png in Resources */, B633C5BB1A1D190B0059AC12 /* message_bubble.png in Resources */, - E148750318A06966002CC4F3 /* ContactDetailTableViewCell.xib in Resources */, B633C5B51A1D190B0059AC12 /* lock@2x.png in Resources */, - E148750418A06966002CC4F3 /* ContactDetailViewController.xib in Resources */, B633C58E1A1D190B0059AC12 /* contacts.png in Resources */, B633C5A41A1D190B0059AC12 /* favourite_true_icon@2x.png in Resources */, E148750518A06966002CC4F3 /* CountryCodeViewController.xib in Resources */, @@ -3555,11 +3525,9 @@ B633C5CE1A1D190B0059AC12 /* quit@2x.png in Resources */, E148750A18A06966002CC4F3 /* InCallViewController.xib in Resources */, B633C5E71A1D190B0059AC12 /* spinner_connecting.png in Resources */, - E148750D18A06966002CC4F3 /* PreferenceListViewController.xib in Resources */, B633C5D01A1D190B0059AC12 /* red-delete@2x.png in Resources */, B633C59D1A1D190B0059AC12 /* endcall@2x.png in Resources */, B633C5C91A1D190B0059AC12 /* outgoing_call_icon.png in Resources */, - E148750E18A06966002CC4F3 /* RegisterViewController.xib in Resources */, B633C5EA1A1D190B0059AC12 /* spinner_connecting_flash@2x.png in Resources */, B633C5E31A1D190B0059AC12 /* speaker_icon_selected.png in Resources */, B633C5B01A1D190B0059AC12 /* incoming_call_icon.png in Resources */, @@ -3719,18 +3687,14 @@ B9EB5ACA1884D387007CBB57 /* UnseenWhisperUserCell.xib in Resources */, 76EB067118170B34006006FC /* DialerViewController.xib in Resources */, 76EB067918170B34006006FC /* InCallViewController.xib in Resources */, - 76EB068118170B34006006FC /* RegisterViewController.xib in Resources */, B6850E5A1995A4710068E715 /* whisperFake.cer in Resources */, B97CBFB218861023008E0DE9 /* CountryCodeTableViewCell.xib in Resources */, B9A578B5183D610300C17105 /* FavouriteTableViewCell.xib in Resources */, B9B89C58185A2B7000A24465 /* LeftSideMenuCell.xib in Resources */, 76D713EB182D3E5100C9C9C8 /* PreferenceListTableViewCell.xib in Resources */, - 76EB066F18170B34006006FC /* ContactDetailViewController.xib in Resources */, 76EB069318170B34006006FC /* ContactTableViewCell.xib in Resources */, 76EB066918170B34006006FC /* CallAudioManagerDemo.xib in Resources */, 765052B3182BF839008313E1 /* HelveticaNeueLTStd-Th.otf in Resources */, - 76B818A1182C39460088060E /* PreferenceListViewController.xib in Resources */, - 76EB066D18170B34006006FC /* ContactDetailTableViewCell.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3817,7 +3781,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 76EB064E18170B34006006FC /* ContactDetailViewController.m in Sources */, 76EB063E18170B33006006FC /* Operation.m in Sources */, 76EB05F618170B33006006FC /* CallConnectUtil.m in Sources */, 76EB061218170B33006006FC /* LoggingUtil.m in Sources */, @@ -4025,7 +3988,6 @@ 76EB058818170B33006006FC /* PropertyListPreferences.m in Sources */, B6B096821A1D25ED008BFAA6 /* TSSubmitMessageRequest.m in Sources */, 76EB05B218170B33006006FC /* DH3KKeyAgreementProtocol.m in Sources */, - 76EB066018170B34006006FC /* RegisterViewController.m in Sources */, 76EB060618170B33006006FC /* PhoneNumberDirectoryFilterManager.m in Sources */, B63761EC19E1FBE8005735D1 /* HttpRequest.m in Sources */, B6B096941A1D25ED008BFAA6 /* NSString+escape.m in Sources */, @@ -4060,7 +4022,6 @@ 76EB064918170B33006006FC /* Zid.m in Sources */, 76EB05AF18170B33006006FC /* SrtpStream.m in Sources */, 76EB061318170B33006006FC /* LoggingUtil.m in Sources */, - 76EB064F18170B34006006FC /* ContactDetailViewController.m in Sources */, 76EB05A718170B33006006FC /* RtpPacket.m in Sources */, 76EB05BF18170B33006006FC /* ConfirmPacket.m in Sources */, 76EB05E518170B33006006FC /* UdpSocket.m in Sources */, @@ -4180,7 +4141,6 @@ 76EB060918170B33006006FC /* ResponderSessionDescriptor.m in Sources */, 76EB062518170B33006006FC /* PriorityQueue.m in Sources */, A157077917F0CD6D007C2BD6 /* CryptoToolsTest.m in Sources */, - 76EB066118170B34006006FC /* RegisterViewController.m in Sources */, BFB074C119A4BCA400F2947C /* FutureUtilTest.m in Sources */, B684A46D19C3446200B11029 /* PushManagerTest.m in Sources */, 76EB05A918170B33006006FC /* RtpSocket.m in Sources */, diff --git a/Signal/src/Storyboard/Storyboard.storyboard b/Signal/src/Storyboard/Storyboard.storyboard index 06ef4c239..bec089a38 100644 --- a/Signal/src/Storyboard/Storyboard.storyboard +++ b/Signal/src/Storyboard/Storyboard.storyboard @@ -533,7 +533,7 @@ Lorem ipsum : Quick explanation of Fingerprints - + diff --git a/Signal/src/view controllers/ContactDetailViewController.h b/Signal/src/view controllers/ContactDetailViewController.h deleted file mode 100644 index 09d574ef3..000000000 --- a/Signal/src/view controllers/ContactDetailViewController.h +++ /dev/null @@ -1,28 +0,0 @@ -#import - -#import "Contact.h" -#import "ContactDetailTableViewCell.h" -#import "PhoneNumberDirectoryFilterManager.h" - -/** - * - * ContactDetailViewController displays information about a contact in a table view such as additional non-encryped communication methods. - * Any additional non-encrypted information is opened in an external application (Email, SMS, Phone) - * - */ - -@interface ContactDetailViewController : UIViewController - -@property (nonatomic, strong) IBOutlet UIButton *favouriteButton; -@property (nonatomic, strong) IBOutlet UIView *secureInfoHeaderView; -@property (nonatomic, strong) IBOutlet UILabel *contactNameLabel; -@property (nonatomic, strong) IBOutlet UIImageView *contactImageView; -@property (nonatomic, strong) IBOutlet UITableView *contactInfoTableView; - -@property (nonatomic, readonly) Contact *contact; - -+ (ContactDetailViewController *)contactDetailViewControllerWithContact:(Contact *)contact; - -- (IBAction)favouriteButtonTapped; - -@end diff --git a/Signal/src/view controllers/ContactDetailViewController.m b/Signal/src/view controllers/ContactDetailViewController.m deleted file mode 100644 index aaf5a1f9c..000000000 --- a/Signal/src/view controllers/ContactDetailViewController.m +++ /dev/null @@ -1,163 +0,0 @@ -#import "ContactDetailViewController.h" -#import "ContactsManager.h" -#import "InCallViewController.h" -#import "UIUtil.h" - -#define CONTACT_DETAIL_CELL_HEIGHT 49 - -static NSString *const DEFAULT_CONTACT_IMAGE = @"DefaultContactImage.png"; -static NSString *const DETAIL_TABLE_CELL_IDENTIFIER = @"ContactDetailTableViewCell"; -static NSString *const MAIL_URL_PREFIX = @"mailto://"; - -static NSString *const FAVOURITE_TRUE_ICON_NAME = @"favourite_true_icon"; -static NSString *const FAVOURITE_FALSE_ICON_NAME = @"favourite_false_icon"; - -@implementation ContactDetailViewController - -+ (ContactDetailViewController *)contactDetailViewControllerWithContact:(Contact *)contact { - ContactDetailViewController *contactDetailViewController = [ContactDetailViewController new]; - contactDetailViewController->_contact = contact; - return contactDetailViewController; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - _contactInfoTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; -} - -- (void)viewWillAppear:(BOOL)animated { - - if (_contact) { - self.navigationController.navigationBar.barTintColor = [UIUtil darkBackgroundColor]; - self.navigationController.navigationBar.tintColor = UIColor.whiteColor; - self.navigationController.navigationBar.translucent = NO; - _contactNameLabel.text = _contact.fullName; - if (_contact.image) { - _contactImageView.image = _contact.image; - } - [UIUtil applyRoundedBorderToImageView:&_contactImageView]; - [self configureFavouritesButton]; - [_contactInfoTableView reloadData]; - } - [super viewWillAppear:animated]; -} - -#pragma mark - UITableViewDelegate - -- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - return _secureInfoHeaderView; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - return _secureInfoHeaderView.bounds.size.height; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - NSInteger secureNumberCount = (NSInteger)_contact.userTextPhoneNumbers.count + (NSInteger)_contact.emails.count; - return _contact.notes != nil ? secureNumberCount + 1 : secureNumberCount; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - ContactDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:DETAIL_TABLE_CELL_IDENTIFIER]; - - if (!cell) { - cell = [[ContactDetailTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:DETAIL_TABLE_CELL_IDENTIFIER]; - } - - if ((NSUInteger)indexPath.row < _contact.userTextPhoneNumbers.count) { - - PhoneNumber *phoneNumber = [PhoneNumber tryParsePhoneNumberFromUserSpecifiedText:_contact.userTextPhoneNumbers[(NSUInteger)indexPath.row]]; - BOOL isSecure = [Environment.getCurrent.phoneDirectoryManager.getCurrentFilter containsPhoneNumber:phoneNumber]; - [cell configureWithPhoneNumber:phoneNumber isSecure:isSecure]; - - } else if ((NSUInteger)indexPath.row < _contact.userTextPhoneNumbers.count + _contact.emails.count) { - - NSUInteger emailIndex = (NSUInteger)indexPath.row - _contact.userTextPhoneNumbers.count; - [cell configureWithEmailString:_contact.emails[emailIndex]]; - - } else { - [cell configureWithNotes:_contact.notes]; - return cell; - } - - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - if (indexPath.row < (NSInteger)[[_contact userTextPhoneNumbers] count]) { - - NSString *numberString = _contact.userTextPhoneNumbers[(NSUInteger)indexPath.row]; - PhoneNumber *number = [PhoneNumber tryParsePhoneNumberFromUserSpecifiedText:numberString]; - BOOL sercureNumberTapped = [self phoneNumberIsSecure:number]; - - if (sercureNumberTapped) { - [self startSecureCallWithNumber:number]; - } else { - [self openPhoneAppWithPhoneNumber:number]; - } - - } else if ((NSUInteger)indexPath.row < _contact.userTextPhoneNumbers.count + _contact.emails.count) { - NSUInteger emailIndex = (NSUInteger)indexPath.row - _contact.userTextPhoneNumbers.count; - [self openEmailAppWithEmail:_contact.emails[emailIndex]]; - } -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - - BOOL cellNeedsHeightForText = indexPath.row == (NSInteger)[[_contact userTextPhoneNumbers] count] + (NSInteger)[[_contact emails] count]; - - if (cellNeedsHeightForText) { - CGSize size = [_contact.notes sizeWithAttributes:@{NSFontAttributeName:[UIUtil helveticaRegularWithSize:17]}]; - return size.height + CONTACT_DETAIL_CELL_HEIGHT; - } else { - return CONTACT_DETAIL_CELL_HEIGHT; - } -} - -- (void)favouriteButtonTapped { - [Environment.getCurrent.contactsManager toggleFavourite:_contact]; - [self configureFavouritesButton]; -} - -- (void)configureFavouritesButton { - if (_contact.isFavourite) { - UIImage *favouriteImage = [UIImage imageNamed:FAVOURITE_TRUE_ICON_NAME]; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:favouriteImage - style:UIBarButtonItemStylePlain - target:self - action:@selector(favouriteButtonTapped)]; - self.navigationItem.rightBarButtonItem.tintColor = [UIColor yellowColor]; - } else { - UIImage *favouriteImage = [UIImage imageNamed:FAVOURITE_FALSE_ICON_NAME]; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:favouriteImage - style:UIBarButtonItemStylePlain - target:self - action:@selector(favouriteButtonTapped)]; - self.navigationItem.rightBarButtonItem.tintColor = UIColor.whiteColor; - } -} - -- (void)openPhoneAppWithPhoneNumber:(PhoneNumber *)phoneNumber { - if (phoneNumber) { - [UIApplication.sharedApplication openURL:phoneNumber.toSystemDialerURL]; - } -} - -- (void)openEmailAppWithEmail:(NSString *)email { - NSString *mailURL = [NSString stringWithFormat:@"%@%@",MAIL_URL_PREFIX, email]; - [UIApplication.sharedApplication openURL:[NSURL URLWithString:mailURL]]; -} - -- (void)startSecureCallWithNumber:(PhoneNumber *)number { - [Environment.phoneManager initiateOutgoingCallToContact:_contact atRemoteNumber:number]; -} - -- (BOOL)phoneNumberIsSecure:(PhoneNumber *)phoneNumber { - PhoneNumberDirectoryFilter* directory = Environment.getCurrent.phoneDirectoryManager.getCurrentFilter; - return phoneNumber != nil && [directory containsPhoneNumber:phoneNumber]; -} - -@end diff --git a/Signal/src/view controllers/PreferenceListViewController.xib b/Signal/src/view controllers/PreferenceListViewController.xib deleted file mode 100644 index af9c7463b..000000000 --- a/Signal/src/view controllers/PreferenceListViewController.xib +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/RegisterViewController.h b/Signal/src/view controllers/RegisterViewController.h deleted file mode 100644 index 873d6819e..000000000 --- a/Signal/src/view controllers/RegisterViewController.h +++ /dev/null @@ -1,39 +0,0 @@ -#import - -#import "CollapsingFutures.h" -#import "CountryCodeViewController.h" - -@interface RegisterViewController : UIViewController { -@private TOCFutureSource* registered; -@private TOCFutureSource* futureChallengeAcceptedSource; -@private TOCCancelTokenSource* life; -} - -@property (nonatomic, strong) IBOutlet UIButton *registerButton; -@property (nonatomic, strong) IBOutlet UIButton *challengeButton; -@property (nonatomic, strong) IBOutlet UITextField *phoneNumberTextField; -@property (nonatomic, strong) IBOutlet UILabel *countryCodeLabel; -@property (nonatomic, strong) IBOutlet UILabel *countryNameLabel; -@property (nonatomic, strong) IBOutlet UITextField *challengeTextField; -@property (nonatomic, strong) IBOutlet UIActivityIndicatorView *registerActivityIndicator; -@property (nonatomic, strong) IBOutlet UIActivityIndicatorView *challengeActivityIndicator; -@property (nonatomic, strong) IBOutlet UIScrollView *scrollView; -@property (nonatomic, strong) IBOutlet UIView *containerView; -@property (nonatomic, strong) IBOutlet UIButton *registerCancelButton; -@property (nonatomic, strong) IBOutlet UIButton *continueToWhisperButton; - -@property (nonatomic, strong) IBOutlet UILabel *challengeNumberLabel; -@property (nonatomic, strong) IBOutlet UILabel *voiceChallengeTextLabel; -@property (nonatomic, strong) IBOutlet UIButton *initiateVoiceVerificationButton; - -- (IBAction)registerPhoneNumberTapped; -- (IBAction)registerCancelButtonTapped; -- (IBAction)verifyChallengeTapped; -- (IBAction)dismissTapped; -- (IBAction)changeNumberTapped; -- (IBAction)changeCountryCodeTapped; -- (IBAction)initiateVoiceVerificationButtonHandler; - -+ (RegisterViewController*)registerViewController; - -@end diff --git a/Signal/src/view controllers/RegisterViewController.m b/Signal/src/view controllers/RegisterViewController.m deleted file mode 100644 index eb390a726..000000000 --- a/Signal/src/view controllers/RegisterViewController.m +++ /dev/null @@ -1,377 +0,0 @@ -#import "RPServerRequestsManager.h" -#import "Environment.h" -#import "HttpManager.h" -#import "LocalizableText.h" -#import "NBAsYouTypeFormatter.h" -#import "PhoneNumber.h" -#import "PhoneNumberDirectoryFilterManager.h" -#import "PhoneNumberUtil.h" -#import "PreferencesUtil.h" -#import "PushManager.h" -#import "RegisterViewController.h" -#import "RPServerRequestsManager.h" -#import "SignalUtil.h" -#import "SGNKeychainUtil.h" -#import "ThreadManager.h" -#import "Util.h" - -#import - -#define REGISTER_VIEW_NUMBER 0 -#define CHALLENGE_VIEW_NUMBER 1 - -#define COUNTRY_CODE_CHARACTER_MAX 3 - -#define SERVER_TIMEOUT_SECONDS 20 -#define SMS_VERIFICATION_TIMEOUT_SECONDS 4*60 -#define VOICE_VERIFICATION_COOLDOWN_SECONDS 4 - -#define IPHONE_BLUE [UIColor colorWithRed:22 green:173 blue:214 alpha:1] - -@interface RegisterViewController () { - NSTimer* countdownTimer; - NSDate *timeoutDate; -} - -@end - -@implementation RegisterViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [self localizeButtonText]; - - DDLogInfo(@"Opened Registration View"); - - [self populateDefaultCountryNameAndCode]; - - _scrollView.contentSize = _containerView.bounds.size; - - BOOL isRegisteredAlready = Environment.isRegistered; - _registerCancelButton.hidden = !isRegisteredAlready; - - [self initializeKeyboardHandlers]; - [self setPlaceholderTextColor:[UIColor lightGrayColor]]; -} - -+ (RegisterViewController*)registerViewController { - RegisterViewController *viewController = [RegisterViewController new]; - viewController->life = [TOCCancelTokenSource new]; - viewController->registered = [TOCFutureSource futureSourceUntil:viewController->life.token]; - - return viewController; -} - -- (UIStatusBarStyle)preferredStatusBarStyle { - return UIStatusBarStyleDefault; -} - -- (void)setPlaceholderTextColor:(UIColor *)color { - NSAttributedString *placeholder = _phoneNumberTextField.attributedPlaceholder; - if (placeholder.length) { - NSDictionary * attributes = [placeholder attributesAtIndex:0 - effectiveRange:NULL]; - - NSMutableDictionary *newAttributes = [[NSMutableDictionary alloc] initWithDictionary:attributes]; - newAttributes[NSForegroundColorAttributeName] = color; - - NSString *placeholderString = [placeholder string]; - _phoneNumberTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholderString - attributes:newAttributes]; - } -} - -- (void)localizeButtonText { - [_registerCancelButton setTitle:TXT_CANCEL_TITLE forState:UIControlStateNormal]; - [_continueToWhisperButton setTitle:CONTINUE_TO_WHISPER_TITLE forState:UIControlStateNormal]; - [_registerButton setTitle:REGISTER_BUTTON_TITLE forState:UIControlStateNormal]; - [_challengeButton setTitle:CHALLENGE_CODE_BUTTON_TITLE forState:UIControlStateNormal]; -} - -- (IBAction)registerCancelButtonTapped { - [self dismissView]; -} - -- (void) dismissView { - [self stopVoiceVerificationCountdownTimer]; - [self dismissViewControllerAnimated:YES completion:nil]; -} - -- (void)populateDefaultCountryNameAndCode { - NSLocale *locale = NSLocale.currentLocale; - NSString *countryCode = [locale objectForKey:NSLocaleCountryCode]; - NSNumber *cc = [NBPhoneNumberUtil.sharedInstance getCountryCodeForRegion:countryCode]; - - _countryCodeLabel.text = [NSString stringWithFormat:@"%@%@",COUNTRY_CODE_PREFIX, cc]; - _countryNameLabel.text = [PhoneNumberUtil countryNameFromCountryCode:countryCode]; -} - -- (IBAction)changeNumberTapped { - [self showViewNumber:REGISTER_VIEW_NUMBER]; -} - -- (IBAction)changeCountryCodeTapped { - CountryCodeViewController *countryCodeController = [CountryCodeViewController new]; - countryCodeController.delegate = self; - [self presentViewController:countryCodeController animated:YES completion:nil]; -} - -- (void)registerPhoneNumberTapped { - NSString *phoneNumber = [NSString stringWithFormat:@"%@%@", _countryCodeLabel.text, _phoneNumberTextField.text]; - PhoneNumber* localNumber = [PhoneNumber tryParsePhoneNumberFromUserSpecifiedText:phoneNumber]; - if(localNumber==nil){ return; } - - [_phoneNumberTextField resignFirstResponder]; - - [_registerActivityIndicator startAnimating]; - _registerButton.enabled = NO; - - [SGNKeychainUtil setLocalNumberTo:localNumber]; - - [[RPServerRequestsManager sharedInstance]performRequest:[RPAPICall requestVerificationCode] success:^(NSURLSessionDataTask *task, id responseObject) { - [self showViewNumber:CHALLENGE_VIEW_NUMBER]; - [self.challengeNumberLabel setText:[phoneNumber description]]; - [_registerCancelButton removeFromSuperview]; - [self startVoiceVerificationCountdownTimer]; - } failure:^(NSURLSessionDataTask *task, NSError *error) { - [_registerActivityIndicator stopAnimating]; - _registerButton.enabled = YES; - - DDLogError(@"Registration failed with information %@", error.description); - - UIAlertView *registrationErrorAV = [[UIAlertView alloc]initWithTitle:REGISTER_ERROR_ALERT_VIEW_TITLE message:REGISTER_ERROR_ALERT_VIEW_BODY delegate:nil cancelButtonTitle:REGISTER_ERROR_ALERT_VIEW_DISMISS otherButtonTitles:nil, nil]; - - [registrationErrorAV show]; - }]; -} - -- (void)dismissTapped { - [self dismissView]; -} - -- (void)verifyChallengeTapped { - [_challengeTextField resignFirstResponder]; - _challengeButton.enabled = NO; - [_challengeActivityIndicator startAnimating]; - - [[RPServerRequestsManager sharedInstance] performRequest:[RPAPICall verifyVerificationCode:_challengeTextField.text] success:^(NSURLSessionDataTask *task, id responseObject) { - - [PushManager.sharedManager registrationWithSuccess:^{ - [futureChallengeAcceptedSource trySetResult:@YES]; - [Environment setRegistered:YES]; - [registered trySetResult:@YES]; - [Environment.getCurrent.phoneDirectoryManager forceUpdate]; - [self dismissView]; - } failure:^{ - _challengeButton.enabled = YES; - [_challengeActivityIndicator stopAnimating]; - }]; - - } failure:^(NSURLSessionDataTask *task, NSError *error) { - NSString *alertTitle = NSLocalizedString(@"REGISTRATION_ERROR", @""); - - NSHTTPURLResponse* badResponse = (NSHTTPURLResponse*)task.response; - if (badResponse.statusCode == 401) { - SignalAlertView(alertTitle, REGISTER_CHALLENGE_ALERT_VIEW_BODY); - } else if (badResponse.statusCode == 413){ - SignalAlertView(alertTitle, NSLocalizedString(@"REGISTER_RATE_LIMITING_BODY", @"")); - } else { - NSString *alertBodyString = [NSString stringWithFormat:@"%@ %lu", NSLocalizedString(@"SERVER_CODE", @""),(unsigned long)badResponse.statusCode]; - SignalAlertView (alertTitle, alertBodyString); - } - - _challengeButton.enabled = YES; - [_challengeActivityIndicator stopAnimating]; - }]; -} - -- (void)showViewNumber:(NSInteger)viewNumber { - - if (viewNumber == REGISTER_VIEW_NUMBER) { - [_registerActivityIndicator stopAnimating]; - _registerButton.enabled = YES; - } - - [self stopVoiceVerificationCountdownTimer]; - - [_scrollView setContentOffset:CGPointMake(_scrollView.frame.size.width*viewNumber, 0) animated:YES]; -} - -- (void)presentInvalidCountryCodeError { - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:REGISTER_CC_ERR_ALERT_VIEW_TITLE - message:REGISTER_CC_ERR_ALERT_VIEW_MESSAGE - delegate:nil - cancelButtonTitle:REGISTER_CC_ERR_ALERT_VIEW_DISMISS - otherButtonTitles:nil]; - [alertView show]; -} - -- (void) startVoiceVerificationCountdownTimer{ - [self.initiateVoiceVerificationButton.titleLabel setTextAlignment:NSTextAlignmentCenter]; - self.initiateVoiceVerificationButton.hidden = NO; - - NSTimeInterval smsTimeoutTimeInterval = SMS_VERIFICATION_TIMEOUT_SECONDS; - - NSDate *now = [NSDate new]; - timeoutDate = [[NSDate alloc] initWithTimeInterval:smsTimeoutTimeInterval sinceDate:now]; - - countdownTimer = [NSTimer scheduledTimerWithTimeInterval:1 - target:self - selector:@selector(countdowntimerFired) - userInfo:nil repeats:YES]; -} - -- (void) stopVoiceVerificationCountdownTimer{ - [countdownTimer invalidate]; -} - -- (void) countdowntimerFired { - NSDate *now = [NSDate new]; - - NSCalendar *sysCalendar = NSCalendar.currentCalendar; - unsigned int unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit; - NSDateComponents *conversionInfo = [sysCalendar components:unitFlags fromDate:now toDate:timeoutDate options:0]; - NSString* timeLeft = [NSString stringWithFormat:@"%ld:%02ld",(long)[conversionInfo minute],(long)[conversionInfo second]]; - - [self.voiceChallengeTextLabel setText:timeLeft]; - - if (0 <= [now compare:timeoutDate]) { - [self initiateVoiceVerification]; - } - -} - -- (void) initiateVoiceVerification{ - [self stopVoiceVerificationCountdownTimer]; - [self.voiceChallengeTextLabel setText:NSLocalizedString(@"REGISTER_CALL_CALLING", @"")]; - - [[RPServerRequestsManager sharedInstance] performRequest:[RPAPICall requestVerificationCodeWithVoice] success:^(NSURLSessionDataTask *task, id responseObject) { - - dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, VOICE_VERIFICATION_COOLDOWN_SECONDS * NSEC_PER_SEC); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ - [self.voiceChallengeTextLabel setText:NSLocalizedString(@"REGISTER_CALL_RECALL", @"")]; - }); - - } failure:^(NSURLSessionDataTask *task, NSError *error) { - [self.voiceChallengeTextLabel setText:error.description]; - }]; -} - -- (IBAction)initiateVoiceVerificationButtonHandler { - [self initiateVoiceVerification]; -} - -#pragma mark - Keyboard notifications - -- (void)initializeKeyboardHandlers{ - UITapGestureRecognizer *outsideTabRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboardFromAppropriateSubView)]; - [self.view addGestureRecognizer:outsideTabRecognizer]; - - [self observeKeyboardNotifications]; - -} - --(void) dismissKeyboardFromAppropriateSubView { - [self.view endEditing:NO]; -} - -- (void)observeKeyboardNotifications { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; -} - -- (void)keyboardWillShow:(NSNotification *)notification { - double duration = [[notification userInfo][UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - [UIView animateWithDuration:duration animations:^{ - CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;; - _scrollView.frame = CGRectMake(CGRectGetMinX(_scrollView.frame), - CGRectGetMinY(_scrollView.frame)-keyboardSize.height, - CGRectGetWidth(_scrollView.frame), - CGRectGetHeight(_scrollView.frame)); - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification { - double duration = [[notification userInfo][UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - [UIView animateWithDuration:duration animations:^{ - _scrollView.frame = CGRectMake(CGRectGetMinX(_scrollView.frame), - CGRectGetMinY(self.view.frame), - CGRectGetWidth(_scrollView.frame), - CGRectGetHeight(_scrollView.frame)); - }]; -} - -#pragma mark - CountryCodeViewControllerDelegate - -- (void)countryCodeViewController:(CountryCodeViewController *)vc - didSelectCountryCode:(NSString *)code - forCountry:(NSString *)country { - _countryCodeLabel.text = code; - _countryNameLabel.text = country; - - // Reformat phone number - NSString* digits = _phoneNumberTextField.text.digitsOnly; - NSString* reformattedNumber = [PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber:digits - withSpecifiedCountryCodeString:_countryCodeLabel.text]; - _phoneNumberTextField.text = reformattedNumber; - UITextPosition *pos = _phoneNumberTextField.endOfDocument; - [_phoneNumberTextField setSelectedTextRange:[_phoneNumberTextField textRangeFromPosition:pos toPosition:pos]]; - - // Done choosing country - [vc dismissViewControllerAnimated:YES completion:nil]; -} - -- (void)countryCodeViewControllerDidCancel:(CountryCodeViewController *)vc { - [vc dismissViewControllerAnimated:YES completion:nil]; -} - -#pragma mark - UITextFieldDelegate - --(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { - NSString* textBeforeChange = textField.text; - - // backspacing should skip over formatting characters - UITextPosition *posIfBackspace = [textField positionFromPosition:textField.beginningOfDocument - offset:(NSInteger)(range.location + range.length)]; - UITextRange *rangeIfBackspace = [textField textRangeFromPosition:posIfBackspace toPosition:posIfBackspace]; - bool isBackspace = string.length == 0 && range.length == 1 && [rangeIfBackspace isEqual:textField.selectedTextRange]; - if (isBackspace) { - NSString* digits = textBeforeChange.digitsOnly; - NSUInteger correspondingDeletePosition = [PhoneNumberUtil translateCursorPosition:range.location + range.length - from:textBeforeChange - to:digits - stickingRightward:true]; - if (correspondingDeletePosition > 0) { - textBeforeChange = digits; - range = NSMakeRange(correspondingDeletePosition - 1, 1); - } - } - - // make the proposed change - NSString* textAfterChange = [textBeforeChange withCharactersInRange:range replacedBy:string]; - NSUInteger cursorPositionAfterChange = range.location + string.length; - - // reformat the phone number, trying to keep the cursor beside the inserted or deleted digit - bool isJustDeletion = string.length == 0; - NSString* textAfterReformat = [PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber:textAfterChange.digitsOnly - withSpecifiedCountryCodeString:_countryCodeLabel.text]; - NSUInteger cursorPositionAfterReformat = [PhoneNumberUtil translateCursorPosition:cursorPositionAfterChange - from:textAfterChange - to:textAfterReformat - stickingRightward:isJustDeletion]; - textField.text = textAfterReformat; - UITextPosition *pos = [textField positionFromPosition:textField.beginningOfDocument - offset:(NSInteger)cursorPositionAfterReformat]; - [textField setSelectedTextRange:[textField textRangeFromPosition:pos toPosition:pos]]; - - return NO; // inform our caller that we took care of performing the change -} - -@end diff --git a/Signal/src/view controllers/xibs/ContactDetailTableViewCell.xib b/Signal/src/view controllers/xibs/ContactDetailTableViewCell.xib deleted file mode 100644 index 262261880..000000000 --- a/Signal/src/view controllers/xibs/ContactDetailTableViewCell.xib +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/xibs/ContactDetailViewController.xib b/Signal/src/view controllers/xibs/ContactDetailViewController.xib deleted file mode 100644 index d58b4ca72..000000000 --- a/Signal/src/view controllers/xibs/ContactDetailViewController.xib +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Signal/src/view controllers/xibs/RegisterViewController.xib b/Signal/src/view controllers/xibs/RegisterViewController.xib deleted file mode 100644 index 1e823bd5b..000000000 --- a/Signal/src/view controllers/xibs/RegisterViewController.xib +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -