Skip to content

Commit 676d290

Browse files
author
Bluelich
committed
update example project
1 parent a68dd41 commit 676d290

File tree

8 files changed

+543
-227
lines changed

8 files changed

+543
-227
lines changed

BLCollectionViewTagLayout/Classes/BLCollectionViewTagLayout.h

+14-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ typedef NS_ENUM (NSUInteger, BLCollectionViewTagLayoutItemRenderPolicy) {
1313
BLCollectionViewTagLayoutItemRenderDefault = 0,//place section items one by one in order
1414
BLCollectionViewTagLayoutItemRenderShortestFirst = 1,//place item to shortest row each time
1515
BLCollectionViewTagLayoutItemRenderFullFill = 2,//place item to full fill rows of each section, current unsupported
16+
BLCollectionViewTagLayoutItemRenderCustom = 3,//place item use custom algorithm
1617
};
1718

1819
#pragma mark - UICollectionViewTagStyleLayout
@@ -41,9 +42,18 @@ IB_DESIGNABLE NS_CLASS_AVAILABLE_IOS(8_0)
4142
@property (nonatomic) CGSize footerReferenceSize;
4243
/*
4344
* The default edge insets are all set to 0.
44-
* It does not affect header footer,but for section items similar as UICollectionViewFlowLayout,
45+
*
46+
* It does not affect header footer,but for section items similar as UICollectionViewFlowLayout.
4547
*/
4648
@property (nonatomic) UIEdgeInsets sectionInset;
49+
/*
50+
* The default value is CGFLOAT_MAX
51+
*
52+
* You can specify the value for section items height limitation.
53+
*
54+
* Note : This value is the height of the section elements,except the header footer and section inset.
55+
*/
56+
@property (nonatomic) CGFloat maximumSectionHeight;
4757
/*
4858
* The default is UICollectionViewScrollDirectionVertical.
4959
*
@@ -71,7 +81,7 @@ IB_DESIGNABLE NS_CLASS_AVAILABLE_IOS(8_0)
7181
* As usual, you don't need to care about this,the layout will fill in it automatically.
7282
*
7383
* Before iOS 11, if you want to pin header or footer of sections to visible bounds,
74-
* and you need to modify the scrollIndicatorInsets of the collectionView, you need to set the
84+
* and you want to modify the scrollIndicatorInsets of the collectionView, you need to set the
7585
* correct value on this property,otherwise it will cause abnormal sense during displaying.
7686
*
7787
* Note :
@@ -94,7 +104,6 @@ IB_DESIGNABLE NS_CLASS_AVAILABLE_IOS(8_0)
94104
tabbar:(UITabBar *)tabbar;
95105
@end
96106

97-
@class BLCollectionViewTagLayout;
98107
@protocol BLCollectionViewDelegateTagStyleLayout <UICollectionViewDelegate>
99108

100109
@optional
@@ -103,9 +112,10 @@ IB_DESIGNABLE NS_CLASS_AVAILABLE_IOS(8_0)
103112
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(BLCollectionViewTagLayout *)collectionViewLayout insetForSection:(NSInteger)section;
104113
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(BLCollectionViewTagLayout *)collectionViewLayout minimumLineSpacingForSection:(NSInteger)section;
105114
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(BLCollectionViewTagLayout *)collectionViewLayout minimumInteritemSpacingForSection:(NSInteger)section;
115+
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(BLCollectionViewTagLayout *)collectionViewLayout maximumHeightForSection:(NSInteger)section;
106116
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(BLCollectionViewTagLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;
107117
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(BLCollectionViewTagLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section;
108-
118+
- (NSArray<UICollectionViewLayoutAttributes *> *)collectionView:(UICollectionView *)collectionView layout:(BLCollectionViewTagLayout *)collectionViewLayout attributesInSection:(NSInteger)section boundingRect:(CGRect )boundingRect;
109119
@end
110120

111121

BLCollectionViewTagLayout/Classes/BLCollectionViewTagLayout.m

+187-155
Large diffs are not rendered by default.

Example/BLCollectionViewTagLayout.xcodeproj/project.pbxproj

+6-12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
/* Begin PBXBuildFile section */
1010
0BA06DB8DC833ECAD8396010 /* libPods-BLCollectionViewTagLayout_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D568B1745490846CFB28FBA /* libPods-BLCollectionViewTagLayout_Example.a */; };
11+
2A2859F624A47DCA00F5D9C6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A2859F524A47DCA00F5D9C6 /* LaunchScreen.storyboard */; };
12+
2A2859F724A47DCA00F5D9C6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A2859F524A47DCA00F5D9C6 /* LaunchScreen.storyboard */; };
1113
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
1214
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
1315
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
@@ -21,7 +23,6 @@
2123
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
2224
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
2325
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
24-
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; };
2526
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
2627
E1E35F967E399D1F14246145 /* libPods-BLCollectionViewTagLayout_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F7A75B65788E8BC731E3736 /* libPods-BLCollectionViewTagLayout_Tests.a */; };
2728
/* End PBXBuildFile section */
@@ -39,6 +40,7 @@
3940
/* Begin PBXFileReference section */
4041
0B0AD7539645588CA940580A /* Pods-BLCollectionViewTagLayout_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BLCollectionViewTagLayout_Example.debug.xcconfig"; path = "Target Support Files/Pods-BLCollectionViewTagLayout_Example/Pods-BLCollectionViewTagLayout_Example.debug.xcconfig"; sourceTree = "<group>"; };
4142
286C9A21BB5950F471C3E16C /* Pods-BLCollectionViewTagLayout_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BLCollectionViewTagLayout_Tests.debug.xcconfig"; path = "Target Support Files/Pods-BLCollectionViewTagLayout_Tests/Pods-BLCollectionViewTagLayout_Tests.debug.xcconfig"; sourceTree = "<group>"; };
43+
2A2859F524A47DCA00F5D9C6 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
4244
45784628346B009EFD4473F9 /* Pods-BLCollectionViewTagLayout_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BLCollectionViewTagLayout_Tests.release.xcconfig"; path = "Target Support Files/Pods-BLCollectionViewTagLayout_Tests/Pods-BLCollectionViewTagLayout_Tests.release.xcconfig"; sourceTree = "<group>"; };
4345
5439692191B07D9E5683DBDC /* Pods-BLCollectionViewTagLayout_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BLCollectionViewTagLayout_Example.release.xcconfig"; path = "Target Support Files/Pods-BLCollectionViewTagLayout_Example/Pods-BLCollectionViewTagLayout_Example.release.xcconfig"; sourceTree = "<group>"; };
4446
6003F58A195388D20070C39A /* BLCollectionViewTagLayout_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BLCollectionViewTagLayout_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -60,7 +62,6 @@
6062
6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6163
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
6264
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
63-
71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6465
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
6566
8D568B1745490846CFB28FBA /* libPods-BLCollectionViewTagLayout_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BLCollectionViewTagLayout_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6667
8F7A75B65788E8BC731E3736 /* libPods-BLCollectionViewTagLayout_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BLCollectionViewTagLayout_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -137,7 +138,7 @@
137138
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
138139
6003F5A5195388D20070C39A /* BLViewController.h */,
139140
6003F5A6195388D20070C39A /* BLViewController.m */,
140-
71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */,
141+
2A2859F524A47DCA00F5D9C6 /* LaunchScreen.storyboard */,
141142
6003F5A8195388D20070C39A /* Images.xcassets */,
142143
6003F594195388D20070C39A /* Supporting Files */,
143144
);
@@ -276,7 +277,7 @@
276277
buildActionMask = 2147483647;
277278
files = (
278279
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
279-
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
280+
2A2859F624A47DCA00F5D9C6 /* LaunchScreen.storyboard in Resources */,
280281
6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
281282
6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
282283
);
@@ -287,6 +288,7 @@
287288
buildActionMask = 2147483647;
288289
files = (
289290
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */,
291+
2A2859F724A47DCA00F5D9C6 /* LaunchScreen.storyboard in Resources */,
290292
);
291293
runOnlyForDeploymentPostprocessing = 0;
292294
};
@@ -385,14 +387,6 @@
385387
name = InfoPlist.strings;
386388
sourceTree = "<group>";
387389
};
388-
71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = {
389-
isa = PBXVariantGroup;
390-
children = (
391-
71719F9E1E33DC2100824A3D /* Base */,
392-
);
393-
name = LaunchScreen.storyboard;
394-
sourceTree = "<group>";
395-
};
396390
/* End PBXVariantGroup section */
397391

398392
/* Begin XCBuildConfiguration section */

Example/BLCollectionViewTagLayout/BLAppDelegate.m

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ @implementation BLAppDelegate
1313
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
1414
{
1515
// Override point for customization after application launch.
16+
self.window.backgroundColor = UIColor.whiteColor;
1617
return YES;
1718
}
1819

0 commit comments

Comments
 (0)