Respond to CR.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 6b8d4ea7ae
commit 77a775bbce

@ -2,12 +2,12 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// //
#import <Foundation/Foundation.h>
@class TSThread; @class TSThread;
@class OWSMessageSender; @class OWSMessageSender;
@class SignalAttachment; @class SignalAttachment;
NS_ASSUME_NONNULL_BEGIN
@interface ThreadUtil : NSObject @interface ThreadUtil : NSObject
+ (void)sendMessageWithText:(NSString *)text + (void)sendMessageWithText:(NSString *)text
@ -19,3 +19,5 @@
messageSender:(OWSMessageSender *)messageSender; messageSender:(OWSMessageSender *)messageSender;
@end @end
NS_ASSUME_NONNULL_END

@ -10,6 +10,8 @@
#import <SignalServiceKit/TSOutgoingMessage.h> #import <SignalServiceKit/TSOutgoingMessage.h>
#import <SignalServiceKit/TSThread.h> #import <SignalServiceKit/TSThread.h>
NS_ASSUME_NONNULL_BEGIN
@implementation ThreadUtil @implementation ThreadUtil
+ (void)sendMessageWithText:(NSString *)text inThread:(TSThread *)thread messageSender:(OWSMessageSender *)messageSender + (void)sendMessageWithText:(NSString *)text inThread:(TSThread *)thread messageSender:(OWSMessageSender *)messageSender
@ -95,3 +97,5 @@
} }
@end @end
NS_ASSUME_NONNULL_END

@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSTableContents : NSObject @interface OWSTableContents : NSObject
@property (nonatomic) NSString *title; @property (nonatomic) NSString *title;
@property (nonatomic) NSMutableArray *sections; @property (nonatomic) NSMutableArray<OWSTableSection *> *sections;
@end @end
@ -23,12 +23,15 @@ NS_ASSUME_NONNULL_BEGIN
@implementation OWSTableContents @implementation OWSTableContents
- (void)addSection:(OWSTableSection *)section { -(instancetype)init {
OWSAssert(section); if (self = [self init]) {
if (!_sections) {
_sections = [NSMutableArray new]; _sections = [NSMutableArray new];
} }
return self;
}
- (void)addSection:(OWSTableSection *)section {
OWSAssert(section);
[_sections addObject:section]; [_sections addObject:section];
} }
@ -40,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSTableSection : NSObject @interface OWSTableSection : NSObject
@property (nonatomic) NSString *title; @property (nonatomic) NSString *title;
@property (nonatomic) NSMutableArray *items; @property (nonatomic) NSMutableArray<OWSTableItem *> *items;
@end @end
@ -56,6 +59,13 @@ NS_ASSUME_NONNULL_BEGIN
return section; return section;
} }
-(instancetype)init {
if (self = [self init]) {
_items = [NSMutableArray new];
}
return self;
}
- (void)addItem:(OWSTableItem *)item { - (void)addItem:(OWSTableItem *)item {
OWSAssert(item); OWSAssert(item);

Loading…
Cancel
Save