Merge branch 'charlesmchen/leakedViewControllers'

pull/1/head
Matthew Chen 8 years ago
commit c41037a4f9

@ -82,6 +82,7 @@
34D8C0281ED3673300188D7C /* DebugUITableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8C0261ED3673300188D7C /* DebugUITableViewController.m */; }; 34D8C0281ED3673300188D7C /* DebugUITableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8C0261ED3673300188D7C /* DebugUITableViewController.m */; };
34D8C02B1ED3685800188D7C /* DebugUIContacts.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8C02A1ED3685800188D7C /* DebugUIContacts.m */; }; 34D8C02B1ED3685800188D7C /* DebugUIContacts.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8C02A1ED3685800188D7C /* DebugUIContacts.m */; };
34D99C8E1F28DDCD00D284D6 /* OWSSwiftUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34D99C8D1F28DDCD00D284D6 /* OWSSwiftUtils.swift */; }; 34D99C8E1F28DDCD00D284D6 /* OWSSwiftUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34D99C8D1F28DDCD00D284D6 /* OWSSwiftUtils.swift */; };
34D99C8C1F27B13B00D284D6 /* OWSViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D99C8B1F27B13B00D284D6 /* OWSViewController.m */; };
34DFCB851E8E04B500053165 /* AddToBlockListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34DFCB841E8E04B500053165 /* AddToBlockListViewController.m */; }; 34DFCB851E8E04B500053165 /* AddToBlockListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34DFCB841E8E04B500053165 /* AddToBlockListViewController.m */; };
34E3E5681EC4B19400495BAC /* AudioProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E3E5671EC4B19400495BAC /* AudioProgressView.swift */; }; 34E3E5681EC4B19400495BAC /* AudioProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E3E5671EC4B19400495BAC /* AudioProgressView.swift */; };
34E3EF0D1EFC235B007F6822 /* DebugUIDiskUsage.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E3EF0C1EFC235B007F6822 /* DebugUIDiskUsage.m */; }; 34E3EF0D1EFC235B007F6822 /* DebugUIDiskUsage.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E3EF0C1EFC235B007F6822 /* DebugUIDiskUsage.m */; };
@ -510,6 +511,8 @@
34D8C0291ED3685800188D7C /* DebugUIContacts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugUIContacts.h; sourceTree = "<group>"; }; 34D8C0291ED3685800188D7C /* DebugUIContacts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugUIContacts.h; sourceTree = "<group>"; };
34D8C02A1ED3685800188D7C /* DebugUIContacts.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugUIContacts.m; sourceTree = "<group>"; }; 34D8C02A1ED3685800188D7C /* DebugUIContacts.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugUIContacts.m; sourceTree = "<group>"; };
34D99C8D1F28DDCD00D284D6 /* OWSSwiftUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSSwiftUtils.swift; sourceTree = "<group>"; }; 34D99C8D1F28DDCD00D284D6 /* OWSSwiftUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSSwiftUtils.swift; sourceTree = "<group>"; };
34D99C8A1F27B13B00D284D6 /* OWSViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSViewController.h; sourceTree = "<group>"; };
34D99C8B1F27B13B00D284D6 /* OWSViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSViewController.m; sourceTree = "<group>"; };
34DFCB831E8E04B400053165 /* AddToBlockListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddToBlockListViewController.h; sourceTree = "<group>"; }; 34DFCB831E8E04B400053165 /* AddToBlockListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddToBlockListViewController.h; sourceTree = "<group>"; };
34DFCB841E8E04B500053165 /* AddToBlockListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddToBlockListViewController.m; sourceTree = "<group>"; }; 34DFCB841E8E04B500053165 /* AddToBlockListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddToBlockListViewController.m; sourceTree = "<group>"; };
34E3E5671EC4B19400495BAC /* AudioProgressView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioProgressView.swift; sourceTree = "<group>"; }; 34E3E5671EC4B19400495BAC /* AudioProgressView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioProgressView.swift; sourceTree = "<group>"; };
@ -997,6 +1000,8 @@
34B3F8631E8DF1700035BE1A /* OWSQRCodeScanningViewController.m */, 34B3F8631E8DF1700035BE1A /* OWSQRCodeScanningViewController.m */,
34B3F89D1E8DF5490035BE1A /* OWSTableViewController.h */, 34B3F89D1E8DF5490035BE1A /* OWSTableViewController.h */,
34B3F89E1E8DF5490035BE1A /* OWSTableViewController.m */, 34B3F89E1E8DF5490035BE1A /* OWSTableViewController.m */,
34D99C8A1F27B13B00D284D6 /* OWSViewController.h */,
34D99C8B1F27B13B00D284D6 /* OWSViewController.m */,
34B3F8641E8DF1700035BE1A /* PrivacySettingsTableViewController.h */, 34B3F8641E8DF1700035BE1A /* PrivacySettingsTableViewController.h */,
34B3F8651E8DF1700035BE1A /* PrivacySettingsTableViewController.m */, 34B3F8651E8DF1700035BE1A /* PrivacySettingsTableViewController.m */,
34B3F8661E8DF1700035BE1A /* RegistrationViewController.h */, 34B3F8661E8DF1700035BE1A /* RegistrationViewController.h */,
@ -2234,6 +2239,7 @@
45BB93381E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */, 45BB93381E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */,
458DE9D61DEE3FD00071BB03 /* PeerConnectionClient.swift in Sources */, 458DE9D61DEE3FD00071BB03 /* PeerConnectionClient.swift in Sources */,
451DE9FD1DC1A28200810E42 /* SyncPushTokensJob.swift in Sources */, 451DE9FD1DC1A28200810E42 /* SyncPushTokensJob.swift in Sources */,
34D99C8C1F27B13B00D284D6 /* OWSViewController.m in Sources */,
45666F761D9BFE00008FE134 /* OWS100RemoveTSRecipientsMigration.m in Sources */, 45666F761D9BFE00008FE134 /* OWS100RemoveTSRecipientsMigration.m in Sources */,
340CB2271EAC25820001CAA1 /* UpdateGroupViewController.m in Sources */, 340CB2271EAC25820001CAA1 /* UpdateGroupViewController.m in Sources */,
34B3F89F1E8DF5490035BE1A /* OWSTableViewController.m in Sources */, 34B3F89F1E8DF5490035BE1A /* OWSTableViewController.m in Sources */,

