Skip to content

Commit 7b068ed

Browse files
committed
崩溃处理 #5
1 parent 40674da commit 7b068ed

10 files changed

Lines changed: 28 additions & 17 deletions

File tree

Example/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- UITableViewDynamicLayoutCacheHeight (5.0.8)
2+
- UITableViewDynamicLayoutCacheHeight (5.1.0)
33

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

1111
SPEC CHECKSUMS:
12-
UITableViewDynamicLayoutCacheHeight: 3d7afa1c9f173b353a405f1fc24552ebea82e8f3
12+
UITableViewDynamicLayoutCacheHeight: bc9ae64d5a6a9333c682e6761033ce68b8efd22b
1313

1414
PODFILE CHECKSUM: 8f6ea4e84c7114336b1ac30a0ee7e89a3d39de66
1515

16-
COCOAPODS: 1.8.3
16+
COCOAPODS: 1.8.4

Example/Pods/Local Podspecs/UITableViewDynamicLayoutCacheHeight.podspec.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/UITableViewDynamicLayoutCacheHeight/UITableViewDynamicLayoutCacheHeight-Info.plist

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/UITableViewDynamicLayoutCacheHeight.xcodeproj/project.pbxproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
057948392491B596009FEEA8 /* 19.png in Resources */ = {isa = PBXBuildFile; fileRef = 057947EF2491B596009FEEA8 /* 19.png */; };
3535
0579483A2491B596009FEEA8 /* 4.png in Resources */ = {isa = PBXBuildFile; fileRef = 057947F02491B596009FEEA8 /* 4.png */; };
3636
0579483B2491B596009FEEA8 /* 5.png in Resources */ = {isa = PBXBuildFile; fileRef = 057947F12491B596009FEEA8 /* 5.png */; };
37-
0579483C2491B596009FEEA8 /* 7.png in Resources */ = {isa = PBXBuildFile; fileRef = 057947F22491B596009FEEA8 /* 7.png */; };
3837
0579483D2491B596009FEEA8 /* 6.png in Resources */ = {isa = PBXBuildFile; fileRef = 057947F32491B596009FEEA8 /* 6.png */; };
3938
0579483E2491B596009FEEA8 /* 2.png in Resources */ = {isa = PBXBuildFile; fileRef = 057947F42491B596009FEEA8 /* 2.png */; };
4039
0579483F2491B596009FEEA8 /* 3.png in Resources */ = {isa = PBXBuildFile; fileRef = 057947F52491B596009FEEA8 /* 3.png */; };
@@ -110,7 +109,6 @@
110109
057947EF2491B596009FEEA8 /* 19.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 19.png; sourceTree = "<group>"; };
111110
057947F02491B596009FEEA8 /* 4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 4.png; sourceTree = "<group>"; };
112111
057947F12491B596009FEEA8 /* 5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 5.png; sourceTree = "<group>"; };
113-
057947F22491B596009FEEA8 /* 7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 7.png; sourceTree = "<group>"; };
114112
057947F32491B596009FEEA8 /* 6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 6.png; sourceTree = "<group>"; };
115113
057947F42491B596009FEEA8 /* 2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 2.png; sourceTree = "<group>"; };
116114
057947F52491B596009FEEA8 /* 3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 3.png; sourceTree = "<group>"; };
@@ -197,8 +195,8 @@
197195
057947D32491B596009FEEA8 /* AppDelegate */ = {
198196
isa = PBXGroup;
199197
children = (
200-
057947D42491B596009FEEA8 /* AppDelegate.h */,
201198
057947D52491B596009FEEA8 /* main.m */,
199+
057947D42491B596009FEEA8 /* AppDelegate.h */,
202200
057947D62491B596009FEEA8 /* AppDelegate.m */,
203201
);
204202
path = AppDelegate;
@@ -241,7 +239,6 @@
241239
057947EF2491B596009FEEA8 /* 19.png */,
242240
057947F02491B596009FEEA8 /* 4.png */,
243241
057947F12491B596009FEEA8 /* 5.png */,
244-
057947F22491B596009FEEA8 /* 7.png */,
245242
057947F32491B596009FEEA8 /* 6.png */,
246243
057947F42491B596009FEEA8 /* 2.png */,
247244
057947F52491B596009FEEA8 /* 3.png */,
@@ -272,9 +269,9 @@
272269
isa = PBXGroup;
273270
children = (
274271
057947FB2491B596009FEEA8 /* Test */,
272+
057948062491B596009FEEA8 /* BMHomeVC.h */,
275273
057948042491B596009FEEA8 /* BMHomeVC.m */,
276274
057948052491B596009FEEA8 /* BMHomeVC.xib */,
277-
057948062491B596009FEEA8 /* BMHomeVC.h */,
278275
);
279276
path = Controller;
280277
sourceTree = "<group>";
@@ -614,7 +611,6 @@
614611
057948392491B596009FEEA8 /* 19.png in Resources */,
615612
6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
616613
0579484D2491B596009FEEA8 /* BMCell.xib in Resources */,
617-
0579483C2491B596009FEEA8 /* 7.png in Resources */,
618614
6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
619615
0579482C2491B596009FEEA8 /* 13.png in Resources */,
620616
);

