Skip to content

Commit a68dd41

Browse files
author
Bluelich
committed
bug fixed (position of header for section zero error)
1 parent aa000f6 commit a68dd41

File tree

18 files changed

+523
-425
lines changed

18 files changed

+523
-425
lines changed

BLCollectionViewTagLayout.podspec

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'BLCollectionViewTagLayout'
11-
s.version = '0.1.0'
11+
s.version = '0.2.0'
1212
s.summary = 'A short description of BLCollectionViewTagLayout.'
1313

1414
# This description is used to generate tags and improve search results.
@@ -18,7 +18,8 @@ Pod::Spec.new do |s|
1818
# * Finally, don't worry about the indent, CocoaPods strips it!
1919

2020
s.description = <<-DESC
21-
TODO: Add long description of the pod here.
21+
Tag style layout for UICollectionView.
22+
As a special feature, this layout support pin section headers and footers to visible bounds dynamically.
2223
DESC
2324

2425
s.homepage = 'https://github.com/bluelich/BLCollectionViewTagLayout'

BLCollectionViewTagLayout/Classes/BLCollectionViewTagLayout.m

+1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ - (void)updateAttributesForPinSectionHeaderFootersToVisibleBounds:(CGRect)newBou
309309
[self layoutAttributesForSupplementaryViewOfKind:UICollectionElementKindSectionFooter
310310
atIndexPath:header.indexPath];
311311
frame.origin.y = MIN(frame.origin.y, CGRectGetMinY(footer.frame) - CGRectGetHeight(header.frame));
312+
frame.origin.y = MAX(0, frame.origin.y);
312313
header.frame = frame;
313314
}
314315
if(sectionFootersShouldPinToVisibleBounds){

Example/BLCollectionViewTagLayout.xcodeproj/project.pbxproj

+40-32
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
0BA06DB8DC833ECAD8396010 /* libPods-BLCollectionViewTagLayout_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D568B1745490846CFB28FBA /* libPods-BLCollectionViewTagLayout_Example.a */; };
1011
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
1112
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
1213
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
@@ -22,8 +23,7 @@
2223
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
2324
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; };
2425
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
25-
AB65285FDEB7E3FF98D221B9 /* Pods_BLCollectionViewTagLayout_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC75991E0AB1CA1E2538A91E /* Pods_BLCollectionViewTagLayout_Tests.framework */; };
26-
F08E8AFD708209E62548E79D /* Pods_BLCollectionViewTagLayout_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A1B0D3BD0DC3E7903655CD3 /* Pods_BLCollectionViewTagLayout_Example.framework */; };
26+
E1E35F967E399D1F14246145 /* libPods-BLCollectionViewTagLayout_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F7A75B65788E8BC731E3736 /* libPods-BLCollectionViewTagLayout_Tests.a */; };
2727
/* End PBXBuildFile section */
2828

2929
/* Begin PBXContainerItemProxy section */
@@ -39,7 +39,6 @@
3939
/* Begin PBXFileReference section */
4040
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>"; };
4141
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>"; };
42-
3A1B0D3BD0DC3E7903655CD3 /* Pods_BLCollectionViewTagLayout_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BLCollectionViewTagLayout_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4342
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>"; };
4443
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>"; };
4544
6003F58A195388D20070C39A /* BLCollectionViewTagLayout_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BLCollectionViewTagLayout_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -63,9 +62,10 @@
6362
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
6463
71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6564
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
65+
8D568B1745490846CFB28FBA /* libPods-BLCollectionViewTagLayout_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BLCollectionViewTagLayout_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
66+
8F7A75B65788E8BC731E3736 /* libPods-BLCollectionViewTagLayout_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BLCollectionViewTagLayout_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6667
981E1B0544FCE803350F31D8 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
6768
A273CC17724A1219F83EF04A /* BLCollectionViewTagLayout.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = BLCollectionViewTagLayout.podspec; path = ../BLCollectionViewTagLayout.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
68-
CC75991E0AB1CA1E2538A91E /* Pods_BLCollectionViewTagLayout_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BLCollectionViewTagLayout_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6969
E2D88416B19CFEEC6E27EB29 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
7070
/* End PBXFileReference section */
7171