@ -18,6 +18,7 @@
#import "OWSLogger.h" #import "OWSLogger.h"
#import "OWSMessageEditing.h" #import "OWSMessageEditing.h"
#import "OWSProgressView.h" #import "OWSProgressView.h"
#import "OWSViewController.h"
#import "OWSWebRTCDataProtos.pb.h" #import "OWSWebRTCDataProtos.pb.h"
#import "PrivacySettingsTableViewController.h" #import "PrivacySettingsTableViewController.h"
#import "PropertyListPreferences.h" #import "PropertyListPreferences.h"

@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN
[loggingSection [loggingSection
addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"") addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"")
actionBlock:^{ actionBlock:^{
DDLogInfo(@"%@ Submitting debug logs", self.tag); DDLogInfo(@"%@ Submitting debug logs", weakSelf.tag);
[DDLog flushLog]; [DDLog flushLog];
[Pastelog submitLogs]; [Pastelog submitLogs];
}]]; }]];

@ -5,7 +5,7 @@
import Foundation import Foundation
import MediaPlayer import MediaPlayer
class AttachmentApprovalViewController: UIViewController, OWSAudioAttachmentPlayerDelegate { class AttachmentApprovalViewController: OWSViewController, OWSAudioAttachmentPlayerDelegate {
let TAG = "[AttachmentApprovalViewController]" let TAG = "[AttachmentApprovalViewController]"

@ -2,8 +2,12 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import <UIKit/UIKit.h> #import "OWSViewController.h"
@interface BlockListViewController : UIViewController NS_ASSUME_NONNULL_BEGIN
@interface BlockListViewController : OWSViewController
@end @end
NS_ASSUME_NONNULL_END

@ -74,8 +74,6 @@ NS_ASSUME_NONNULL_BEGIN
@"A label for the 'add phone number' button in the block list table.") @"A label for the 'add phone number' button in the block list table.")
actionBlock:^{ actionBlock:^{
AddToBlockListViewController *vc = [[AddToBlockListViewController alloc] init]; AddToBlockListViewController *vc = [[AddToBlockListViewController alloc] init];
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
NSAssert(vc != nil, @"Privacy Settings View Controller must not be nil");
[weakSelf.navigationController pushViewController:vc animated:YES]; [weakSelf.navigationController pushViewController:vc animated:YES];
}]]; }]];
[contents addSection:addSection]; [contents addSection:addSection];

