Respond to CR.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 2bc1d44cd2
commit 45ae8fb067

@ -84,6 +84,7 @@ NS_ASSUME_NONNULL_BEGIN
_tableViewController = [OWSTableViewController new]; _tableViewController = [OWSTableViewController new];
_tableViewController.delegate = self; _tableViewController.delegate = self;
_tableViewController.tableViewStyle = UITableViewStylePlain;
[self.view addSubview:self.tableViewController.view]; [self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview]; [_tableViewController.view autoPinWidthToSuperview];
[_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeTop]; [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeTop];
@ -258,11 +259,6 @@ NS_ASSUME_NONNULL_BEGIN
if ([self.nonContactAccountSet containsObject:phoneNumber]) { if ([self.nonContactAccountSet containsObject:phoneNumber]) {
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{ [section addItem:[OWSTableItem itemWithCustomCellBlock:^{
MessageComposeTableViewController *strongSelf = weakSelf;
if (!strongSelf) {
return (ContactTableViewCell *)nil;
}
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
BOOL isBlocked = [helper isRecipientIdBlocked:phoneNumber]; BOOL isBlocked = [helper isRecipientIdBlocked:phoneNumber];
if (isBlocked) { if (isBlocked) {
@ -302,11 +298,6 @@ NS_ASSUME_NONNULL_BEGIN
NSArray<SignalAccount *> *filteredSignalAccounts = [self filteredSignalAccounts]; NSArray<SignalAccount *> *filteredSignalAccounts = [self filteredSignalAccounts];
for (SignalAccount *signalAccount in filteredSignalAccounts) { for (SignalAccount *signalAccount in filteredSignalAccounts) {
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{ [section addItem:[OWSTableItem itemWithCustomCellBlock:^{
MessageComposeTableViewController *strongSelf = weakSelf;
if (!strongSelf) {
return (ContactTableViewCell *)nil;
}
ContactTableViewCell *cell = [ContactTableViewCell new]; ContactTableViewCell *cell = [ContactTableViewCell new];
BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId]; BOOL isBlocked = [helper isRecipientIdBlocked:signalAccount.recipientId];
if (isBlocked) { if (isBlocked) {

@ -86,6 +86,8 @@ typedef UITableViewCell *_Nonnull (^OWSTableCustomCellBlock)();
@property (nonatomic) OWSTableContents *contents; @property (nonatomic) OWSTableContents *contents;
@property (nonatomic, readonly) UITableView *tableView; @property (nonatomic, readonly) UITableView *tableView;
@property (nonatomic) UITableViewStyle tableViewStyle;
#pragma mark - Presentation #pragma mark - Presentation
- (void)presentFromViewController:(UIViewController *)fromViewController; - (void)presentFromViewController:(UIViewController *)fromViewController;

@ -178,9 +178,13 @@ NSString * const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
- (instancetype)init - (instancetype)init
{ {
if (self = [super init]) { self = [super init];
_contents = [OWSTableContents new]; if (!self) {
return self;
} }
[self commonInit];
return self; return self;
} }
@ -191,7 +195,7 @@ NSString * const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
return self; return self;
} }
_contents = [OWSTableContents new]; [self commonInit];
return self; return self;
} }
@ -203,11 +207,17 @@ NSString * const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
return self; return self;
} }
_contents = [OWSTableContents new]; [self commonInit];
return self; return self;
} }
- (void)commonInit
{
_contents = [OWSTableContents new];
self.tableViewStyle = UITableViewStyleGrouped;
}
- (void)loadView - (void)loadView
{ {
[super loadView]; [super loadView];
@ -218,7 +228,7 @@ NSString * const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
self.title = self.contents.title; self.title = self.contents.title;
} }
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:self.tableViewStyle];
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];

Loading…
Cancel
Save