@@ -77,7 +77,7 @@
7777
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
7878
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
7979
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
80-
F08E8AFD708209E62548E79D /* Pods_BLCollectionViewTagLayout_Example.framework in Frameworks */,
80+
0BA06DB8DC833ECAD8396010 /* libPods-BLCollectionViewTagLayout_Example.a in Frameworks */,
8181
);
8282
runOnlyForDeploymentPostprocessing = 0;
8383
};
@@ -88,7 +88,7 @@
8888
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
8989
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
9090
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
91-
AB65285FDEB7E3FF98D221B9 /* Pods_BLCollectionViewTagLayout_Tests.framework in Frameworks */,
91+
E1E35F967E399D1F14246145 /* libPods-BLCollectionViewTagLayout_Tests.a in Frameworks */,
9292
);
9393
runOnlyForDeploymentPostprocessing = 0;
9494
};
@@ -123,8 +123,8 @@
123123
6003F58F195388D20070C39A /* CoreGraphics.framework */,
124124
6003F591195388D20070C39A /* UIKit.framework */,
125125
6003F5AF195388D20070C39A /* XCTest.framework */,
126-
3A1B0D3BD0DC3E7903655CD3 /* Pods_BLCollectionViewTagLayout_Example.framework */,
127-
CC75991E0AB1CA1E2538A91E /* Pods_BLCollectionViewTagLayout_Tests.framework */,
126+
8D568B1745490846CFB28FBA /* libPods-BLCollectionViewTagLayout_Example.a */,
127+
8F7A75B65788E8BC731E3736 /* libPods-BLCollectionViewTagLayout_Tests.a */,
128128
);
129129
name = Frameworks;
130130
sourceTree = "<group>";
@@ -207,7 +207,6 @@
207207
6003F586195388D20070C39A /* Sources */,
208208
6003F587195388D20070C39A /* Frameworks */,
209209
6003F588195388D20070C39A /* Resources */,
210-
6CA87E3439F60C14F2AB4491 /* [CP] Embed Pods Frameworks */,
211210
);
212211
buildRules = (
213212
);
@@ -244,7 +243,7 @@
244243
isa = PBXProject;
245244
attributes = {
246245
CLASSPREFIX = BL;
247-
LastUpgradeCheck = 0720;
246+
LastUpgradeCheck = 1030;
248247
ORGANIZATIONNAME = bluelich;
249248
TargetAttributes = {
250249
6003F5AD195388D20070C39A = {
@@ -254,10 +253,9 @@
254253
};
255254
buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "BLCollectionViewTagLayout" */;
256255
compatibilityVersion = "Xcode 3.2";
257-
developmentRegion = English;
256+
developmentRegion = en;
258257
hasScannedForEncodings = 0;
259258
knownRegions = (
260-
English,
261259
en,
262260
Base,
263261
);
@@ -295,24 +293,6 @@
295293
/* End PBXResourcesBuildPhase section */
296294

297295
/* Begin PBXShellScriptBuildPhase section */
298-
6CA87E3439F60C14F2AB4491 /* [CP] Embed Pods Frameworks */ = {
299-
isa = PBXShellScriptBuildPhase;
300-
buildActionMask = 2147483647;
301-
files = (
302-
);
303-
inputPaths = (
304-
"${PODS_ROOT}/Target Support Files/Pods-BLCollectionViewTagLayout_Example/Pods-BLCollectionViewTagLayout_Example-frameworks.sh",
305-
"${BUILT_PRODUCTS_DIR}/BLCollectionViewTagLayout/BLCollectionViewTagLayout.framework",
306-
);
307-
name = "[CP] Embed Pods Frameworks";
308-
outputPaths = (
309-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BLCollectionViewTagLayout.framework",
310-
);
311-
runOnlyForDeploymentPostprocessing = 0;
312-
shellPath = /bin/sh;
313-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BLCollectionViewTagLayout_Example/Pods-BLCollectionViewTagLayout_Example-frameworks.sh\"\n";
314-
showEnvVarsInLog = 0;
315-
};
316296
8A6A42C80F24A2B9BA940D22 /* [CP] Check Pods Manifest.lock */ = {
317297
isa = PBXShellScriptBuildPhase;
318298
buildActionMask = 2147483647;
@@ -424,19 +404,32 @@
424404
CLANG_CXX_LIBRARY = "libc++";
425405
CLANG_ENABLE_MODULES = YES;
426406
CLANG_ENABLE_OBJC_ARC = YES;
407+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
427408
CLANG_WARN_BOOL_CONVERSION = YES;
409+
CLANG_WARN_COMMA = YES;
428410
CLANG_WARN_CONSTANT_CONVERSION = YES;
411+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
429412
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
430413
CLANG_WARN_EMPTY_BODY = YES;
431414
CLANG_WARN_ENUM_CONVERSION = YES;
415+
CLANG_WARN_INFINITE_RECURSION = YES;
432416
CLANG_WARN_INT_CONVERSION = YES;
417+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
418+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
419+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
433420
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
421+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
422+
CLANG_WARN_STRICT_PROTOTYPES = YES;
423+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
424+
CLANG_WARN_UNREACHABLE_CODE = YES;
434425
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
435426
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
436427
COPY_PHASE_STRIP = NO;
428+
ENABLE_STRICT_OBJC_MSGSEND = YES;
437429
ENABLE_TESTABILITY = YES;
438430
GCC_C_LANGUAGE_STANDARD = gnu99;
439431
GCC_DYNAMIC_NO_PIC = NO;
432+
GCC_NO_COMMON_BLOCKS = YES;
440433
GCC_OPTIMIZATION_LEVEL = 0;
441434
GCC_PREPROCESSOR_DEFINITIONS = (
442435
"DEBUG=1",
@@ -449,7 +442,7 @@
449442
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
450443
GCC_WARN_UNUSED_FUNCTION = YES;
451444
GCC_WARN_UNUSED_VARIABLE = YES;
452-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
445+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
453446
ONLY_ACTIVE_ARCH = YES;
454447
SDKROOT = iphoneos;
455448
TARGETED_DEVICE_FAMILY = "1,2";
@@ -464,25 +457,38 @@
464457
CLANG_CXX_LIBRARY = "libc++";
465458
CLANG_ENABLE_MODULES = YES;
466459
CLANG_ENABLE_OBJC_ARC = YES;
460+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
467461
CLANG_WARN_BOOL_CONVERSION = YES;
462+
CLANG_WARN_COMMA = YES;
468463
CLANG_WARN_CONSTANT_CONVERSION = YES;
464+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
469465
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
470466
CLANG_WARN_EMPTY_BODY = YES;
471467
CLANG_WARN_ENUM_CONVERSION = YES;
468+
CLANG_WARN_INFINITE_RECURSION = YES;
472469
CLANG_WARN_INT_CONVERSION = YES;
470+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
471+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
472+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
473473
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
474+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
475+
CLANG_WARN_STRICT_PROTOTYPES = YES;
476+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
477+
CLANG_WARN_UNREACHABLE_CODE = YES;
474478
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
475479
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
476480
COPY_PHASE_STRIP = YES;
477481
ENABLE_NS_ASSERTIONS = NO;
482+
ENABLE_STRICT_OBJC_MSGSEND = YES;
478483
GCC_C_LANGUAGE_STANDARD = gnu99;
484+
GCC_NO_COMMON_BLOCKS = YES;
479485
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
480486
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
481487
GCC_WARN_UNDECLARED_SELECTOR = YES;
482488
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
483489
GCC_WARN_UNUSED_FUNCTION = YES;
484490
GCC_WARN_UNUSED_VARIABLE = YES;
485-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
491+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
486492
SDKROOT = iphoneos;
487493
TARGETED_DEVICE_FAMILY = "1,2";
488494
VALIDATE_PRODUCT = YES;
@@ -497,6 +503,7 @@
497503
GCC_PRECOMPILE_PREFIX_HEADER = YES;
498504
GCC_PREFIX_HEADER = "BLCollectionViewTagLayout/BLCollectionViewTagLayout-Prefix.pch";
499505
INFOPLIST_FILE = "BLCollectionViewTagLayout/BLCollectionViewTagLayout-Info.plist";
506+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
500507
MODULE_NAME = ExampleApp;
501508
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
502509
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -513,6 +520,7 @@
513520
GCC_PRECOMPILE_PREFIX_HEADER = YES;
514521
GCC_PREFIX_HEADER = "BLCollectionViewTagLayout/BLCollectionViewTagLayout-Prefix.pch";
515522
INFOPLIST_FILE = "BLCollectionViewTagLayout/BLCollectionViewTagLayout-Info.plist";
523+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
516524
MODULE_NAME = ExampleApp;
517525
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
518526
PRODUCT_NAME = "$(TARGET_NAME)";

Example/BLCollectionViewTagLayout.xcodeproj/xcshareddata/xcschemes/BLCollectionViewTagLayout-Example.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0720"
3+
LastUpgradeVersion = "1030"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Example/BLCollectionViewTagLayout/BLCollectionViewTagLayout-Info.plist

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@
3232
<array>
3333
<string>armv7</string>
3434
</array>
35+
<key>UIRequiresFullScreen</key>
36+
<false/>
37+
<key>UIStatusBarHidden</key>
38+
<false/>
3539
<key>UISupportedInterfaceOrientations</key>
3640
<array>
37-
<string>UIInterfaceOrientationPortrait</string>
3841
<string>UIInterfaceOrientationLandscapeLeft</string>
3942
<string>UIInterfaceOrientationLandscapeRight</string>
43+
<string>UIInterfaceOrientationPortrait</string>
4044
</array>
4145
<key>UISupportedInterfaceOrientations~ipad</key>
4246
<array>

0 commit comments

Comments
 (0)