@ -8,7 +8,7 @@ import PromiseKit
// TODO: Add category so that button handlers can be defined where button is created. // TODO: Add category so that button handlers can be defined where button is created.
// TODO: Ensure buttons enabled & disabled as necessary. // TODO: Ensure buttons enabled & disabled as necessary.
class CallViewController: UIViewController, CallObserver, CallServiceObserver, RTCEAGLVideoViewDelegate { class CallViewController: OWSViewController, CallObserver, CallServiceObserver, RTCEAGLVideoViewDelegate {
let TAG = "[CallViewController]" let TAG = "[CallViewController]"

@ -2,10 +2,14 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import <UIKit/UIKit.h> #import "OWSViewController.h"
@interface CodeVerificationViewController : UIViewController NS_ASSUME_NONNULL_BEGIN
@interface CodeVerificationViewController : OWSViewController
- (void)setVerificationCodeAndTryToVerify:(NSString *)verificationCode; - (void)setVerificationCodeAndTryToVerify:(NSString *)verificationCode;
@end @end
NS_ASSUME_NONNULL_END

@ -34,7 +34,7 @@ public enum SubtitleCellValue {
} }
@available(iOS 9.0, *) @available(iOS 9.0, *)
open class ContactsPicker: UIViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate { open class ContactsPicker: OWSViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate {
@IBOutlet var tableView: UITableView! @IBOutlet var tableView: UITableView!
@IBOutlet var searchBar: UISearchBar! @IBOutlet var searchBar: UISearchBar!

@ -227,6 +227,9 @@ typedef enum : NSUInteger {
- (void)dealloc - (void)dealloc
{ {
// Surface memory leaks by logging the deallocation of view controllers.
DDLogVerbose(@"Dealloc: %@", self.class);
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
} }

@ -2,11 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import <UIKit/UIKit.h> #import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface DomainFrontingCountryViewController : UIViewController @interface DomainFrontingCountryViewController : OWSViewController
@end @end

@ -46,7 +46,7 @@ private class CallKitExperienceUpgradeViewController: ExperienceUpgradeViewContr
} }
} }
private class ExperienceUpgradeViewController: UIViewController { private class ExperienceUpgradeViewController: OWSViewController {
let TAG = "[ExperienceUpgradeViewController]" let TAG = "[ExperienceUpgradeViewController]"
let header: String let header: String
@ -128,7 +128,7 @@ func setPageControlAppearance() {
} }
} }
class ExperienceUpgradesPageViewController: UIViewController, UIPageViewControllerDataSource { class ExperienceUpgradesPageViewController: OWSViewController, UIPageViewControllerDataSource {
let TAG = "[ExperienceUpgradeViewController]" let TAG = "[ExperienceUpgradeViewController]"

@ -2,9 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface FingerprintViewController : UIViewController @interface FingerprintViewController : OWSViewController
+ (void)presentFromViewController:(UIViewController *)viewController recipientId:(NSString *)recipientId; + (void)presentFromViewController:(UIViewController *)viewController recipientId:(NSString *)recipientId;

@ -2,9 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface FingerprintViewScanController : UIViewController @interface FingerprintViewScanController : OWSViewController
- (void)configureWithRecipientId:(NSString *)recipientId NS_SWIFT_NAME(configure(recipientId:)); - (void)configureWithRecipientId:(NSString *)recipientId NS_SWIFT_NAME(configure(recipientId:));

@ -2,12 +2,15 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import <UIKit/UIKit.h> #import "OWSMessageData.h"
#import "OWSViewController.h"
#import "TSAttachmentStream.h" #import "TSAttachmentStream.h"
#import "TSInteraction.h" #import "TSInteraction.h"
#import "OWSMessageData.h" #import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface FullImageViewController : UIViewController @interface FullImageViewController : OWSViewController
- (instancetype)initWithAttachment:(TSAttachmentStream *)attachment - (instancetype)initWithAttachment:(TSAttachmentStream *)attachment
fromRect:(CGRect)rect fromRect:(CGRect)rect
@ -18,3 +21,5 @@
- (void)presentFromViewController:(UIViewController *)viewController; - (void)presentFromViewController:(UIViewController *)viewController;
@end @end
NS_ASSUME_NONNULL_END

@ -12,6 +12,8 @@
#import "UIColor+OWS.h" #import "UIColor+OWS.h"
#import "AttachmentSharing.h" #import "AttachmentSharing.h"
NS_ASSUME_NONNULL_BEGIN
#define kMinZoomScale 1.0f #define kMinZoomScale 1.0f
#define kMaxZoomScale 8.0f #define kMaxZoomScale 8.0f
@ -32,8 +34,7 @@
} }
// We only use custom actions in UIMenuController. // We only use custom actions in UIMenuController.
- (BOOL)canPerformAction:(SEL)action - (BOOL)canPerformAction:(SEL)action withSender:(nullable id)sender
withSender:(id)sender
{ {
return NO; return NO;
} }
@ -459,7 +460,8 @@
#pragma mark - UIScrollViewDelegate #pragma mark - UIScrollViewDelegate
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { - (nullable UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return self.imageView; return self.imageView;
} }
@ -471,7 +473,8 @@
} }
} }
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale { - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale
{
self.scrollView.scrollEnabled = (scale > 1); self.scrollView.scrollEnabled = (scale > 1);
self.scrollView.contentInset = [self contentInsetForScrollView:scale]; self.scrollView.contentInset = [self contentInsetForScrollView:scale];
} }
@ -510,3 +513,5 @@
} }
@end @end
NS_ASSUME_NONNULL_END

@ -2,9 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MessageComposeTableViewController : UIViewController @interface MessageComposeTableViewController : OWSViewController
@end @end

@ -3,10 +3,11 @@
// //
#import "OWSConversationSettingsViewDelegate.h" #import "OWSConversationSettingsViewDelegate.h"
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface NewGroupViewController : UIViewController @interface NewGroupViewController : OWSViewController
@property (nonatomic, weak) id<OWSConversationSettingsViewDelegate> delegate; @property (nonatomic, weak) id<OWSConversationSettingsViewDelegate> delegate;

