Skip to content

Commit 8e40c29

Browse files
committed
Fix YLTableViewExample project after updating to YLTableView 2.0
1 parent b059bec commit 8e40c29

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

YLTableViewExample/Classes/ImagesView/YLExampleImagesCell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
#import <YLTableView/YLTableViewCell.h>
1010

11-
@interface YLExampleImagesCell : YLTableViewCell
11+
@interface YLExampleImagesCell : UITableViewCell <YLTableViewCell>
1212

1313
@end

YLTableViewExample/Classes/ImagesView/YLExampleImagesCell.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ - (void)_installConstraints {
3939
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[view]|" options:0 metrics:nil views:views]];
4040
}
4141

42-
#pragma mark YLTableViewCell subclass
42+
#pragma mark YLTableViewCell protocol
4343

4444
- (void)setModel:(id)model {
4545
NSAssert([model isKindOfClass:[YLExampleImagesCellModel class]], @"Must use %@ with %@", NSStringFromClass([YLExampleImagesCellModel class]), NSStringFromClass([self class]));
@@ -50,6 +50,10 @@ - (void)setModel:(id)model {
5050
self.imagesViewController.imageThree = imagesModel.imageThree;
5151
}
5252

53+
+ (CGFloat)estimatedRowHeight {
54+
return 44.0;
55+
}
56+
5357
#pragma mark YLTableViewChildViewControllerCell
5458

5559
- (YLExampleImagesViewController *)childViewController {

YLTableViewExample/Classes/YLExampleTextCell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
#import <YLTableView/YLTableViewCell.h>
1010

11-
@interface YLExampleTextCell : YLTableViewCell
11+
@interface YLExampleTextCell : UITableViewCell <YLTableViewCell>
1212

1313
@end

YLTableViewExample/Classes/YLExampleTextCell.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@ - (void)layoutSubviews {
4949
}
5050
}
5151

52-
#pragma mark YLTableViewCell Subclass
52+
#pragma mark YLTableViewCell protocol
5353

5454
- (void)setModel:(id)model {
5555
NSAssert([model isKindOfClass:[NSString class]], @"Must use %@ with %@", NSStringFromClass([NSString class]), NSStringFromClass([self class]));
5656
self.mainTextLabel.text = (NSString *)model;
5757
}
5858

59+
+ (CGFloat)estimatedRowHeight {
60+
return 44.0;
61+
}
62+
5963
@end

YLTableViewExample/Classes/YLExampleViewController.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ - (YLTableView *)tableView {
5454
_tableView.dataSource = _dataSource;
5555
_tableView.delegate = _dataSource;
5656

57-
// Make sure you set estimated row height, or UITableViewAutomaticDimension won't work.
58-
_tableView.estimatedRowHeight = 44.0;
59-
6057
// Set up a refresh header
6158
_tableView.refreshHeaderView = [[YLExampleRefreshHeader alloc] init];
6259
[_tableView.refreshHeaderView addTarget:self action:@selector(_shouldRefresh) forControlEvents:UIControlEventValueChanged];

YLTableViewExample/Podfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
platform :ios, '7.0'
2-
3-
xcodeproj 'YLTableViewExample.xcodeproj'
4-
workspace 'YLTableViewExample.xcworkspace'
1+
platform :ios, '8.0'
52

63
source 'https://github.com/CocoaPods/Specs.git'
74

YLTableViewExample/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- YLTableView (1.0.3)
2+
- YLTableView (2.0.0)
33

44
DEPENDENCIES:
55
- YLTableView (from `../`)
@@ -9,6 +9,6 @@ EXTERNAL SOURCES:
99
:path: ../
1010

1111
SPEC CHECKSUMS:
12-
YLTableView: 0b10cf1d3af0c871a6836f525768b5153750e68a
12+
YLTableView: f819d71c9ca54ff8aa32054fbae6213c6cbef0fe
1313

1414
COCOAPODS: 0.39.0

0 commit comments

Comments
 (0)