Example/UITableViewDynamicLayoutCacheHeight/Classes/Controller/BMHomeVC.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa
6767
// 同 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 一样
6868
cell.model = self.dataArray[indexPath.section].modelArray[indexPath.row];
6969
}];
70+
// return [tableView bm_heightWithCellClass:BMCell.class cacheByKey:indexPath.description configuration:^(__kindof BMCell *cell) {
71+
// cell.model = self.dataArray[indexPath.section].modelArray[indexPath.row];
72+
// }];
7073
}
7174

7275
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-12.4 KB
Binary file not shown.

UITableViewDynamicLayoutCacheHeight.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'UITableViewDynamicLayoutCacheHeight'
3-
s.version = '5.0.9'
3+
s.version = '5.1.0'
44
s.summary = '🖖 Template auto layout cell for automatically UITableViewCell UITableViewHeaderFooterView calculating and cache height framework.'
55
s.homepage = 'https://github.com/liangdahong/UITableViewDynamicLayoutCacheHeight'
66
s.license = 'MIT'

UITableViewDynamicLayoutCacheHeight/Classes/UITableView+BMDynamicLayout.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,9 @@ - (CGFloat)_heightWithFooterViewClass:(Class)clas
263263

264264
- (CGFloat)bm_heightWithCellClass:(Class)clas
265265
configuration:(BMConfigurationCellBlock)configuration {
266+
if (__builtin_expect((!self.isDynamicLayoutInitializationed), 0)) {
267+
[self bm_dynamicLayoutInitialization];
268+
}
266269
return [self _heightWithCellClass:clas configuration:configuration];
267270
}
268271

@@ -296,6 +299,9 @@ - (CGFloat)bm_heightWithCellClass:(Class)clas
296299
- (CGFloat)bm_heightWithCellClass:(Class)clas
297300
cacheByKey:(id<NSCopying>)key
298301
configuration:(BMConfigurationCellBlock)configuration {
302+
if (__builtin_expect((!self.isDynamicLayoutInitializationed), 0)) {
303+
[self bm_dynamicLayoutInitialization];
304+
}
299305
if (key && self.heightDictionary[key]) {
300306
BM_UITableView_DynamicLayout_LOG(@"BMLog:✅✅读缓存✅✅Cell: %@ get cache height { (key: %@) (height: %@) }", NSStringFromClass(clas), key, self.heightDictionary[key]);
301307
return self.heightDictionary[key].doubleValue;
@@ -313,6 +319,9 @@ - (CGFloat)bm_heightWithCellClass:(Class)clas
313319
- (CGFloat)bm_heightWithHeaderFooterViewClass:(Class)clas
314320
type:(BMHeaderFooterViewDynamicLayoutType)type
315321
configuration:(BMConfigurationHeaderFooterViewBlock)configuration {
322+
if (__builtin_expect((!self.isDynamicLayoutInitializationed), 0)) {
323+
[self bm_dynamicLayoutInitialization];
324+
}
316325
if (type == BMHeaderFooterViewDynamicLayoutTypeHeader) {
317326
return [self _heightWithHeaderViewClass:clas configuration:configuration];
318327
}
@@ -358,6 +367,9 @@ - (CGFloat)bm_heightWithHeaderFooterViewClass:(Class)clas
358367
type:(BMHeaderFooterViewDynamicLayoutType)type
359368
cacheByKey:(id<NSCopying>)key
360369
configuration:(BMConfigurationHeaderFooterViewBlock)configuration {
370+
if (__builtin_expect((!self.isDynamicLayoutInitializationed), 0)) {
371+
[self bm_dynamicLayoutInitialization];
372+
}
361373
if (type == BMHeaderFooterViewDynamicLayoutTypeHeader) {
362374
if (key && self.headerHeightDictionary[key]) {
363375
BM_UITableView_DynamicLayout_LOG(@"BMLog:✅✅读缓存✅✅ Header: %@ get cache height { (key: %@) (height: %@) }", NSStringFromClass(clas), key, self.headerHeightDictionary[key]);

UITableViewDynamicLayoutCacheHeight/Classes/UITableViewDynamicLayoutCacheHeight.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// SOFTWARE.
2222

2323
////////////////
24-
/// v5.0.9
24+
/// v5.1.0
2525
////////////////
2626

2727
#ifndef UITableViewDynamicLayoutCacheHeight_h

0 commit comments

Comments
 (0)