@ -216,7 +216,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
[nonContactsSection [nonContactsSection
addItem:[OWSTableItem itemWithCustomCellBlock:^{ addItem:[OWSTableItem itemWithCustomCellBlock:^{
NewGroupViewController *strongSelf = weakSelf; NewGroupViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
SignalAccount *signalAccount = [contactsViewHelper signalAccountForRecipientId:recipientId]; SignalAccount *signalAccount = [contactsViewHelper signalAccountForRecipientId:recipientId];
@ -309,7 +309,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
[signalAccountSection [signalAccountSection
addItem:[OWSTableItem itemWithCustomCellBlock:^{ addItem:[OWSTableItem itemWithCustomCellBlock:^{
NewGroupViewController *strongSelf = weakSelf; NewGroupViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];

@ -271,9 +271,11 @@ NS_ASSUME_NONNULL_BEGIN
iconName:@"table_ic_add_to_existing_contact"]; iconName:@"table_ic_add_to_existing_contact"];
} }
actionBlock:^{ actionBlock:^{
TSContactThread *contactThread = (TSContactThread *)self.thread; OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
TSContactThread *contactThread = (TSContactThread *)strongSelf.thread;
NSString *recipientId = contactThread.contactIdentifier; NSString *recipientId = contactThread.contactIdentifier;
[weakSelf presentAddToContactViewControllerWithRecipientId:recipientId]; [strongSelf presentAddToContactViewControllerWithRecipientId:recipientId];
}]]; }]];
} }
@ -293,6 +295,8 @@ NS_ASSUME_NONNULL_BEGIN
[mainSection [mainSection
addItem:[OWSTableItem itemWithCustomCellBlock:^{ addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
@ -303,7 +307,7 @@ NS_ASSUME_NONNULL_BEGIN
[topView autoPinEdgeToSuperviewEdge:ALEdgeTop]; [topView autoPinEdgeToSuperviewEdge:ALEdgeTop];
[topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight]; [topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight];
UIImageView *iconView = [self viewForIconWithName:@"table_ic_hourglass"]; UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_hourglass"];
[topView addSubview:iconView]; [topView addSubview:iconView];
[iconView autoVCenterInSuperview]; [iconView autoVCenterInSuperview];
[iconView autoPinLeadingToSuperView]; [iconView autoPinLeadingToSuperView];
@ -318,8 +322,8 @@ NS_ASSUME_NONNULL_BEGIN
[rowLabel autoPinLeadingToTrailingOfView:iconView margin:weakSelf.iconSpacing]; [rowLabel autoPinLeadingToTrailingOfView:iconView margin:weakSelf.iconSpacing];
UISwitch *switchView = [UISwitch new]; UISwitch *switchView = [UISwitch new];
switchView.on = self.disappearingMessagesConfiguration.isEnabled; switchView.on = strongSelf.disappearingMessagesConfiguration.isEnabled;
[switchView addTarget:self [switchView addTarget:strongSelf
action:@selector(disappearingMessagesSwitchValueDidChange:) action:@selector(disappearingMessagesSwitchValueDidChange:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
[topView addSubview:switchView]; [topView addSubview:switchView];
@ -350,6 +354,8 @@ NS_ASSUME_NONNULL_BEGIN
addItem:[OWSTableItem addItem:[OWSTableItem
itemWithCustomCellBlock:^{ itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
@ -360,13 +366,13 @@ NS_ASSUME_NONNULL_BEGIN
[topView autoPinEdgeToSuperviewEdge:ALEdgeTop]; [topView autoPinEdgeToSuperviewEdge:ALEdgeTop];
[topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight]; [topView autoSetDimension:ALDimensionHeight toSize:kOWSTable_DefaultCellHeight];
UIImageView *iconView = [self viewForIconWithName:@"table_ic_hourglass"]; UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_hourglass"];
[topView addSubview:iconView]; [topView addSubview:iconView];
[iconView autoVCenterInSuperview]; [iconView autoVCenterInSuperview];
[iconView autoPinLeadingToSuperView]; [iconView autoPinLeadingToSuperView];
UILabel *rowLabel = self.disappearingMessagesDurationLabel; UILabel *rowLabel = strongSelf.disappearingMessagesDurationLabel;
[self updateDisappearingMessagesDurationLabel]; [strongSelf updateDisappearingMessagesDurationLabel];
rowLabel.textColor = [UIColor blackColor]; rowLabel.textColor = [UIColor blackColor];
rowLabel.font = [UIFont ows_footnoteFont]; rowLabel.font = [UIFont ows_footnoteFont];
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail; rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
@ -375,11 +381,11 @@ NS_ASSUME_NONNULL_BEGIN
[rowLabel autoPinLeadingToTrailingOfView:iconView margin:weakSelf.iconSpacing]; [rowLabel autoPinLeadingToTrailingOfView:iconView margin:weakSelf.iconSpacing];
UISlider *slider = [UISlider new]; UISlider *slider = [UISlider new];
slider.maximumValue = (float)(self.disappearingMessagesDurations.count - 1); slider.maximumValue = (float)(strongSelf.disappearingMessagesDurations.count - 1);
slider.minimumValue = 0; slider.minimumValue = 0;
slider.continuous = YES; // NO fires change event only once you let go slider.continuous = YES; // NO fires change event only once you let go
slider.value = self.disappearingMessagesConfiguration.durationIndex; slider.value = strongSelf.disappearingMessagesConfiguration.durationIndex;
[slider addTarget:self [slider addTarget:strongSelf
action:@selector(durationSliderDidChange:) action:@selector(durationSliderDidChange:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
[cell.contentView addSubview:slider]; [cell.contentView addSubview:slider];
@ -436,11 +442,13 @@ NS_ASSUME_NONNULL_BEGIN
OWSTableSection *muteSection = [OWSTableSection new]; OWSTableSection *muteSection = [OWSTableSection new];
[muteSection addItem:[OWSTableItem itemWithCustomCellBlock:^{ [muteSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil]; UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
UIImageView *iconView = [self viewForIconWithName:@"table_ic_mute_thread"]; UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_mute_thread"];
[cell.contentView addSubview:iconView]; [cell.contentView addSubview:iconView];
[iconView autoVCenterInSuperview]; [iconView autoVCenterInSuperview];
[iconView autoPinLeadingToSuperView]; [iconView autoPinLeadingToSuperView];
@ -457,7 +465,7 @@ NS_ASSUME_NONNULL_BEGIN
NSString *muteStatus = NSLocalizedString( NSString *muteStatus = NSLocalizedString(
@"CONVERSATION_SETTINGS_MUTE_NOT_MUTED", @"Indicates that the current thread is not muted."); @"CONVERSATION_SETTINGS_MUTE_NOT_MUTED", @"Indicates that the current thread is not muted.");
NSDate *mutedUntilDate = self.thread.mutedUntilDate; NSDate *mutedUntilDate = strongSelf.thread.mutedUntilDate;
NSDate *now = [NSDate date]; NSDate *now = [NSDate date];
if (mutedUntilDate != nil && [mutedUntilDate timeIntervalSinceDate:now] > 0) { if (mutedUntilDate != nil && [mutedUntilDate timeIntervalSinceDate:now] > 0) {
NSCalendar *calendar = [NSCalendar currentCalendar]; NSCalendar *calendar = [NSCalendar currentCalendar];
@ -506,11 +514,13 @@ NS_ASSUME_NONNULL_BEGIN
[weakSelf disclosureCellWithName:NSLocalizedString(@"CONVERSATION_SETTINGS_BLOCK_THIS_USER", [weakSelf disclosureCellWithName:NSLocalizedString(@"CONVERSATION_SETTINGS_BLOCK_THIS_USER",
@"table cell label in conversation settings") @"table cell label in conversation settings")
iconName:@"table_ic_block"]; iconName:@"table_ic_block"];
OWSConversationSettingsTableViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
UISwitch *blockUserSwitch = [UISwitch new]; UISwitch *blockUserSwitch = [UISwitch new];
blockUserSwitch.on = isBlocked; blockUserSwitch.on = isBlocked;
[blockUserSwitch addTarget:self [blockUserSwitch addTarget:strongSelf
action:@selector(blockUserSwitchDidChange:) action:@selector(blockUserSwitchDidChange:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
cell.accessoryView = blockUserSwitch; cell.accessoryView = blockUserSwitch;
@ -521,7 +531,6 @@ NS_ASSUME_NONNULL_BEGIN
} }
self.contents = contents; self.contents = contents;
[self.tableView reloadData];
} }
- (CGFloat)iconSpacing - (CGFloat)iconSpacing
@ -892,7 +901,7 @@ NS_ASSUME_NONNULL_BEGIN
{ {
self.disappearingMessagesConfiguration.enabled = flag; self.disappearingMessagesConfiguration.enabled = flag;
[self.tableView reloadData]; [self updateTableContents];
} }
- (void)durationSliderDidChange:(UISlider *)slider - (void)durationSliderDidChange:(UISlider *)slider
@ -1045,7 +1054,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setThreadMutedUntilDate:(nullable NSDate *)value - (void)setThreadMutedUntilDate:(nullable NSDate *)value
{ {
[self.thread updateWithMutedUntilDate:value]; [self.thread updateWithMutedUntilDate:value];
[self.tableView reloadData]; [self updateTableContents];
} }
#pragma mark - Notifications #pragma mark - Notifications

@ -1,13 +1,20 @@
// Copyright © 2016 Open Whisper Systems. All rights reserved. //
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSQRCodeScanningViewController.h" #import "OWSQRCodeScanningViewController.h"
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@class OWSLinkedDevicesTableViewController; @class OWSLinkedDevicesTableViewController;
@interface OWSLinkDeviceViewController : UIViewController <OWSQRScannerDelegate> @interface OWSLinkDeviceViewController : OWSViewController <OWSQRScannerDelegate>
@property OWSLinkedDevicesTableViewController *linkedDevicesTableViewController; @property OWSLinkedDevicesTableViewController *linkedDevicesTableViewController;
- (void)controller:(OWSQRCodeScanningViewController *)controller didDetectQRCodeWithString:(NSString *)string; - (void)controller:(OWSQRCodeScanningViewController *)controller didDetectQRCodeWithString:(NSString *)string;
@end @end
NS_ASSUME_NONNULL_END

@ -2,10 +2,13 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import "OWSViewController.h"
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <ZXingObjC/ZXingObjC.h> #import <ZXingObjC/ZXingObjC.h>
NS_ASSUME_NONNULL_BEGIN
@class OWSQRCodeScanningViewController; @class OWSQRCodeScanningViewController;
@protocol OWSQRScannerDelegate @protocol OWSQRScannerDelegate
@ -20,10 +23,12 @@
#pragma mark - #pragma mark -
@interface OWSQRCodeScanningViewController @interface OWSQRCodeScanningViewController
: UIViewController <AVCaptureMetadataOutputObjectsDelegate, ZXCaptureDelegate> : OWSViewController <AVCaptureMetadataOutputObjectsDelegate, ZXCaptureDelegate>
@property (nonatomic, weak) UIViewController<OWSQRScannerDelegate> *scanDelegate; @property (nonatomic, weak) UIViewController<OWSQRScannerDelegate> *scanDelegate;
- (void)startCapture; - (void)startCapture;
@end @end
NS_ASSUME_NONNULL_END

@ -7,6 +7,8 @@
#import "UIColor+OWS.h" #import "UIColor+OWS.h"
#import "UIView+OWS.h" #import "UIView+OWS.h"
NS_ASSUME_NONNULL_BEGIN
@interface OWSQRCodeScanningViewController () @interface OWSQRCodeScanningViewController ()
@property (atomic) ZXCapture *capture; @property (atomic) ZXCapture *capture;
@ -36,7 +38,7 @@
return self; return self;
} }
- (instancetype)initWithCoder:(NSCoder *)aDecoder - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
{ {
self = [super initWithCoder:aDecoder]; self = [super initWithCoder:aDecoder];
if (!self) { if (!self) {
@ -159,3 +161,5 @@
} }
@end @end
NS_ASSUME_NONNULL_END

@ -2,7 +2,7 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import <UIKit/UIKit.h> #import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -103,7 +103,7 @@ typedef UITableViewCell *_Nonnull (^OWSTableCustomCellBlock)();
#pragma mark - #pragma mark -
@interface OWSTableViewController : UIViewController @interface OWSTableViewController : OWSViewController
@property (nonatomic, weak) id<OWSTableViewControllerDelegate> delegate; @property (nonatomic, weak) id<OWSTableViewControllerDelegate> delegate;

@ -282,10 +282,12 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
selector:(SEL)selector selector:(SEL)selector
{ {
OWSAssert(text.length > 0); OWSAssert(text.length > 0);
OWSAssert(target);
OWSAssert(selector); OWSAssert(selector);
OWSTableItem *item = [OWSTableItem new]; OWSTableItem *item = [OWSTableItem new];
item.itemType = OWSTableItemTypeAction; item.itemType = OWSTableItemTypeAction;
__weak id weakTarget = target;
item.customCellBlock = ^{ item.customCellBlock = ^{
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
cell.textLabel.text = text; cell.textLabel.text = text;
@ -295,7 +297,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
UISwitch *cellSwitch = [UISwitch new]; UISwitch *cellSwitch = [UISwitch new];
cell.accessoryView = cellSwitch; cell.accessoryView = cellSwitch;
[cellSwitch setOn:isOn]; [cellSwitch setOn:isOn];
[cellSwitch addTarget:target action:selector forControlEvents:UIControlEventValueChanged]; [cellSwitch addTarget:weakTarget action:selector forControlEvents:UIControlEventValueChanged];
cellSwitch.enabled = isEnabled; cellSwitch.enabled = isEnabled;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;

@ -0,0 +1,13 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface OWSViewController : UIViewController
@end
NS_ASSUME_NONNULL_END

@ -0,0 +1,19 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@implementation OWSViewController
- (void)dealloc
{
// Surface memory leaks by logging the deallocation of view controllers.
DDLogVerbose(@"Dealloc: %@", self.class);
}
@end
NS_ASSUME_NONNULL_END

@ -6,7 +6,7 @@ import Foundation
import WebRTC import WebRTC
import PromiseKit import PromiseKit
class OversizeTextMessageViewController: UIViewController { class OversizeTextMessageViewController: OWSViewController {
let TAG = "[OversizeTextMessageViewController]" let TAG = "[OversizeTextMessageViewController]"

@ -96,7 +96,6 @@ NS_ASSUME_NONNULL_BEGIN
}]]; }]];
[contents addSection:historyLogsSection]; [contents addSection:historyLogsSection];
self.contents = contents; self.contents = contents;
} }

@ -2,11 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import <UIKit/UIKit.h> #import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface RegistrationViewController : UIViewController @interface RegistrationViewController : OWSViewController
@end @end

@ -2,7 +2,7 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import <UIKit/UIKit.h> #import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
@class ContactsViewHelper; @class ContactsViewHelper;
@interface SelectRecipientViewController : UIViewController @interface SelectRecipientViewController : OWSViewController
@property (nonatomic, weak) id<SelectRecipientViewControllerDelegate> delegate; @property (nonatomic, weak) id<SelectRecipientViewControllerDelegate> delegate;

@ -446,7 +446,6 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
- (void)updateTableContents - (void)updateTableContents
{ {
OWSTableContents *contents = [OWSTableContents new]; OWSTableContents *contents = [OWSTableContents new];
__weak SelectRecipientViewController *weakSelf = self; __weak SelectRecipientViewController *weakSelf = self;
ContactsViewHelper *helper = self.contactsViewHelper; ContactsViewHelper *helper = self.contactsViewHelper;
@ -458,57 +457,59 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
const CGFloat kButtonRowHeight = 60; const CGFloat kButtonRowHeight = 60;
[phoneNumberSection addItem:[OWSTableItem itemWithCustomCellBlock:^{ [phoneNumberSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
SelectRecipientViewController *strongSelf = weakSelf; SelectRecipientViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES;
// Country Row // Country Row
UIView *countryRow = [self createRowWithHeight:kCountryRowHeight previousRow:nil superview:cell.contentView]; UIView *countryRow =
[countryRow addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self [strongSelf createRowWithHeight:kCountryRowHeight previousRow:nil superview:cell.contentView];
[countryRow addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:strongSelf
action:@selector(countryRowTouched:)]]; action:@selector(countryRowTouched:)]];
UILabel *countryCodeLabel = self.countryCodeLabel; UILabel *countryCodeLabel = strongSelf.countryCodeLabel;
[countryRow addSubview:countryCodeLabel]; [countryRow addSubview:countryCodeLabel];
[countryCodeLabel autoPinLeadingToSuperView]; [countryCodeLabel autoPinLeadingToSuperView];
[countryCodeLabel autoVCenterInSuperview]; [countryCodeLabel autoVCenterInSuperview];
[countryRow addSubview:self.countryCodeButton]; [countryRow addSubview:strongSelf.countryCodeButton];
[self.countryCodeButton autoPinTrailingToSuperView]; [strongSelf.countryCodeButton autoPinTrailingToSuperView];
[self.countryCodeButton autoVCenterInSuperview]; [strongSelf.countryCodeButton autoVCenterInSuperview];
// Phone Number Row // Phone Number Row
UIView *phoneNumberRow = UIView *phoneNumberRow =
[self createRowWithHeight:kPhoneNumberRowHeight previousRow:countryRow superview:cell.contentView]; [strongSelf createRowWithHeight:kPhoneNumberRowHeight previousRow:countryRow superview:cell.contentView];
[phoneNumberRow [phoneNumberRow
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:strongSelf
action:@selector(phoneNumberRowTouched:)]]; action:@selector(phoneNumberRowTouched:)]];
UILabel *phoneNumberLabel = self.phoneNumberLabel; UILabel *phoneNumberLabel = strongSelf.phoneNumberLabel;
[phoneNumberRow addSubview:phoneNumberLabel]; [phoneNumberRow addSubview:phoneNumberLabel];
[phoneNumberLabel autoPinLeadingToSuperView]; [phoneNumberLabel autoPinLeadingToSuperView];
[phoneNumberLabel autoVCenterInSuperview]; [phoneNumberLabel autoVCenterInSuperview];
[phoneNumberRow addSubview:self.phoneNumberTextField]; [phoneNumberRow addSubview:strongSelf.phoneNumberTextField];
[self.phoneNumberTextField autoPinLeadingToTrailingOfView:phoneNumberLabel margin:10.f]; [strongSelf.phoneNumberTextField autoPinLeadingToTrailingOfView:phoneNumberLabel margin:10.f];
[self.phoneNumberTextField autoPinTrailingToSuperView]; [strongSelf.phoneNumberTextField autoPinTrailingToSuperView];
[self.phoneNumberTextField autoVCenterInSuperview]; [strongSelf.phoneNumberTextField autoVCenterInSuperview];
// Example row. // Example row.
UIView *examplePhoneNumberRow = [self createRowWithHeight:examplePhoneNumberRowHeight UIView *examplePhoneNumberRow = [strongSelf createRowWithHeight:examplePhoneNumberRowHeight
previousRow:phoneNumberRow previousRow:phoneNumberRow
superview:cell.contentView]; superview:cell.contentView];
[examplePhoneNumberRow addSubview:self.examplePhoneNumberLabel]; [examplePhoneNumberRow addSubview:strongSelf.examplePhoneNumberLabel];
[self.examplePhoneNumberLabel autoVCenterInSuperview]; [strongSelf.examplePhoneNumberLabel autoVCenterInSuperview];
[self.examplePhoneNumberLabel autoPinTrailingToSuperView]; [strongSelf.examplePhoneNumberLabel autoPinTrailingToSuperView];
// Phone Number Button Row // Phone Number Button Row
UIView *buttonRow = UIView *buttonRow = [strongSelf createRowWithHeight:kButtonRowHeight
[self createRowWithHeight:kButtonRowHeight previousRow:examplePhoneNumberRow superview:cell.contentView]; previousRow:examplePhoneNumberRow
[buttonRow addSubview:self.phoneNumberButton]; superview:cell.contentView];
[self.phoneNumberButton autoVCenterInSuperview]; [buttonRow addSubview:strongSelf.phoneNumberButton];
[self.phoneNumberButton autoPinTrailingToSuperView]; [strongSelf.phoneNumberButton autoVCenterInSuperview];
[strongSelf.phoneNumberButton autoPinTrailingToSuperView];
[buttonRow autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [buttonRow autoPinEdgeToSuperviewEdge:ALEdgeBottom];
@ -538,7 +539,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
for (SignalAccount *signalAccount in signalAccounts) { for (SignalAccount *signalAccount in signalAccounts) {
[contactsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{ [contactsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
SelectRecipientViewController *strongSelf = weakSelf; SelectRecipientViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId]; BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId];

@ -2,6 +2,8 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import "OWSViewController.h"
@class TSThread; @class TSThread;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -20,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
// A base class for views used to pick a single signal user, either by // A base class for views used to pick a single signal user, either by
// entering a phone number or picking from your contacts. // entering a phone number or picking from your contacts.
@interface SelectThreadViewController : UIViewController @interface SelectThreadViewController : OWSViewController
@property (nonatomic, weak) id<SelectThreadViewControllerDelegate> delegate; @property (nonatomic, weak) id<SelectThreadViewControllerDelegate> delegate;

@ -136,7 +136,7 @@ NS_ASSUME_NONNULL_BEGIN
for (TSThread *thread in [self filteredThreadsWithSearchText]) { for (TSThread *thread in [self filteredThreadsWithSearchText]) {
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{ [section addItem:[OWSTableItem itemWithCustomCellBlock:^{
SelectThreadViewController *strongSelf = weakSelf; SelectThreadViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
// To be consistent with the threads (above), we use ContactTableViewCell // To be consistent with the threads (above), we use ContactTableViewCell
// instead of InboxTableViewCell to present contacts and threads. // instead of InboxTableViewCell to present contacts and threads.
@ -155,7 +155,7 @@ NS_ASSUME_NONNULL_BEGIN
for (SignalAccount *signalAccount in filteredSignalAccounts) { for (SignalAccount *signalAccount in filteredSignalAccounts) {
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{ [section addItem:[OWSTableItem itemWithCustomCellBlock:^{
SelectThreadViewController *strongSelf = weakSelf; SelectThreadViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId]; BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId];

@ -239,8 +239,6 @@
- (void)showPrivacy - (void)showPrivacy
{ {
PrivacySettingsTableViewController *vc = [[PrivacySettingsTableViewController alloc] init]; PrivacySettingsTableViewController *vc = [[PrivacySettingsTableViewController alloc] init];
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
NSAssert(vc != nil, @"Privacy Settings View Controller must not be nil");
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }
@ -260,16 +258,12 @@
- (void)showAdvanced - (void)showAdvanced
{ {
AdvancedSettingsTableViewController *vc = [[AdvancedSettingsTableViewController alloc] init]; AdvancedSettingsTableViewController *vc = [[AdvancedSettingsTableViewController alloc] init];
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
NSAssert(vc != nil, @"Advanced Settings View Controller must not be nil");
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }
- (void)showAbout - (void)showAbout
{ {
AboutTableViewController *vc = [[AboutTableViewController alloc] init]; AboutTableViewController *vc = [[AboutTableViewController alloc] init];
NSAssert(self.navigationController != nil, @"Navigation controller must not be nil");
NSAssert(vc != nil, @"About View Controller must not be nil");
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }

@ -169,7 +169,7 @@ NS_ASSUME_NONNULL_BEGIN
for (NSString *recipientId in [recipientIds sortedArrayUsingSelector:@selector(compare:)]) { for (NSString *recipientId in [recipientIds sortedArrayUsingSelector:@selector(compare:)]) {
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{ [section addItem:[OWSTableItem itemWithCustomCellBlock:^{
ShowGroupMembersViewController *strongSelf = weakSelf; ShowGroupMembersViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
SignalAccount *signalAccount = [helper signalAccountForRecipientId:recipientId]; SignalAccount *signalAccount = [helper signalAccountForRecipientId:recipientId];

@ -2,11 +2,12 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import "OWSViewController.h"
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@class TSThread; @class TSThread;
@interface SignalsViewController : UIViewController @interface SignalsViewController : OWSViewController
// TODO: Remove this property. // TODO: Remove this property.
@property (nonatomic) BOOL newlyRegisteredUser; @property (nonatomic) BOOL newlyRegisteredUser;

@ -3,6 +3,7 @@
// //
#import "OWSConversationSettingsViewDelegate.h" #import "OWSConversationSettingsViewDelegate.h"
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -14,7 +15,7 @@ typedef NS_ENUM(NSUInteger, UpdateGroupMode) {
UpdateGroupMode_EditGroupAvatar, UpdateGroupMode_EditGroupAvatar,
}; };
@interface UpdateGroupViewController : UIViewController @interface UpdateGroupViewController : OWSViewController
@property (nonatomic, weak) id<OWSConversationSettingsViewDelegate> conversationSettingsViewDelegate; @property (nonatomic, weak) id<OWSConversationSettingsViewDelegate> conversationSettingsViewDelegate;

@ -265,7 +265,7 @@ NS_ASSUME_NONNULL_BEGIN
[section [section
addItem:[OWSTableItem itemWithCustomCellBlock:^{ addItem:[OWSTableItem itemWithCustomCellBlock:^{
UpdateGroupViewController *strongSelf = weakSelf; UpdateGroupViewController *strongSelf = weakSelf;
OWSAssert(strongSelf); OWSCAssert(strongSelf);
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
SignalAccount *signalAccount = [contactsViewHelper signalAccountForRecipientId:recipientId]; SignalAccount *signalAccount = [contactsViewHelper signalAccountForRecipientId:recipientId];

Loading…
Cancel
Save