Skip to content

Commit eedfc23

Browse files
committed
Reformatted, changed message to text in Message
1 parent 0c60378 commit eedfc23

File tree

7 files changed

+32
-40
lines changed

7 files changed

+32
-40
lines changed

examples/FirebaseUIChat/FirebaseUIChat/Message.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
@interface Message : NSObject
1212

13-
@property (strong, nonatomic) NSString *name;
14-
@property (strong, nonatomic) NSString *message;
13+
@property(strong, nonatomic) NSString *name;
14+
@property(strong, nonatomic) NSString *text;
1515

16-
-(instancetype)initWithName:(NSString *)name andMessage:(NSString *)message;
16+
- (instancetype)initWithName:(NSString *)name andText:(NSString *)text;
1717

1818
@end

examples/FirebaseUIChat/FirebaseUIChat/Message.m

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,16 @@
1111
@implementation Message
1212

1313
- (instancetype)init;
14-
{
15-
return [self initWithName:@"" andMessage:@""];
16-
}
14+
{ return [self initWithName:@"" andText:@""]; }
1715

18-
-(instancetype)initWithName:(NSString *)name andMessage:(NSString *)message;
16+
- (instancetype)initWithName:(NSString *)name andText:(NSString *)text;
1917
{
20-
self = [super init];
21-
if (self) {
22-
self.name = name;
23-
self.message = message;
24-
}
25-
return self;
18+
self = [super init];
19+
if (self) {
20+
self.name = name;
21+
self.text = text;
22+
}
23+
return self;
2624
}
2725

2826
@end

examples/FirebaseUIChat/FirebaseUIChat/MessageDataSource.m

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@
1010

1111
@implementation MessageDataSource
1212

13-
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath;
14-
{
15-
return YES;
16-
}
13+
- (BOOL)tableView:(UITableView *)tableView
14+
canEditRowAtIndexPath:(NSIndexPath *)indexPath;
15+
{ return YES; }
1716

18-
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;
17+
- (void)tableView:(UITableView *)tableView
18+
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
19+
forRowAtIndexPath:(NSIndexPath *)indexPath;
1920
{
20-
if (editingStyle == UITableViewCellEditingStyleDelete) {
21-
[[self refForIndex:indexPath.row] removeValue];
22-
}
21+
if (editingStyle == UITableViewCellEditingStyleDelete) {
22+
[[self refForIndex:indexPath.row] removeValue];
23+
}
2324
}
2425

2526
@end

examples/FirebaseUIChat/FirebaseUIChat/MessageTableViewCell.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#import <UIKit/UIKit.h>
1010

1111
@interface MessageTableViewCell : UITableViewCell
12-
@property (weak, nonatomic) IBOutlet UILabel *myMessageLabel;
13-
@property (weak, nonatomic) IBOutlet UILabel *myNameLabel;
12+
@property(weak, nonatomic) IBOutlet UILabel *myMessageLabel;
13+
@property(weak, nonatomic) IBOutlet UILabel *myNameLabel;
1414

15-
@property (weak, nonatomic) IBOutlet UILabel *otherMessageLabel;
16-
@property (weak, nonatomic) IBOutlet UILabel *otherNameLabel;
15+
@property(weak, nonatomic) IBOutlet UILabel *otherMessageLabel;
16+
@property(weak, nonatomic) IBOutlet UILabel *otherNameLabel;
1717

1818
@end

examples/FirebaseUIChat/FirebaseUIChat/MessageTableViewCell.m

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,7 @@
1010

1111
@implementation MessageTableViewCell
1212

13-
-(void)awakeFromNib;
14-
{
15-
16-
}
17-
18-
-(instancetype)initWithFrame:(CGRect)frame;
19-
{
20-
return [super initWithFrame:frame];
21-
}
13+
- (instancetype)initWithFrame:(CGRect)frame;
14+
{ return [super initWithFrame:frame]; }
2215

2316
@end

examples/FirebaseUIChat/FirebaseUIChat/MessageTableViewCell.xib

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<constraint firstAttribute="width" constant="200" id="QJh-Yw-onp"/>
2323
</constraints>
2424
<fontDescription key="fontDescription" type="system" pointSize="17"/>
25-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
25+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
2626
<nil key="highlightedColor"/>
2727
</label>
2828
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Other User" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1WX-IN-auO">
@@ -31,7 +31,7 @@
3131
<constraint firstAttribute="width" constant="80" id="AsI-EJ-YHV"/>
3232
</constraints>
3333
<fontDescription key="fontDescription" type="system" pointSize="12"/>
34-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
34+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
3535
<nil key="highlightedColor"/>
3636
</label>
3737
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="My User" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mrk-ON-tvy">
@@ -40,7 +40,7 @@
4040
<constraint firstAttribute="width" constant="80" id="Aas-Cs-1Hu"/>
4141
</constraints>
4242
<fontDescription key="fontDescription" type="system" pointSize="12"/>
43-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
43+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
4444
<nil key="highlightedColor"/>
4545
</label>
4646
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="My Message" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2Ap-Nl-3lF">
@@ -49,7 +49,7 @@
4949
<constraint firstAttribute="width" constant="200" id="UAX-Z2-DwD"/>
5050
</constraints>
5151
<fontDescription key="fontDescription" type="system" pointSize="17"/>
52-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
52+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
5353
<nil key="highlightedColor"/>
5454
</label>
5555
</subviews>

examples/FirebaseUIChat/FirebaseUIChat/ViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ - (void)viewDidLoad {
3333
populateCellWithBlock:^void(MessageTableViewCell *__nonnull cell,
3434
Message *__nonnull message) {
3535
if ([message.name isEqualToString:@"iOS User"]) {
36-
cell.myMessageLabel.text = message.message;
36+
cell.myMessageLabel.text = message.text;
3737
cell.myNameLabel.text = message.name;
3838
cell.myNameLabel.textColor = [UIColor colorWithRed:52.0 / 255.0
3939
green:170.0 / 255.0
@@ -44,7 +44,7 @@ - (void)viewDidLoad {
4444
[cell.myMessageLabel setHidden:NO];
4545
[cell.myNameLabel setHidden:NO];
4646
} else {
47-
cell.otherMessageLabel.text = message.message;
47+
cell.otherMessageLabel.text = message.text;
4848
cell.otherNameLabel.text = message.name;
4949
cell.otherNameLabel.textColor = [UIColor colorWithRed:164.0 / 255.0
5050
green:199.0 / 255.0

0 commit comments

Comments
 (0)