-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSStickyHeaderLayoutGuide.h
More file actions
54 lines (38 loc) · 1.84 KB
/
CSStickyHeaderLayoutGuide.h
File metadata and controls
54 lines (38 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// CSStickyHeaderLayoutGuide.h
// CSStickyHeaderFlowLayoutDemo
//
// Created by James Tang on 19/7/15.
// Copyright (c) 2015 Jamz Tang. All rights reserved.
//
// Testable object behind CSStickyHeaderFlowLayout
#import <Foundation/Foundation.h>
@import QuartzCore;
typedef NS_ENUM(NSInteger, CSStickyHeaderLayoutDirection) {
CSStickyHeaderLayoutDirectionVertical,
};
typedef struct CSEdgeInsets {
CGFloat top, left, bottom, right; // specify amount to inset (positive) for each of the edges. values can be negative to 'outset'
} CSEdgeInsets;
static inline NSString * __nonnull NSStringFromCSEdgeInsets(CSEdgeInsets insets) {
return [NSString stringWithFormat:@"{%@, %@, %@, %@}", @(insets.top), @(insets.left), @(insets.bottom), @(insets.right)];
}
typedef CGSize(^CSStickyHeaderLayoutSizeHandler)(void);
@interface CSStickyHeaderLayoutItem : NSObject
@property (nonatomic, copy, nullable) CSStickyHeaderLayoutSizeHandler sizeHandler;
+ (nonnull instancetype)itemWithSizeHandler:(__nullable CSStickyHeaderLayoutSizeHandler)handler;
@end
@interface CSStickyHeaderLayoutGuide : NSObject
@property (nonatomic) CGFloat minimumLineSpacing;
@property (nonatomic) CGFloat minimumInteritemSpacing;
@property (nonatomic) CGSize itemSize; // If items.size is specified, then itemSize will be ignored
@property (nonatomic) CSStickyHeaderLayoutDirection scrollDirection; // default is CSStickyHeaderLayoutDirectionVertical
@property (nonatomic) CGSize headerReferenceSize;
@property (nonatomic) CGSize footerReferenceSize;
@property (nonatomic) CSEdgeInsets sectionInset;
@property (nonatomic) CGSize parallaxHeaderReferenceSize;
@property (nonatomic) CGSize parallaxHeaderMinimumReferenceSize;
@property (nonatomic) BOOL parallaxHeaderAlwaysOnTop;
@property (nonatomic) BOOL disableStickyHeaders;
@property (nonatomic, copy, nonnull) NSArray *items;
@end