Repository: CoderFM/FMCollectionLayout
Branch: master
Commit: 312f97d176cc
Files: 261
Total size: 670.7 KB
Directory structure:
gitextract_jeq_n4qo/
├── .gitignore
├── .travis.yml
├── Example/
│ ├── FMLayoutKit/
│ │ ├── Base.lproj/
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── FMAddViewController.h
│ │ ├── FMAddViewController.m
│ │ ├── FMAotuSizeReusableView.h
│ │ ├── FMAotuSizeReusableView.m
│ │ ├── FMAppDelegate.h
│ │ ├── FMAppDelegate.m
│ │ ├── FMCollViewController.h
│ │ ├── FMCollViewController.m
│ │ ├── FMCollectionCustomCell.h
│ │ ├── FMCollectionCustomCell.m
│ │ ├── FMCollectionCustomDecoration.h
│ │ ├── FMCollectionCustomDecoration.m
│ │ ├── FMCollectionNavTitleView.h
│ │ ├── FMCollectionNavTitleView.m
│ │ ├── FMCollectionViewCell.h
│ │ ├── FMCollectionViewCell.m
│ │ ├── FMCollectionViewCell.xib
│ │ ├── FMCombineViewController.h
│ │ ├── FMCombineViewController.m
│ │ ├── FMExcuteTimeTool.h
│ │ ├── FMExcuteTimeTool.m
│ │ ├── FMFPSLabel.h
│ │ ├── FMFPSLabel.m
│ │ ├── FMHorizontalLayoutController.h
│ │ ├── FMHorizontalLayoutController.m
│ │ ├── FMLayoutKit-Info.plist
│ │ ├── FMLayoutKit-Prefix.pch
│ │ ├── FMLayoutLabel.h
│ │ ├── FMLayoutLabel.m
│ │ ├── FMViewController.h
│ │ ├── FMViewController.m
│ │ ├── Images.xcassets/
│ │ │ ├── AppIcon.appiconset/
│ │ │ │ └── Contents.json
│ │ │ ├── Contents.json
│ │ │ └── timg.imageset/
│ │ │ └── Contents.json
│ │ ├── LS_HomeActivityCell.h
│ │ ├── LS_HomeActivityCell.m
│ │ ├── en.lproj/
│ │ │ └── InfoPlist.strings
│ │ └── main.m
│ ├── FMLayoutKit.xcodeproj/
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace/
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── xcschemes/
│ │ └── FMLayoutKit-Example.xcscheme
│ ├── FMLayoutKit.xcworkspace/
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── IDEWorkspaceChecks.plist
│ ├── FMLayoutKitFramework/
│ │ └── FMLayoutKit.framework/
│ │ ├── FMLayoutKit
│ │ ├── Headers/
│ │ │ ├── FMCollectionLayoutAttributes.h
│ │ │ ├── FMCollectionViewDelegateDataSourceProvider.h
│ │ │ ├── FMKVOArrayObject.h
│ │ │ ├── FMLayout.h
│ │ │ ├── FMLayoutAbsoluteSection.h
│ │ │ ├── FMLayoutBackground.h
│ │ │ ├── FMLayoutBaseSection.h
│ │ │ ├── FMLayoutCombineSection.h
│ │ │ ├── FMLayoutCrossSection.h
│ │ │ ├── FMLayoutCrossTransformSection.h
│ │ │ ├── FMLayoutDebugLog.h
│ │ │ ├── FMLayoutDynamicSection.h
│ │ │ ├── FMLayoutElement.h
│ │ │ ├── FMLayoutFillSection.h
│ │ │ ├── FMLayoutFixedSection.h
│ │ │ ├── FMLayoutFooter.h
│ │ │ ├── FMLayoutHeader.h
│ │ │ ├── FMLayoutKit-umbrella.h
│ │ │ ├── FMLayoutKit.h
│ │ │ ├── FMLayoutLabelSection.h
│ │ │ ├── FMLayoutScaleSection.h
│ │ │ ├── FMLayoutView.h
│ │ │ ├── FMSupplementary.h
│ │ │ ├── FMTeslaLayoutView.h
│ │ │ └── FMTeslaSuspensionHeightChangeDelegate.h
│ │ ├── Info.plist
│ │ ├── Modules/
│ │ │ └── module.modulemap
│ │ └── _CodeSignature/
│ │ └── CodeResources
│ ├── FrameworkTmp/
│ │ ├── Release-iphoneos/
│ │ │ └── FMLayoutKit/
│ │ │ ├── FMLayoutKit.framework/
│ │ │ │ ├── FMLayoutKit
│ │ │ │ ├── Headers/
│ │ │ │ │ ├── FMCollectionLayoutAttributes.h
│ │ │ │ │ ├── FMCollectionViewDelegateDataSourceProvider.h
│ │ │ │ │ ├── FMKVOArrayObject.h
│ │ │ │ │ ├── FMLayout.h
│ │ │ │ │ ├── FMLayoutAbsoluteSection.h
│ │ │ │ │ ├── FMLayoutBackground.h
│ │ │ │ │ ├── FMLayoutBaseSection.h
│ │ │ │ │ ├── FMLayoutCombineSection.h
│ │ │ │ │ ├── FMLayoutCrossSection.h
│ │ │ │ │ ├── FMLayoutCrossTransformSection.h
│ │ │ │ │ ├── FMLayoutDebugLog.h
│ │ │ │ │ ├── FMLayoutDynamicSection.h
│ │ │ │ │ ├── FMLayoutElement.h
│ │ │ │ │ ├── FMLayoutFillSection.h
│ │ │ │ │ ├── FMLayoutFixedSection.h
│ │ │ │ │ ├── FMLayoutFooter.h
│ │ │ │ │ ├── FMLayoutHeader.h
│ │ │ │ │ ├── FMLayoutKit-umbrella.h
│ │ │ │ │ ├── FMLayoutKit.h
│ │ │ │ │ ├── FMLayoutLabelSection.h
│ │ │ │ │ ├── FMLayoutScaleSection.h
│ │ │ │ │ ├── FMLayoutView.h
│ │ │ │ │ ├── FMSupplementary.h
│ │ │ │ │ ├── FMTeslaLayoutView.h
│ │ │ │ │ └── FMTeslaSuspensionHeightChangeDelegate.h
│ │ │ │ ├── Info.plist
│ │ │ │ └── Modules/
│ │ │ │ └── module.modulemap
│ │ │ └── FMLayoutKit.framework.dSYM/
│ │ │ └── Contents/
│ │ │ ├── Info.plist
│ │ │ └── Resources/
│ │ │ └── DWARF/
│ │ │ └── FMLayoutKit
│ │ └── Release-iphonesimulator/
│ │ └── FMLayoutKit/
│ │ ├── FMLayoutKit.framework/
│ │ │ ├── FMLayoutKit
│ │ │ ├── Headers/
│ │ │ │ ├── FMCollectionLayoutAttributes.h
│ │ │ │ ├── FMCollectionViewDelegateDataSourceProvider.h
│ │ │ │ ├── FMKVOArrayObject.h
│ │ │ │ ├── FMLayout.h
│ │ │ │ ├── FMLayoutAbsoluteSection.h
│ │ │ │ ├── FMLayoutBackground.h
│ │ │ │ ├── FMLayoutBaseSection.h
│ │ │ │ ├── FMLayoutCombineSection.h
│ │ │ │ ├── FMLayoutCrossSection.h
│ │ │ │ ├── FMLayoutCrossTransformSection.h
│ │ │ │ ├── FMLayoutDebugLog.h
│ │ │ │ ├── FMLayoutDynamicSection.h
│ │ │ │ ├── FMLayoutElement.h
│ │ │ │ ├── FMLayoutFillSection.h
│ │ │ │ ├── FMLayoutFixedSection.h
│ │ │ │ ├── FMLayoutFooter.h
│ │ │ │ ├── FMLayoutHeader.h
│ │ │ │ ├── FMLayoutKit-umbrella.h
│ │ │ │ ├── FMLayoutKit.h
│ │ │ │ ├── FMLayoutLabelSection.h
│ │ │ │ ├── FMLayoutScaleSection.h
│ │ │ │ ├── FMLayoutView.h
│ │ │ │ ├── FMSupplementary.h
│ │ │ │ ├── FMTeslaLayoutView.h
│ │ │ │ └── FMTeslaSuspensionHeightChangeDelegate.h
│ │ │ ├── Info.plist
│ │ │ ├── Modules/
│ │ │ │ └── module.modulemap
│ │ │ └── _CodeSignature/
│ │ │ └── CodeResources
│ │ └── FMLayoutKit.framework.dSYM/
│ │ └── Contents/
│ │ ├── Info.plist
│ │ └── Resources/
│ │ └── DWARF/
│ │ └── FMLayoutKit
│ ├── Podfile
│ ├── Pods/
│ │ ├── Local Podspecs/
│ │ │ └── FMLayoutKit.podspec.json
│ │ ├── Masonry/
│ │ │ ├── LICENSE
│ │ │ ├── Masonry/
│ │ │ │ ├── MASCompositeConstraint.h
│ │ │ │ ├── MASCompositeConstraint.m
│ │ │ │ ├── MASConstraint+Private.h
│ │ │ │ ├── MASConstraint.h
│ │ │ │ ├── MASConstraint.m
│ │ │ │ ├── MASConstraintMaker.h
│ │ │ │ ├── MASConstraintMaker.m
│ │ │ │ ├── MASLayoutConstraint.h
│ │ │ │ ├── MASLayoutConstraint.m
│ │ │ │ ├── MASUtilities.h
│ │ │ │ ├── MASViewAttribute.h
│ │ │ │ ├── MASViewAttribute.m
│ │ │ │ ├── MASViewConstraint.h
│ │ │ │ ├── MASViewConstraint.m
│ │ │ │ ├── Masonry.h
│ │ │ │ ├── NSArray+MASAdditions.h
│ │ │ │ ├── NSArray+MASAdditions.m
│ │ │ │ ├── NSArray+MASShorthandAdditions.h
│ │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h
│ │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.m
│ │ │ │ ├── View+MASAdditions.h
│ │ │ │ ├── View+MASAdditions.m
│ │ │ │ ├── View+MASShorthandAdditions.h
│ │ │ │ ├── ViewController+MASAdditions.h
│ │ │ │ └── ViewController+MASAdditions.m
│ │ │ └── README.md
│ │ ├── Pods.xcodeproj/
│ │ │ └── project.pbxproj
│ │ └── Target Support Files/
│ │ ├── FMLayoutKit/
│ │ │ ├── FMLayoutKit-Info.plist
│ │ │ ├── FMLayoutKit-dummy.m
│ │ │ ├── FMLayoutKit-prefix.pch
│ │ │ ├── FMLayoutKit-umbrella.h
│ │ │ ├── FMLayoutKit.debug.xcconfig
│ │ │ ├── FMLayoutKit.modulemap
│ │ │ └── FMLayoutKit.release.xcconfig
│ │ ├── Masonry/
│ │ │ ├── Masonry-Info.plist
│ │ │ ├── Masonry-dummy.m
│ │ │ ├── Masonry-prefix.pch
│ │ │ ├── Masonry-umbrella.h
│ │ │ ├── Masonry.debug.xcconfig
│ │ │ ├── Masonry.modulemap
│ │ │ └── Masonry.release.xcconfig
│ │ ├── Pods-FMLayoutKit_Example/
│ │ │ ├── Pods-FMLayoutKit_Example-Info.plist
│ │ │ ├── Pods-FMLayoutKit_Example-acknowledgements.markdown
│ │ │ ├── Pods-FMLayoutKit_Example-acknowledgements.plist
│ │ │ ├── Pods-FMLayoutKit_Example-dummy.m
│ │ │ ├── Pods-FMLayoutKit_Example-frameworks.sh
│ │ │ ├── Pods-FMLayoutKit_Example-umbrella.h
│ │ │ ├── Pods-FMLayoutKit_Example.debug.xcconfig
│ │ │ ├── Pods-FMLayoutKit_Example.modulemap
│ │ │ └── Pods-FMLayoutKit_Example.release.xcconfig
│ │ └── Pods-FMLayoutKit_Tests/
│ │ ├── Pods-FMLayoutKit_Tests-Info.plist
│ │ ├── Pods-FMLayoutKit_Tests-acknowledgements.markdown
│ │ ├── Pods-FMLayoutKit_Tests-acknowledgements.plist
│ │ ├── Pods-FMLayoutKit_Tests-dummy.m
│ │ ├── Pods-FMLayoutKit_Tests-umbrella.h
│ │ ├── Pods-FMLayoutKit_Tests.debug.xcconfig
│ │ ├── Pods-FMLayoutKit_Tests.modulemap
│ │ └── Pods-FMLayoutKit_Tests.release.xcconfig
│ ├── Tests/
│ │ ├── Tests-Info.plist
│ │ ├── Tests-Prefix.pch
│ │ ├── Tests.m
│ │ └── en.lproj/
│ │ └── InfoPlist.strings
│ └── makeFramework.sh
├── FMLayoutKit/
│ ├── Assets/
│ │ └── .gitkeep
│ └── Classes/
│ ├── .gitkeep
│ ├── Cross/
│ │ ├── FMLayoutCrossCell.h
│ │ ├── FMLayoutCrossCell.m
│ │ ├── FMLayoutCrossSection.h
│ │ ├── FMLayoutCrossSection.m
│ │ ├── FMLayoutCrossTransformSection.h
│ │ └── FMLayoutCrossTransformSection.m
│ ├── Element/
│ │ ├── FMLayoutBackground.h
│ │ ├── FMLayoutBackground.m
│ │ ├── FMLayoutElement.h
│ │ ├── FMLayoutElement.m
│ │ ├── FMLayoutFooter.h
│ │ ├── FMLayoutFooter.m
│ │ ├── FMLayoutHeader.h
│ │ ├── FMLayoutHeader.m
│ │ ├── FMSupplementary.h
│ │ └── FMSupplementary.m
│ ├── FMCollectionLayoutAttributes.h
│ ├── FMCollectionLayoutAttributes.m
│ ├── FMCollectionViewDelegateDataSourceProvider.h
│ ├── FMCollectionViewDelegateDataSourceProvider.m
│ ├── FMKVOArrayObject.h
│ ├── FMKVOArrayObject.m
│ ├── FMLayout.h
│ ├── FMLayout.m
│ ├── FMLayoutDebugLog.h
│ ├── FMLayoutDebugLog.m
│ ├── FMLayoutKit.h
│ ├── FMLayoutView.h
│ ├── FMLayoutView.m
│ ├── FMTeslaLayoutView.h
│ ├── FMTeslaLayoutView.m
│ ├── FMTeslaSuspensionHeightChangeDelegate.h
│ ├── Sections/
│ │ ├── FMLayoutAbsoluteSection.h
│ │ ├── FMLayoutAbsoluteSection.m
│ │ ├── FMLayoutBaseSection.h
│ │ ├── FMLayoutBaseSection.m
│ │ ├── FMLayoutCombineSection.h
│ │ ├── FMLayoutCombineSection.m
│ │ ├── FMLayoutDynamicSection.h
│ │ ├── FMLayoutDynamicSection.m
│ │ ├── FMLayoutFillSection.h
│ │ ├── FMLayoutFillSection.m
│ │ ├── FMLayoutFixedSection.h
│ │ ├── FMLayoutFixedSection.m
│ │ ├── FMLayoutLabelSection.h
│ │ ├── FMLayoutLabelSection.m
│ │ ├── FMLayoutScaleSection.h
│ │ └── FMLayoutScaleSection.m
│ ├── UIView+FMLayout.h
│ ├── UIView+FMLayout.m
│ ├── _FMLayoutSussEmptyView.h
│ └── _FMLayoutSussEmptyView.m
├── FMLayoutKit.podspec
├── LICENSE
├── README.md
└── submitNewVersion.sh
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# OS X
.DS_Store
# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa
# Bundler
.bundle
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Note: if you ignore the Pods directory, make sure to uncomment
# `pod install` in .travis.yml
#
# Pods/
================================================
FILE: .travis.yml
================================================
# references:
# * https://www.objc.io/issues/6-build-tools/travis-ci/
# * https://github.com/supermarin/xcpretty#usage
osx_image: xcode7.3
language: objective-c
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
# - gem install cocoapods # Since Travis is not always on latest version
# - pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/FMLayoutKit.xcworkspace -scheme FMLayoutKit-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
================================================
FILE: Example/FMLayoutKit/Base.lproj/LaunchScreen.storyboard
================================================
================================================
FILE: Example/FMLayoutKit/Base.lproj/Main.storyboard
================================================
================================================
FILE: Example/FMLayoutKit/FMAddViewController.h
================================================
//
// FMAddViewController.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/17.
// Copyright © 2020 周发明. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMAddViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMAddViewController.m
================================================
//
// FMAddViewController.m
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/17.
// Copyright © 2020 周发明. All rights reserved.
//
#import "FMAddViewController.h"
#import
#import
#import "LS_HomeActivityCell.h"
#import "FMCollectionCustomDecoration.h"
#import "FMCollectionCustomCell.h"
#import "FMCollectionNavTitleView.h"
#import "FMHorizontalLayoutController.h"
#import "FMAotuSizeReusableView.h"
@interface FMAddViewController ()
@property(nonatomic, strong)NSMutableArray *shareSections;
@property(nonatomic, weak)FMLayoutView *collectionView;
@property(nonatomic, weak)FMLayoutBaseSection *firstSection;
@property(nonatomic, weak)FMLayoutDynamicSection *secondSection;
@property(nonatomic, assign)BOOL twoChangeed;
@end
@implementation FMAddViewController
- (void)firstAdd{
[self.firstSection.itemDatas addObjectsFromArray:@[@"1", @"2", @"3", @"4"]];
// [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
// [self.collectionView.layout.sections exchangeObjectAtIndex:1 withObjectAtIndex:2];
// [self.collectionView moveSection:1 toSection:2];
[self.collectionView reloadChangedSectionsData];
}
- (void)firstDelete{
// [self.firstSection.itemDatas removeLastObject];
// [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
// [self.collectionView reloadData];
}
- (void)secondsReplace{
self.twoChangeed = !self.twoChangeed;
[self.secondSection markChangeAt:3];
// [self.secondSection.itemDatas replaceObjectAtIndex:2 withObject:@"2"];
[self.collectionView reloadChangedSectionsData];
}
- (void)secondsAdd{
[self.secondSection.itemDatas addObjectsFromArray:@[@"1", @"2", @"3", @"4"]];
[self.collectionView reloadChangedSectionsData];
}
- (void)secondsDelete{
[self.secondSection.itemDatas removeLastObject];
[self.collectionView reloadChangedSectionsData];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"追加数据测试";
UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithTitle:@"一添加" style:UIBarButtonItemStyleDone target:self action:@selector(firstAdd)];
UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithTitle:@"一删除" style:UIBarButtonItemStyleDone target:self action:@selector(firstDelete)];
UIBarButtonItem *item3 = [[UIBarButtonItem alloc] initWithTitle:@"二替换" style:UIBarButtonItemStyleDone target:self action:@selector(secondsReplace)];
UIBarButtonItem *item4 = [[UIBarButtonItem alloc] initWithTitle:@"二添加" style:UIBarButtonItemStyleDone target:self action:@selector(secondsAdd)];
UIBarButtonItem *item5 = [[UIBarButtonItem alloc] initWithTitle:@"二删除" style:UIBarButtonItemStyleDone target:self action:@selector(secondsDelete)];
self.navigationItem.rightBarButtonItems = @[item2, item1, item3, item4, item5];
self.shareSections = [NSMutableArray array];
__weak typeof(self) weakSelf = self;
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(0, 15, 0, 15) itemSpace:10 lineSpace:10 column:2];
// section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header = [FMLayoutHeader elementSize:0 viewClass:[FMAotuSizeReusableView class]];
section.header.autoHeight = YES;
// section.header.type = FMLayoutHeaderTypeSuspensionAlways;
// section.header.zIndex = FMLayoutZIndexFrontAlways;
// section.header.isStickTop = YES;
section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
[(FMAotuSizeReusableView *)header contentLabel].text = @"按实际大街上肯德基哈克斯就打回修改后\n1\n2\n3\n4\n阿拉山口基多拉科技的拉升科技大理石科技大流口水基多拉考试记录";
}];
// [section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
// FMCollectionCustomDecoration *custom = (FMCollectionCustomDecoration *)header;
// custom.textLabel.text = @"第一个悬浮的顶部视图, 黏在顶部";
// }];
[self.shareSections addObject:section];
}
{
FMLayoutFillSection *section = [[FMLayoutFillSection alloc] init];
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3",] mutableCopy];
section.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10);
// section.lineSpace = 10;
// section.itemSpace = 10;
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
// section.header.suspensionTopMargin = 150;
section.header.zIndex = FMLayoutZIndexFrontAlways;
section.header.type = FMLayoutHeaderTypeSuspensionAlways;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"填充布局,寻找合适的空档,支持多种cell, header样式一直悬停在顶部";
}];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setSizeBlock:^CGSize(id _Nonnull section, NSInteger item) {
switch (item) {
case 2:
return CGSizeMake(150, 140.32);
case 5:
return CGSizeMake((weakSelf.view.frame.size.width-20-150)/2, 70.19);
case 8:
case 11:
return CGSizeMake(100, 240);
case 10:
return CGSizeMake(weakSelf.view.frame.size.width-20-200, 140);
case 9:
case 12:
return CGSizeMake(weakSelf.view.frame.size.width-20-100, 100);
case 0:
case 1:
case 3:
case 4:
return CGSizeMake((weakSelf.view.frame.size.width-20-150)/4, 70.13);
default:
return CGSizeMake((weakSelf.view.frame.size.width-20-150)/4, 70.19);
}
}];
// [section setConfigureCellLayoutAttributes:^(id _Nonnull section, UICollectionViewLayoutAttributes * _Nonnull attributes, NSInteger item) {
// if (item == 10) {
// attributes.transform = CGAffineTransformMakeRotation(M_PI_4);
// }
// }];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
FMCollectionCustomCell *customCell = (FMCollectionCustomCell *)cell;
customCell.label.text = [NSString stringWithFormat:@"%ld", item];
}];
[self.shareSections addObject:section];
self.firstSection = section;
}
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(0, 15, 15, 15) itemSpace:10 lineSpace:10 column:2];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
section.header.lastMargin = 10;
section.header.type = FMLayoutHeaderTypeSuspensionAlways;
section.header.zIndex = FMLayoutZIndexFrontAlways;
section.header.isStickTop = NO;
section.header.suspensionTopMargin = 50;
section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *custom = (FMCollectionCustomDecoration *)header;
custom.textLabel.text = @"第二个悬浮的顶部视图, 不黏在顶部";
}];
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemSize = CGSizeMake(100, 100);
section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setClickCellBlock:^(FMLayoutBaseSection * _Nonnull section, NSInteger item) {
FMHorizontalLayoutController *vc = [[FMHorizontalLayoutController alloc] init];
[weakSelf.navigationController pushViewController:vc animated:YES];
}];
[self.shareSections addObject:section];
// self.firstSection = section;
}
{
FMLayoutLabelSection *section = [FMLayoutLabelSection sectionWithSectionInset:UIEdgeInsetsMake(0, 10, 0, 10) itemSpace:10 lineSpace:10 column:3];
section.header = [FMLayoutHeader elementSize:30 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontOfItem;
section.header.type = FMLayoutHeaderTypeFixed;
section.header.lastMargin = 10;
// section.isSingleLineCanScroll = YES;
section.maxLine = 2;
section.cellFixedHeight = 40;
[section setWidthBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return item * 20 + 100;
}];
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
// FMLayoutCrossSection *hSection = [FMLayoutCrossSection sectionAutoWithSection:section];
[self.shareSections addObject:section];
// self.firstSection = section;
}
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(5, 15, 5, 15) itemSpace:10 lineSpace:10 column:2];
section.cellFixedSize = 166;
section.autoHeightFixedWidth = YES;
section.itemDatas = [@[@1, @1, @1, @1, @1, @1] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[LS_HomeActivityCell class]];
__weak typeof(self) weakSelf = self;
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
if (item == 0) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
return;
}
if (item == 1) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
return;
}
if (item == 2) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述";
return;
}
if (item == 3) {
if (weakSelf.twoChangeed) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的";
return;
} else {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n";
return;
}
}
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少";
}];
self.secondSection = section;
[self.shareSections addObject:section];
}
{
FMLayoutAbsoluteSection *section = [FMLayoutAbsoluteSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:0 lineSpace:0 column:0];
section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setFrameBlock:^CGRect(id _Nonnull section, NSInteger item) {
switch (item) {
case 0:
return CGRectMake(0, 0, 100, 100);
case 1:
return CGRectMake(200, 100, 150, 100);
case 2:
return CGRectMake(100, 400, 400, 90);
default:
return CGRectZero;
break;
}
}];
[self.shareSections addObject:section];
}
FMLayoutView *view = [[FMLayoutView alloc] init];
self.automaticallyAdjustsScrollViewInsets = NO;
view.delegate = self;
[view.layout setSections:self.shareSections];
view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:view];
[view mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(0);
make.top.mas_equalTo(100);
}];
self.collectionView = view;
}
@end
================================================
FILE: Example/FMLayoutKit/FMAotuSizeReusableView.h
================================================
//
// FMAotuSizeReusableView.h
// FMLayoutKit_Example
//
// Created by 郑桂华 on 2020/7/3.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMAotuSizeReusableView : UICollectionReusableView
@property(nonatomic, weak)UILabel *contentLabel;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMAotuSizeReusableView.m
================================================
//
// FMAotuSizeReusableView.m
// FMLayoutKit_Example
//
// Created by 郑桂华 on 2020/7/3.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import "FMAotuSizeReusableView.h"
#import
@implementation FMAotuSizeReusableView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = UIColor.cyanColor;
UILabel *label = [[UILabel alloc] init];
label.text = @"自动布局高度大小";
[self addSubview:label];
[label mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(0);
make.top.mas_equalTo(20);
}];
UILabel *content = [[UILabel alloc] init];
content.preferredMaxLayoutWidth = [UIScreen mainScreen].bounds.size.width - 40;
content.text = @"内容\n内容埃里克森基多拉可接受的拉可视角度阿拉山口基多拉刷卡机的啦可视角度拉克丝基多拉可视角度拉克丝基多拉可视角度拉手孔";
content.numberOfLines = 0;
[self addSubview:content];
[content mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.right.mas_equalTo(-20);
make.top.mas_equalTo(label.mas_bottom).offset(20);
make.bottom.mas_equalTo(-20);
}];
self.contentLabel = content;
}
return self;
}
@end
================================================
FILE: Example/FMLayoutKit/FMAppDelegate.h
================================================
//
// FMAppDelegate.h
// FMCollectionLayout
//
// Created by 周发明 on 04/01/2020.
// Copyright (c) 2020 周发明. All rights reserved.
//
@import UIKit;
@interface FMAppDelegate : UIResponder
@property (strong, nonatomic) UIWindow *window;
@end
================================================
FILE: Example/FMLayoutKit/FMAppDelegate.m
================================================
//
// FMAppDelegate.m
// FMCollectionLayout
//
// Created by 周发明 on 04/01/2020.
// Copyright (c) 2020 周发明. All rights reserved.
//
#import "FMAppDelegate.h"
/// pod trunk push FMLayoutKit.podspec --allow-warnings
@implementation FMAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
================================================
FILE: Example/FMLayoutKit/FMCollViewController.h
================================================
//
// FMCollViewController.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/11.
// Copyright © 2020 周发明. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMCollViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMCollViewController.m
================================================
//
// FMCollViewController.m
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/11.
// Copyright © 2020 周发明. All rights reserved.
//
#import "FMCollViewController.h"
#import
#import
#import "FMAddViewController.h"
#import "FMCollectionCustomDecoration.h"
#import "FMCollectionCustomCell.h"
#import "FMCollectionNavTitleView.h"
#import "LS_HomeActivityCell.h"
#import "FMCollectionViewCell.h"
#import "FMFPSLabel.h"
@interface FMCollViewController ()
@property(nonatomic, strong)NSMutableArray *shareSections;
@property(nonatomic, weak)FMLayoutView *collectionView;
@end
@implementation FMCollViewController
- (void)dealloc{
NSLog(@"FMCollViewController dealloc");
}
- (void)reloadSection{
FMLayoutBaseSection *section = [self.shareSections[2] copy];
[self.collectionView.sections insertObject:section atIndex:1];
[self.collectionView reloadData];
}
- (void)addItem{
[[self.shareSections firstObject].itemDatas addObject:@"1"];
[self.collectionView reloadData];
}
- (void)insetItem{
[[self.shareSections firstObject].itemDatas insertObject:@"1" atIndex:0];
[self.collectionView reloadData];
}
- (void)deleteSection{
[self.collectionView.sections removeObjectAtIndex:1];
// [self.collectionView reloadData];
}
- (void)deleteItem{
[[self.shareSections firstObject].itemDatas removeObjectAtIndex:1];
[self.collectionView reloadData];
}
- (void)reloadItem{
[[self.shareSections firstObject] markChangeAt:3];
// [self.collectionView reloadData];
}
- (void)addSection{
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(0, 15, 15, 15) itemSpace:10 lineSpace:10 column:3];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
section.header.lastMargin = 10;
section.header.type = FMLayoutHeaderTypeSuspension;
section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemSize = CGSizeMake(100, 100);
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
// [self.shareSections addObject:section];
[self.collectionView.sections addObject:section];
}
[self.collectionView reloadData];
}
//- (void)addItem{
// [[self.shareSections firstObject].itemDatas removeObjectAtIndex:1];
// [self.collectionView reloadData];
//}
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"纵向布局";
__weak typeof(self) weakSelf = self;
self.view.backgroundColor = [UIColor redColor];
UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithTitle:@"插组" style:UIBarButtonItemStyleDone target:self action:@selector(reloadSection)];
UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithTitle:@"插单" style:UIBarButtonItemStyleDone target:self action:@selector(insetItem)];
UIBarButtonItem *item11 = [[UIBarButtonItem alloc] initWithTitle:@"删组" style:UIBarButtonItemStyleDone target:self action:@selector(deleteSection)];
UIBarButtonItem *item22 = [[UIBarButtonItem alloc] initWithTitle:@"删单" style:UIBarButtonItemStyleDone target:self action:@selector(deleteItem)];
UIBarButtonItem *item111 = [[UIBarButtonItem alloc] initWithTitle:@"加组" style:UIBarButtonItemStyleDone target:self action:@selector(addSection)];
UIBarButtonItem *item222 = [[UIBarButtonItem alloc] initWithTitle:@"加单" style:UIBarButtonItemStyleDone target:self action:@selector(addItem)];
UIBarButtonItem *item2222 = [[UIBarButtonItem alloc] initWithTitle:@"刷单" style:UIBarButtonItemStyleDone target:self action:@selector(reloadItem)];
self.navigationItem.rightBarButtonItems = @[item2, item1, item22, item11, item111, item222, item2222];
self.shareSections = [NSMutableArray array];
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(20, 15, 15, 15) itemSpace:10 lineSpace:10 column:2];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
section.header.lastMargin = 10;
section.header.type = FMLayoutHeaderTypeSuspensionBigger;
// section.header.minSize = 50;
section.header.isStickTop = YES;
section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"固定大小, 从左往右从上往下排的分组, 头部放大缩放效果";
}];
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemSize = CGSizeMake(200, 100);
section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionViewCell class] isNib:YES];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
}];
[section setClickCellBlock:^(FMLayoutBaseSection * _Nonnull section, NSInteger item) {
FMAddViewController *add = [[FMAddViewController alloc] init];
[weakSelf.navigationController pushViewController:add animated:YES];
}];
[self.shareSections addObject:section];
}
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(5, 15, 5, 15) itemSpace:10 lineSpace:10 column:2];
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontOfItem;
section.header.type = FMLayoutHeaderTypeFixed;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"自动适应高度布局, 续固定宽度";
}];
section.cellFixedSize = 166;
section.autoHeightFixedWidth = YES;
//, @1, @1, @1, @1
section.itemDatas = [@[@1, @1] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[LS_HomeActivityCell class]];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
if (item == 0) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
return;
}
if (item == 1) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
return;
}
if (item == 2) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述";
return;
}
if (item == 3) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的";
return;
}
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n一些描述";
}];
// [self.shareSections addObject:section];
}
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:10 lineSpace:10 column:3];
section.header = [FMLayoutHeader elementSize:150 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontAlways;
section.header.type = FMLayoutHeaderTypeSuspensionAlways;
section.header.lastMargin = 10;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"固定大小, 从左往右从上往下排的分组, 可横向滚动, 可设置多行, 头部悬停, 跟着分组滚动(类似table的section的plain模式)";
}];
// section.isHorizontalCanScroll = YES;
section.itemSize = CGSizeMake(150, 100);
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setConfigureCellLayoutAttributes:^(id _Nonnull section, UICollectionViewLayoutAttributes * _Nonnull attributes, NSInteger item) {
if (item == 10) {
attributes.transform = CGAffineTransformMakeRotation(M_PI_4);
attributes.zIndex = FMLayoutZIndexFrontOfItem;
}
}];
// [self.shareSections addObject:section];
[self.shareSections addObject:[FMLayoutCrossSection sectionAutoWithSection:section]];
}
{
FMLayoutFillSection *section = [[FMLayoutFillSection alloc] init];
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3",] mutableCopy];
section.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10);
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
// section.header.suspensionTopMargin = 150;
section.header.zIndex = FMLayoutZIndexFrontAlways;
section.header.type = FMLayoutHeaderTypeSuspensionAlways;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"填充布局,寻找合适的空档,支持多种cell, header样式一直悬停在顶部";
}];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setSizeBlock:^CGSize(id _Nonnull section, NSInteger item) {
switch (item) {
case 2:
return CGSizeMake(150, 140.32);
case 5:
return CGSizeMake((weakSelf.view.frame.size.width-20-150)/2, 70.19);
case 8:
case 11:
return CGSizeMake(100, 240);
case 10:
return CGSizeMake(weakSelf.view.frame.size.width-20-200, 140);
case 9:
case 12:
return CGSizeMake(weakSelf.view.frame.size.width-20-100, 100);
case 0:
case 1:
case 3:
case 4:
return CGSizeMake((weakSelf.view.frame.size.width-20-150)/4, 70.13);
default:
return CGSizeMake((weakSelf.view.frame.size.width-20-150)/4, 70.19);
}
}];
// [section setConfigureCellLayoutAttributes:^(id _Nonnull section, UICollectionViewLayoutAttributes * _Nonnull attributes, NSInteger item) {
// if (item == 10) {
// attributes.transform = CGAffineTransformMakeRotation(M_PI_4);
// }
// }];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
FMCollectionCustomCell *customCell = (FMCollectionCustomCell *)cell;
customCell.label.text = [NSString stringWithFormat:@"%ld", item];
}];
[self.shareSections addObject:section];
}
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(10, 0, 0, 0) itemSpace:0 lineSpace:10 column:1];
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontOfItem;
section.header.type = FMLayoutHeaderTypeFixed;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"列表的样式, 支持多种cell, 当前手动返回计算返回高度";
}];
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
section.cellFixedSize = [UIScreen mainScreen].bounds.size.width;
[section setOtherBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return 100 + item * 100;
}];
[self.shareSections addObject:section];
}
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(10, 0, 0, 0) itemSpace:10 lineSpace:10 column:2];
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontOfItem;
section.header.type = FMLayoutHeaderTypeFixed;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"瀑布流, 列表也就是单列, 列数可设置";
}];
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemDatas = [@[@"1", @"2", @"3", @"2", @"3", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
section.cellFixedSize = ([UIScreen mainScreen].bounds.size.width - 10) * 0.5;
[section setOtherBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return 100 + item * 30;
}];
[self.shareSections addObject:section];
}
{
FMLayoutLabelSection *section = [FMLayoutLabelSection sectionWithSectionInset:UIEdgeInsetsMake(10, 10, 10, 10) itemSpace:10 lineSpace:10 column:3];
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontOfItem;
section.header.type = FMLayoutHeaderTypeFixed;
section.header.lastMargin = 10;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"标签式布局, 单行横向滚动模式";
}];
// section.isSingleLineCanScroll = YES;
section.maxLine = 6;
section.cellFixedHeight = 40;
[section setWidthBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return item * 20 + 100;
}];
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[self.shareSections addObject:section];
}
{
FMLayoutLabelSection *section = [FMLayoutLabelSection sectionWithSectionInset:UIEdgeInsetsMake(0, 10, 0, 10) itemSpace:10 lineSpace:10 column:3];
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontOfItem;
section.header.type = FMLayoutHeaderTypeFixed;
section.header.lastMargin = 10;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"标签式布局, 多行模式";
}];
section.maxLine = 6;
section.cellFixedHeight = 40;
[section setWidthBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return item * 20 + 100;
}];
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[self.shareSections addObject:section];
}
FMLayoutView *view = [[FMLayoutView alloc] init];
self.automaticallyAdjustsScrollViewInsets = NO;
view.delegate = self;
// view.reloadOlnyChanged = NO;
[view.layout setSections:self.shareSections];
view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:view];
[view mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(0);
make.top.mas_equalTo(100);
}];
self.collectionView = view;
// [self.collectionView layoutIfNeeded];
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
NSLog(@"collectionView:didSelectItemAtIndexPath");
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
NSLog(@"scrollViewDidScroll");
}
@end
================================================
FILE: Example/FMLayoutKit/FMCollectionCustomCell.h
================================================
//
// FMCollectionCustomCell.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/8.
// Copyright © 2020 周发明. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMCollectionCustomCell : UICollectionViewCell
@property(nonatomic, weak)UILabel *label;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMCollectionCustomCell.m
================================================
//
// FMCollectionCustomCell.m
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/8.
// Copyright © 2020 周发明. All rights reserved.
//
#import "FMCollectionCustomCell.h"
#import
@implementation FMCollectionCustomCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
NSInteger aRedValue =arc4random() %255;
NSInteger aGreenValue =arc4random() %255;
NSInteger aBlueValue =arc4random() %255;
UIColor*randColor = [UIColor colorWithRed:aRedValue /255.0f green:aGreenValue /255.0f blue:aBlueValue /255.0f alpha:1.0f];
self.contentView.backgroundColor = randColor;
UILabel *label = [[UILabel alloc] init];
label.numberOfLines = 0;
label.textAlignment = NSTextAlignmentCenter;
label.text = NSStringFromClass(self.class);
[self.contentView addSubview:label];
[label mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom.mas_equalTo(0);
}];
self.label = label;
}
return self;
}
- (void)layoutSubviews{
[super layoutSubviews];
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
NSLog(@"cell:%p attr:%p", self, layoutAttributes);
[super applyLayoutAttributes:layoutAttributes];
}
@end
================================================
FILE: Example/FMLayoutKit/FMCollectionCustomDecoration.h
================================================
//
// FMCollectionCustomDecoration.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/8.
// Copyright © 2020 周发明. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMCollectionCustomDecoration : UICollectionReusableView
@property(nonatomic, weak)UILabel *textLabel;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMCollectionCustomDecoration.m
================================================
//
// FMCollectionCustomDecoration.m
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/8.
// Copyright © 2020 周发明. All rights reserved.
//
#import "FMCollectionCustomDecoration.h"
#import
@implementation FMCollectionCustomDecoration
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// NSInteger aRedValue =arc4random() %255;
// NSInteger aGreenValue =arc4random() %255;
// NSInteger aBlueValue =arc4random() %255;
// UIColor*randColor = [UIColor colorWithRed:aRedValue /255.0f green:aGreenValue /255.0f blue:aBlueValue /255.0f alpha:1.0f];
// self.backgroundColor = randColor;
UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"timg"]];
imageV.contentMode = UIViewContentModeScaleAspectFill;
imageV.clipsToBounds = YES;
[self addSubview:imageV];
[imageV mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom.mas_equalTo(0);
}];
UILabel *text = [[UILabel alloc] init];
text.numberOfLines = 0;
text.textColor = [UIColor whiteColor];
[self addSubview:text];
[text mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.centerY.right.mas_equalTo(0);
}];
self.textLabel = text;
}
return self;
}
- (void)layoutSubviews{
[super layoutSubviews];
}
@end
================================================
FILE: Example/FMLayoutKit/FMCollectionNavTitleView.h
================================================
//
// FMCollectionNavTitleView.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/9.
// Copyright © 2020 周发明. All rights reserved.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMCollectionNavTitleView : UICollectionReusableView
@property(nonatomic, copy)NSArray *titles;
@property(nonatomic, copy)void(^clickBlock)(NSInteger tag);
- (void)selectWithIndex:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMCollectionNavTitleView.m
================================================
//
// FMCollectionNavTitleView.m
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/9.
// Copyright © 2020 周发明. All rights reserved.
//
#import "FMCollectionNavTitleView.h"
#import
@interface FMCollectionNavTitleView ()
@property(nonatomic, weak)UIView *contentView;
@property(nonatomic, weak)UIButton *selectBtn;
@property(nonatomic, strong)NSMutableArray *btns;
@end
@implementation FMCollectionNavTitleView
- (void)selectWithIndex:(NSInteger)index{
self.selectBtn = [self viewWithTag:index + 100];
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
UIView *contentView = [[UIView alloc] init];
[self addSubview:contentView];
[contentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(0);
make.height.mas_equalTo(100);
}];
self.contentView = contentView;
self.contentView.backgroundColor = [UIColor greenColor];
self.btns = [NSMutableArray array];
[self reCreateBtns];
}
return self;
}
- (void)setSelectBtn:(UIButton *)selectBtn{
_selectBtn.selected = NO;
_selectBtn = selectBtn;
_selectBtn.selected = YES;
}
- (void)reCreateBtns{
self.titles = @[@"标签1", @"标签2", @"标签3", @"标签4"];
UIButton *left = nil;
CGFloat multiplied = 1 / (self.titles.count * 1.0);
for (int i = 0; i < self.titles.count; i++) {
NSString *title = self.titles[i];
UIButton *btn = [[UIButton alloc] init];
btn.tag = 100+i;
btn.titleLabel.font = [UIFont systemFontOfSize:16];
[btn setTitle:title forState:UIControlStateNormal];
[btn setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
[btn setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
[btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:btn];
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
if (left) {
make.left.mas_equalTo(left.mas_right);
} else {
make.left.mas_equalTo(0);
}
make.top.bottom.mas_equalTo(0);
make.width.mas_equalTo(self.mas_width).multipliedBy(multiplied);
}];
[self.btns addObject:btn];
left = btn;
if (i == 0) {
self.selectBtn = btn;
}
}
[self btnClick:self.selectBtn];
}
- (void)btnClick:(UIButton *)sender{
!self.clickBlock?:self.clickBlock(sender.tag-100);
self.selectBtn = sender;
}
- (void)teslaSuspensionHeaderShouldShowHeight:(CGFloat)showHeight{
[self.contentView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(showHeight);
}];
for (UIButton *btn in self.btns) {
btn.titleLabel.font = [UIFont systemFontOfSize:16 + (100 - showHeight) / 40.0 * 10];
}
}
@end
================================================
FILE: Example/FMLayoutKit/FMCollectionViewCell.h
================================================
//
// FMCollectionViewCell.h
// FMLayoutKit_Example
//
// Created by 周发明 on 2020/6/15.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UILabel *label;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMCollectionViewCell.m
================================================
//
// FMCollectionViewCell.m
// FMLayoutKit_Example
//
// Created by 周发明 on 2020/6/15.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import "FMCollectionViewCell.h"
@implementation FMCollectionViewCell
- (void)awakeFromNib {
[super awakeFromNib];
self.contentView.backgroundColor = [UIColor cyanColor];
}
@end
================================================
FILE: Example/FMLayoutKit/FMCollectionViewCell.xib
================================================
================================================
FILE: Example/FMLayoutKit/FMCombineViewController.h
================================================
//
// FMCombineViewController.h
// FMLayoutKit_Example
//
// Created by 郑桂华 on 2020/7/12.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMCombineViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMCombineViewController.m
================================================
//
// FMCombineViewController.m
// FMLayoutKit_Example
//
// Created by 郑桂华 on 2020/7/12.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import "FMCombineViewController.h"
#import
#import
#import "FMCollectionCustomDecoration.h"
#import "FMCollectionCustomCell.h"
#import "FMAddViewController.h"
#import "FMCollectionViewCell.h"
#import "LS_HomeActivityCell.h"
@interface FMDeletePanGestureRecognizer : UIPanGestureRecognizer
@property(nonatomic, assign)BOOL isLeft;
@end
@implementation FMDeletePanGestureRecognizer
@end
@interface FMCollectionDeleteCell : UICollectionViewCell
@property(nonatomic, assign)CGFloat handleViewWidth;
@end
@implementation FMCollectionDeleteCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.handleViewWidth = 100;
NSInteger aRedValue =arc4random() %255;
NSInteger aGreenValue =arc4random() %255;
NSInteger aBlueValue =arc4random() %255;
UIColor*randColor = [UIColor colorWithRed:aRedValue /255.0f green:aGreenValue /255.0f blue:aBlueValue /255.0f alpha:1.0f];
self.contentView.backgroundColor = randColor;
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGesture:)];
pan.delegate = self;
[self addGestureRecognizer:pan];
}
return self;
}
- (void)panGesture:(UIPanGestureRecognizer *)pan{
CGPoint translate = [pan translationInView:self];
NSLog(@"translate: %@", [NSValue valueWithCGPoint:translate]);
switch (pan.state) {
case UIGestureRecognizerStateBegan:
break;
case UIGestureRecognizerStateChanged:
{
if (-translate.x < self.handleViewWidth) {
self.transform = CGAffineTransformMakeTranslation(translate.x, 0);
}
}
break;
case UIGestureRecognizerStateEnded:
{
if (-translate.x < self.handleViewWidth * 0.5) {
[UIView animateWithDuration:0.2 animations:^{
self.transform = CGAffineTransformIdentity;
}];
} else {
[UIView animateWithDuration:0.2 animations:^{
self.transform = CGAffineTransformMakeTranslation(-self.handleViewWidth, 0);;
}];
}
}
default:
break;
}
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
CGPoint vel = [(UIPanGestureRecognizer *)gestureRecognizer velocityInView:self];
if (fabs(vel.y) < 20 && vel.x < 0) {
return YES;
}
return NO;
}
@end
@interface FMCombineViewController ()
@property(nonatomic, weak)FMLayoutView *collectionView;
@end
@implementation FMCombineViewController
- (void)viewDidLoad {
[super viewDidLoad];
FMLayoutView *view = [[FMLayoutView alloc] init];
// view.layout.minContentSize = 1000;
view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:view];
[view mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(0);
make.top.mas_equalTo(100);
}];
self.collectionView = view;
// [self addSections];
[self addCrossFixedSections];
// [self addScaleSection];
// self.collectionView.enableLongPressDrag = YES;
// [self.collectionView setConfigureSourceView:^UIView * _Nonnull(UICollectionViewCell * _Nonnull sourceCell) {
// UIView *source = [[UIView alloc] initWithFrame:sourceCell.frame];
// source.backgroundColor = [UIColor purpleColor];
// return source;
// }];
// self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"刷新" style:UIBarButtonItemStylePlain target:self.collectionView action:@selector(reloadData)];
}
- (void)addSections{
NSMutableArray *sections = [NSMutableArray array];
self.automaticallyAdjustsScrollViewInsets = NO;
__weak typeof(self) weakSelf = self;
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(20, 15, 15, 15) itemSpace:10 lineSpace:10 column:2];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class] isNib:NO reuseIdentifier:@"按实际大嫂家打卡机塑料袋卡死来得快"];
section.header.lastMargin = 10;
section.header.type = FMLayoutHeaderTypeSuspensionBigger;
section.header.minSize = 50;
section.header.isStickTop = YES;
section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"固定大小, 从左往右从上往下排的分组, 头部放大缩放效果";
}];
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemSize = CGSizeMake(200, 100);
section.itemDatas = [@[@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionViewCell class] isNib:YES];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
[(FMCollectionViewCell *)cell label].text = section.itemDatas[item];
}];
[section setClickCellBlock:^(FMLayoutBaseSection * _Nonnull section, NSInteger item) {
FMAddViewController *add = [[FMAddViewController alloc] init];
[weakSelf.navigationController pushViewController:add animated:YES];
}];
section.canLongPressExchange = YES;
[sections addObject:section];
}
{
NSMutableArray *subSections = [NSMutableArray array];
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:10 lineSpace:10 column:2];
section.itemSize = CGSizeMake(150, 100);
section.itemDatas = [@[@"0-1", @"0-2", @"0-3", @"0-4", @"0-5", @"0-6", @"0-7", @"0-8", @"0-9", @"0-10", @"0-11"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
[(FMCollectionCustomCell *)cell label].text = section.itemDatas[item];
}];
[section setClickCellBlock:^(FMLayoutBaseSection * _Nonnull section, NSInteger item) {
}];
[subSections addObject:section];
}
{
FMLayoutAbsoluteSection *section = [FMLayoutAbsoluteSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:0 lineSpace:0 column:0];
section.itemDatas = [@[@"1-1", @"1-2", @"1-3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setDeqCellReturnElement:^FMLayoutElement * _Nonnull(FMLayoutDynamicSection * _Nonnull section, NSInteger index) {
return [section.cellElements lastObject];
}];
[section setFrameBlock:^CGRect(id _Nonnull section, NSInteger item) {
switch (item) {
case 0:
return CGRectMake(0, 0, 100, 100);
case 1:
return CGRectMake(200, 100, 150, 100);
case 2:
return CGRectMake(100, 400, 400, 90);
default:
return CGRectZero;
break;
}
}];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
[(FMCollectionCustomCell *)cell label].text = section.itemDatas[item];
}];
[section setClickCellBlock:^(FMLayoutBaseSection * _Nonnull section, NSInteger item) {
}];
[subSections addObject:section];
}
FMLayoutCombineSection *section = [FMLayoutCombineSection combineSections:subSections];
[section setCanLongPressExchangeItem:^BOOL(id _Nonnull section, NSInteger item) {
if (item < 2) {
return NO;
}
return YES;
}];
section.canLongPressExchange = YES;
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header.type = FMLayoutHeaderTypeSuspensionAlways;
section.header.zIndex = FMLayoutZIndexFrontAlways;
// section.header.isStickTop = YES;
// section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *custom = (FMCollectionCustomDecoration *)header;
custom.textLabel.text = @"第一个悬浮的顶部视图, 黏在顶部";
}];
section.footer = [FMLayoutFooter elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
// section.footer.inset = UIEdgeInsetsMake(10, 0, 10, 0);
section.footer.topMargin = 10;
section.background = [FMLayoutBackground bgWithViewClass:[UICollectionReusableView class]];
section.background.inset = UIEdgeInsetsMake(10, 10, 10, 10);
[section setConfigureBg:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull bg) {
bg.backgroundColor = [UIColor yellowColor];
}];
{
FMLayoutDynamicSection *dsection = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(10, 0, 0, 0) itemSpace:0 lineSpace:10 column:1];
dsection.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
dsection.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionDeleteCell class]];
dsection.cellFixedSize = [UIScreen mainScreen].bounds.size.width;
[dsection setOtherBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return 100 + item * 100;
}];
[section appendSection:dsection];
}
{
FMLayoutDynamicSection *dsection = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(10, 0, 0, 0) itemSpace:0 lineSpace:10 column:1];
dsection.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
dsection.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionDeleteCell class]];
dsection.cellFixedSize = [UIScreen mainScreen].bounds.size.width;
[dsection setOtherBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return 100 + item * 100;
}];
[section insetSection:dsection atIndex:1];
}
[sections addObject:section];
}
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(10, 0, 0, 0) itemSpace:0 lineSpace:10 column:1];
section.canLongPressExchange = YES;
section.moveType = FMLayoutLongMoveTable;
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontOfItem;
section.header.type = FMLayoutHeaderTypeFixed;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"列表的样式, 支持多种cell, 当前手动返回计算返回高度";
}];
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionDeleteCell class]];
section.cellFixedSize = [UIScreen mainScreen].bounds.size.width;
[section setOtherBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return 100 + item * 100;
}];
[sections addObject:section];
}
self.collectionView.sections = sections;
[self.collectionView reloadData];
}
- (void)addCrossFixedSections{
NSMutableArray *sections = [NSMutableArray array];
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(50, 50, 50, 50) itemSpace:20 lineSpace:0 column:1];
section.itemSize = CGSizeMake([UIScreen mainScreen].bounds.size.width - 100, 300);
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
//
section.itemDatas = [@[@"1", @"2", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3"] mutableCopy];
FMLayoutCrossTransformSection *cSection = [FMLayoutCrossTransformSection sectionAutoWithSection:section];
cSection.transformType = FMLayoutCrossTransformScale;
// [cSection setTransformBlock:^(UICollectionViewCell * _Nonnull cell, CGFloat progress) {
// cell.la
// }];
[sections addObject:cSection];
}
self.collectionView.sections = sections;
[self.collectionView reloadData];
}
- (void)addScaleSection{
NSMutableArray *sections = [NSMutableArray array];
{
FMLayoutScaleSection *section = [FMLayoutScaleSection sectionWithSectionInset:UIEdgeInsetsMake(10, 10, 10, 10) itemSpace:10 lineSpace:10 column:1];
section.scales = @"1:0.5";
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setOtherBlock:^CGFloat(id _Nonnull section, NSInteger item) {
switch (item) {
case 0:
case 3:
case 6:
case 9:
return ([UIScreen mainScreen].bounds.size.width - 30) / 3.0 * 2;
break;
default:
return (([UIScreen mainScreen].bounds.size.width - 30) / 3.0 * 2 - 10) * 0.5;
break;
}
// return 50 + ((item % 2 == 0) ? item * 50 : item * 10);
}];
//
section.itemDatas = [@[@"1", @"2", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3"] mutableCopy];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
[(FMCollectionCustomCell *)cell label].text = [NSString stringWithFormat:@"%ld", item];
}];
[sections addObject:section];
}
{
FMLayoutScaleSection *section = [FMLayoutScaleSection sectionWithSectionInset:UIEdgeInsetsMake(10, 10, 10, 10) itemSpace:10 lineSpace:10 column:1];
section.sizeNums = @[@100, @200];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
// section.cellElement = [FMLayoutElement elementWithViewClass:[LS_HomeActivityCell class]];
// section.autoHeightFixedWidth = YES;
[section setOtherBlock:^CGFloat(id _Nonnull section, NSInteger item) {
switch (item) {
case 0:
case 3:
case 6:
case 9:
return ([UIScreen mainScreen].bounds.size.width - 30) / 3.0 * 2;
break;
default:
return (([UIScreen mainScreen].bounds.size.width - 30) / 3.0 * 2 - 10) * 0.5;
break;
}
// return 50 + ((item % 2 == 0) ? item * 50 : item * 10);
}];
section.itemDatas = [@[@"1", @"2", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3"] mutableCopy];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
[(FMCollectionCustomCell *)cell label].text = [NSString stringWithFormat:@"%ld", item];
// if (item == 0) {
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
// return;
// }
// if (item == 1) {
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
// return;
// }
// if (item == 2) {
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述";
// return;
// }
// if (item == 3) {
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的";
// return;
//
// }
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少";
}];
[sections addObject:section];
}
self.collectionView.sections = sections;
[self.collectionView reloadData];
}
@end
================================================
FILE: Example/FMLayoutKit/FMExcuteTimeTool.h
================================================
//
// FMExcuteTimeTool.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/6/6.
// Copyright © 2020 周发明. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMExcuteTimeTool : NSObject
+ (void)excuteTime:(void(^)(void))excute;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMExcuteTimeTool.m
================================================
//
// FMExcuteTimeTool.m
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/6/6.
// Copyright © 2020 周发明. All rights reserved.
//
#import "FMExcuteTimeTool.h"
@implementation FMExcuteTimeTool
+ (void)excuteTime:(void(^)(void))excute{
CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
!excute?:excute();
CFAbsoluteTime end = CFAbsoluteTimeGetCurrent() - start;
NSLog(@"该block执行耗时 %f ms", end *1000.0);
}
@end
================================================
FILE: Example/FMLayoutKit/FMFPSLabel.h
================================================
//
// FMFPSLabel.h
// FMLayoutKit_Example
//
// Created by 郑桂华 on 2020/7/1.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMFPSLabel : UILabel
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMFPSLabel.m
================================================
//
// FMFPSLabel.m
// FMLayoutKit_Example
//
// Created by 郑桂华 on 2020/7/1.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import "FMFPSLabel.h"
@interface FMFPSLabel ()
@property(nonatomic, strong)CADisplayLink *link;
@property(nonatomic, assign)CFTimeInterval timestamp;
@property(nonatomic, assign)NSInteger count;
@end
@implementation FMFPSLabel
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateLink:)];
[link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
self.link = link;
}
return self;
}
- (void)updateLink:(CADisplayLink *)link{
if (self.timestamp == 0) {
self.timestamp = link.timestamp;
return;
}
self.count ++;
// 两帧间隔时间
NSTimeInterval delta = link.timestamp - self.timestamp;
// 过滤刷新次数
if (delta < 1) return;
// 计算FPS
self.timestamp = link.timestamp;
float fps = self.count / delta;
self.count = 0;
self.text = [NSString stringWithFormat:@"%d FPS", (int)round(fps)];
}
@end
================================================
FILE: Example/FMLayoutKit/FMHorizontalLayoutController.h
================================================
//
// FMHorizontalLayoutController.h
// FMLayoutKit_Example
//
// Created by 周发明 on 2020/6/15.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMHorizontalLayoutController : UIViewController
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMHorizontalLayoutController.m
================================================
//
// FMHorizontalLayoutController.m
// FMLayoutKit_Example
//
// Created by 周发明 on 2020/6/15.
// Copyright © 2020 zhoufaming251@163.com. All rights reserved.
//
#import "FMHorizontalLayoutController.h"
#import
#import
#import "LS_HomeActivityCell.h"
#import "FMCollectionCustomDecoration.h"
#import "FMCollectionCustomCell.h"
#import "FMCollectionNavTitleView.h"
#import "FMViewController.h"
#import "FMFPSLabel.h"
@interface FMHorizontalLayoutController ()
@property(nonatomic, strong)NSMutableArray *shareSections;
@property(nonatomic, weak)FMLayoutView *collectionView;
@property(nonatomic, strong)NSMutableDictionary *fillSizeData;
@end
@implementation FMHorizontalLayoutController
- (void)viewDidLoad {
[super viewDidLoad];
// self.navigationItem.title = @"横向布局";
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"切换" style:UIBarButtonItemStyleDone target:self action:@selector(changeLayoutDirection)];
self.shareSections = [NSMutableArray array];
self.fillSizeData = [NSMutableDictionary dictionary];
// FMLayoutCloseLog()
__weak typeof(self) weakSelf = self;
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:10 lineSpace:10 column:2];
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header.type = FMLayoutHeaderTypeSuspensionAlways;
section.header.zIndex = FMLayoutZIndexFrontAlways;
section.header.isStickTop = YES;
// section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *custom = (FMCollectionCustomDecoration *)header;
custom.textLabel.text = @"第一个悬浮的顶部视图, 黏在顶部";
}];
section.footer = [FMLayoutFooter elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
// section.footer.inset = UIEdgeInsetsMake(10, 0, 10, 0);
section.footer.topMargin = 10;
section.background = [FMLayoutBackground bgWithViewClass:[UICollectionReusableView class]];
section.background.inset = UIEdgeInsetsMake(10, 10, 10, 10);
[section setConfigureBg:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull bg) {
bg.backgroundColor = [UIColor yellowColor];
}];
FMLayoutCrossSection *hSection = [FMLayoutCrossSection sectionAutoWithSection:section];
hSection.autoMaxSize = NO;
hSection.size = 300;
// [self.shareSections addObject:hSection];
}
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsZero itemSpace:10 lineSpace:10 column:3];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
section.header.lastMargin = 10;
section.header.type = FMLayoutHeaderTypeSuspensionAlways;
section.header.zIndex = FMLayoutZIndexFrontAlways;
section.header.isStickTop = NO;
// section.header.suspensionTopMargin = 50;
// section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
// section.isHorizontalCanScroll = YES;
section.itemSize = CGSizeMake(150, 100);
section.itemDatas = [@[@"1", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setClickCellBlock:^(FMLayoutBaseSection * _Nonnull section, NSInteger item) {
FMViewController *vc = [[FMViewController alloc] init];
[weakSelf.navigationController pushViewController:vc animated:YES];
}];
FMLayoutCrossSection *hSection = [FMLayoutCrossSection sectionAutoWithSection:section];
hSection.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
[hSection setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *custom = (FMCollectionCustomDecoration *)header;
custom.textLabel.text = @"FMLayoutFixedSection";
}];
// [self.shareSections addObject:hSection];
}
//
{
FMLayoutLabelSection *section = [FMLayoutLabelSection sectionWithSectionInset:UIEdgeInsetsMake(0, 10, 0, 10) itemSpace:10 lineSpace:10 column:3];
section.header = [FMLayoutHeader elementSize:30 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontOfItem;
section.header.type = FMLayoutHeaderTypeFixed;
section.header.lastMargin = 10;
// section.isSingleLineCanScroll = YES;
section.maxLine = 1;
section.cellFixedHeight = 40;
[section setWidthBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return item * 20 + 100;
}];
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
FMLayoutCrossSection *hSection = [FMLayoutCrossSection sectionAutoWithSection:section];
hSection.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
[hSection setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *custom = (FMCollectionCustomDecoration *)header;
custom.textLabel.text = @"FMLayoutLabelSection";
}];
// [self.shareSections addObject:hSection];
// [self.shareSections addObject:section];
}
// {
// FMLayoutSingleDynamicAddSection *section = [FMLayoutSingleDynamicAddSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:10 lineSpace:10 column:3];
//
// section.header = [FMLayoutHeader elementSize:150 viewClass:[FMCollectionCustomDecoration class]];
// section.header.zIndex = FMLayoutZIndexFrontOfItem;
// section.header.type = FMLayoutHeaderTypeFixed;
// section.header.lastMargin = 10;
//
// section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
// section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
// section.cellFixedSize = 100;
// [section setHeightBlock:^CGFloat(id _Nonnull section, NSInteger item) {
// return 100 + (item % 3) * 20;
// }];
// [self.shareSections addObject:section];
// self.secondSection = section;
// }
// {
// FMLayoutSingleDynamicAddSection *section = [FMLayoutSingleDynamicAddSection sectionWithSectionInset:UIEdgeInsetsMake(5, 15, 5, 15) itemSpace:10 lineSpace:10 column:2];
//
// section.cellFixedSize = 166;
// section.autoHeightFixedWidth = YES;
// section.itemDatas = [@[@1, @1, @1, @1, @1, @1] mutableCopy];
// section.cellElement = [FMLayoutElement elementWithViewClass:[LS_HomeActivityCell class]];
// __weak typeof(self) weakSelf = self;
// [section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
// if (item == 0) {
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
// return;
// }
// if (item == 1) {
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
// return;
// }
// if (item == 2) {
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述";
// return;
// }
// if (item == 3) {
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的";
// return;
// }
// ((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少";
// }];
// [self.shareSections addObject:section];
// }
{
FMLayoutAbsoluteSection *section = [FMLayoutAbsoluteSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:0 lineSpace:0 column:0];
section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setFrameBlock:^CGRect(id _Nonnull section, NSInteger item) {
switch (item) {
case 0:
return CGRectMake(0, 0, 100, 100);
case 1:
return CGRectMake(200, 100, 150, 100);
case 2:
return CGRectMake(100, 400, 400, 90);
default:
return CGRectZero;
break;
}
}];
FMLayoutCrossSection *hSection = [FMLayoutCrossSection sectionAutoWithSection:section];
hSection.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
[hSection setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *custom = (FMCollectionCustomDecoration *)header;
custom.textLabel.text = @"FMLayoutAbsoluteSection";
}];
// [self.shareSections addObject:hSection];
// [self.shareSections addObject:section];
}
// {
// FMLayoutAbsoluteSection *section = [FMLayoutAbsoluteSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:0 lineSpace:0 column:0];
//
// section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
// section.cellElements = @[[FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]]];
// [section setDeqCellReturnReuseId:^NSString * _Nonnull(FMLayoutDynamicSection * _Nonnull section, NSInteger index) {
// return [section.cellElements firstObject].reuseIdentifier;
// }];
// [section setFrameBlock:^CGRect(id _Nonnull section, NSInteger item) {
// switch (item) {
// case 0:
// return CGRectMake(0, 0, 100, 100);
// case 1:
// return CGRectMake(200, 100, 150, 100);
// case 2:
// return CGRectMake(100, 400, 400, 90);
// default:
// return CGRectZero;
// break;
// }
// }];
// [self.shareSections addObject:section];
// }
{
FMLayoutFillSection *section = [[FMLayoutFillSection alloc] init];
section.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10);
section.lineSpace = 10;
section.itemSpace = 10;
section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.header.suspensionTopMargin = 0;
// section.header.zIndex = FMLayoutZIndexFrontAlways;
// section.header.type = FMLayoutHeaderTypeSuspensionAlways;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
customHeader.textLabel.text = @"填充布局,寻找合适的空档,支持多种cell, header样式一直悬停在顶部";
}];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"3", @"1", @"2", @"3", @"3", @"1", @"2", @"3",] mutableCopy];
CGFloat leftWith = [UIScreen mainScreen].bounds.size.width - section.sectionInset.left - section.sectionInset.right;
CGFloat width1 = leftWith;
CGFloat width2 = (leftWith - section.itemSpace) * 0.5;
CGFloat width4 = (width2 - section.itemSpace) * 0.5;
CGFloat height2width4 = width4 * 2 + section.lineSpace;
[section setSizeBlock:^CGSize(id _Nonnull section, NSInteger item) {
if (item < 2) {
return CGSizeMake(width2, width2);
}
if (item < 4) {
return CGSizeMake(width4, width4);
}
if (item < 6) {
return CGSizeMake(width4, height2width4);
}
if (item < 7) {
return CGSizeMake(width2, width4);
}
if (item < 8) {
return CGSizeMake(width1, width4);
}
return CGSizeMake(width2, width2);
// switch (item) {
// case 2:
// return CGSizeMake(150, 140);
// case 5:
// return CGSizeMake((weakSelf.view.frame.size.width-20-150)/2, 70);
// case 8:
// case 11:
// return CGSizeMake(100, 240);
// case 10:
// return CGSizeMake(weakSelf.view.frame.size.width-20-200, 140);
// case 9:
// case 12:
// return CGSizeMake(weakSelf.view.frame.size.width-20-100, 100);
// case 0:
// case 1:
// case 3:
// case 4:
// return CGSizeMake((weakSelf.view.frame.size.width-20-150)/4, 70);
// default:
//// {
//// NSValue *value = weakSelf.fillSizeData[@(item)];
//// if (value == nil) {
//// value = [NSValue valueWithCGSize:CGSizeMake(FMLayoutRandomValue(100, 300), FMLayoutRandomValue(50, 200))];
//// weakSelf.fillSizeData[@(item)] = value;
//// }
//// return [value CGSizeValue];
//// }
// return CGSizeMake((weakSelf.view.frame.size.width-20-150)/4, 70);
// }
}];
// [section setConfigureCellLayoutAttributes:^(id _Nonnull section, UICollectionViewLayoutAttributes * _Nonnull attributes, NSInteger item) {
// if (item == 10) {
// attributes.transform = CGAffineTransformMakeRotation(M_PI_4);
// }
// }];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
FMCollectionCustomCell *customCell = (FMCollectionCustomCell *)cell;
customCell.label.text = [NSString stringWithFormat:@"%ld", item];
}];
// FMLayoutCrossSection *hSection = [FMLayoutCrossSection sectionAutoWithSection:section];
// hSection.autoMaxSize = NO;
// hSection.height = 500;
// hSection.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
// [hSection setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
// FMCollectionCustomDecoration *custom = (FMCollectionCustomDecoration *)header;
// custom.textLabel.text = @"FMLayoutFillSection";
// }];
// [self.shareSections addObject:hSection];
[self.shareSections addObject:section];
}
{
FMLayoutCrossSection *sections = [FMLayoutCrossSection sectionWithSectionInset:UIEdgeInsetsMake(10, 10, 10, 10) itemSpace:0 lineSpace:0 column:1];
sections.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
sections.header.lastMargin = 10;
// sections.size = 400;
sections.autoMaxSize = YES;
{
// {
// FMLayoutFillSection *section = [[FMLayoutFillSection alloc] init];
// section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3",] mutableCopy];
//
// section.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10);
//
// section.header = [FMLayoutHeader elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
// section.header.suspensionTopMargin = 0;
// section.header.zIndex = FMLayoutZIndexFrontAlways;
// section.header.type = FMLayoutHeaderTypeSuspensionAlways;
// [section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
// FMCollectionCustomDecoration *customHeader = (FMCollectionCustomDecoration *)header;
// customHeader.textLabel.text = @"填充布局,寻找合适的空档,支持多种cell, header样式一直悬停在顶部";
// }];
//
// section.cellElements = @[[FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]]];
// [section setDeqCellReturnReuseId:^NSString * _Nonnull(FMLayoutDynamicSection * _Nonnull section, NSInteger index) {
// return [section.cellElements firstObject].reuseIdentifier;
// }];
// [section setSizeBlock:^CGSize(id _Nonnull section, NSInteger item) {
// switch (item) {
// case 2:
// return CGSizeMake(150, 140.32);
// case 5:
// return CGSizeMake((weakSelf.view.frame.size.width-20-150)/2, 70.19);
// case 8:
// case 11:
// return CGSizeMake(100, 240);
// case 10:
// return CGSizeMake(weakSelf.view.frame.size.width-20-200, 140);
// case 9:
// case 12:
// return CGSizeMake(weakSelf.view.frame.size.width-20-100, 100);
// case 0:
// case 1:
// case 3:
// case 4:
// return CGSizeMake((weakSelf.view.frame.size.width-20-150)/4, 70.13);
// default:
// return CGSizeMake((weakSelf.view.frame.size.width-20-150)/4, 70.19);
// }
// }];
// // [section setConfigureCellLayoutAttributes:^(id _Nonnull section, UICollectionViewLayoutAttributes * _Nonnull attributes, NSInteger item) {
// // if (item == 10) {
// // attributes.transform = CGAffineTransformMakeRotation(M_PI_4);
// // }
// // }];
// [section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
// FMCollectionCustomCell *customCell = (FMCollectionCustomCell *)cell;
// customCell.label.text = [NSString stringWithFormat:@"%ld", item];
// }];
// [sections.sections addObject:section];
// }
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsZero itemSpace:10 lineSpace:10 column:3];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
section.header.lastMargin = 10;
section.header.type = FMLayoutHeaderTypeSuspensionBigger;
section.header.zIndex = FMLayoutZIndexFrontAlways;
section.header.minSize = 50;
section.header.maxSize = 200;
section.header.isStickTop = YES;
// section.header.suspensionTopMargin = 50;
// section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
FMCollectionCustomDecoration *custom = (FMCollectionCustomDecoration *)header;
custom.textLabel.text = @"第二个悬浮的顶部视图, 不黏在顶部";
}];
// section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
// section.footer.topMargin = 10;
// section.isHorizontalCanScroll = YES;
section.itemSize = CGSizeMake(150, 100);
section.itemDatas = [@[@"1", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
FMCollectionCustomCell *custom = (FMCollectionCustomCell *)cell;
custom.label.text = [NSString stringWithFormat:@"%ld", (long)item];
}];
[section setClickCellBlock:^(FMLayoutBaseSection * _Nonnull section, NSInteger item) {
}];
// [sections.sections addObject:section];
// [self.shareSections addObject:section];
}
//
// {
// FMLayoutLabelSection *section = [FMLayoutLabelSection sectionWithSectionInset:UIEdgeInsetsMake(0, 10, 0, 10) itemSpace:10 lineSpace:10 column:3];
//
// section.header = [FMLayoutHeader elementSize:30 viewClass:[FMCollectionCustomDecoration class]];
// section.header.zIndex = FMLayoutZIndexFrontOfItem;
// section.header.type = FMLayoutHeaderTypeFixed;
// section.header.lastMargin = 10;
//
//// section.maxLine = 1;
// section.cellFixedHeight = 40;
// [section setWidthBlock:^CGFloat(id _Nonnull section, NSInteger item) {
// return item * 20 + 100;
// }];
// section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
// section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
// [sections.sections addObject:section];
// }
// {
// FMLayoutAbsoluteSection *section = [FMLayoutAbsoluteSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:0 lineSpace:0 column:0];
//
// section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
// section.cellElements = @[[FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]]];
// [section setDeqCellReturnReuseId:^NSString * _Nonnull(FMLayoutDynamicSection * _Nonnull section, NSInteger index) {
// return [section.cellElements firstObject].reuseIdentifier;
// }];
// [section setFrameBlock:^CGRect(id _Nonnull section, NSInteger item) {
// switch (item) {
// case 0:
// return CGRectMake(0, 0, 100, 100);
// case 1:
// return CGRectMake(200, 100, 150, 100);
// case 2:
// return CGRectMake(100, 400, 400, 90);
// default:
// return CGRectZero;
// break;
// }
// }];
// [sections.sections addObject:section];
// }
// {
// FMLayoutLabelSection *section = [FMLayoutLabelSection sectionWithSectionInset:UIEdgeInsetsMake(0, 10, 0, 10) itemSpace:10 lineSpace:10 column:3];
//
// section.header = [FMLayoutHeader elementSize:30 viewClass:[FMCollectionCustomDecoration class]];
// section.header.zIndex = FMLayoutZIndexFrontOfItem;
// section.header.type = FMLayoutHeaderTypeFixed;
// section.header.lastMargin = 10;
//
// // section.isSingleLineCanScroll = YES;
// section.maxLine = 1;
// section.cellFixedHeight = 40;
// [section setWidthBlock:^CGFloat(id _Nonnull section, NSInteger item) {
// return item * 20 + 100;
// }];
// section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
// section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
// [sections.sections addObject:section];
// }
}
// [self.shareSections addObject:sections];
}
FMLayoutView *view = [[FMLayoutView alloc] initHorizontal];
self.automaticallyAdjustsScrollViewInsets = NO;
view.delegate = self;
// view.alwaysBounceVertical = YES;
[view.layout setSections:self.shareSections];
// view.layout.minContentSize = 1000;
view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:view];
[view mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(0);
make.top.mas_equalTo(100);
}];
self.collectionView = view;
}
- (void)changeLayoutDirection{
self.collectionView.layout.direction = self.collectionView.layout.direction == FMLayoutDirectionVertical ? FMLayoutDirectionHorizontal : FMLayoutDirectionVertical;
[self.collectionView reloadChangedSectionsData];
if (self.collectionView.layout.direction == FMLayoutDirectionVertical) {
self.collectionView.alwaysBounceVertical = YES;
self.collectionView.alwaysBounceHorizontal = NO;
} else {
self.collectionView.alwaysBounceVertical = NO;
self.collectionView.alwaysBounceHorizontal = YES;
}
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
/*
index path: ( {length = 2, path = 0 - 0}); frame = (10 10; 61 70); ,
index path: ( {length = 2, path = 0 - 1}); frame = (71 10; 61 70); ,
index path: ( {length = 2, path = 0 - 2}); frame = (132 10; 150 140); ,
index path: ( {length = 2, path = 0 - 3}); frame = (282 10; 61 70); ,
index path: ( {length = 2, path = 0 - 4}); frame = (343 10; 61 70); ,
index path: ( {length = 2, path = 0 - 5}); frame = (10 80; 122 70); ,
index path: ( {length = 2, path = 0 - 6}); frame = (282 80; 61 70); ,
index path: ( {length = 2, path = 0 - 7}); frame = (343 80; 61 70); ,
index path: ( {length = 2, path = 0 - 8}); frame = (10 150; 100 240); ,
index path: ( {length = 2, path = 0 - 9}); frame = (110 150; 294 100); ,
index path: ( {length = 2, path = 0 - 10}); frame = (110 250; 194 140); ,
index path: ( {length = 2, path = 0 - 11}); frame = (304 250; 100 240); ,
index path: ( {length = 2, path = 0 - 12}); frame = (10 390; 294 100); ,
index path: ( {length = 2, path = 0 - 13}); frame = (10 490; 61 70); ,
index path: ( {length = 2, path = 0 - 14}); frame = (71 490; 61 70); ,
index path: ( {length = 2, path = 0 - 15}); frame = (132 490; 61 70); ,
index path: ( {length = 2, path = 0 - 16}); frame = (193 490; 61 70); ,
index path: ( {length = 2, path = 0 - 17}); frame = (254 490; 61 70); ,
index path: ( {length = 2, path = 0 - 18}); frame = (315 490; 61 70);
*/
}
@end
================================================
FILE: Example/FMLayoutKit/FMLayoutKit-Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleDisplayName
$(PRODUCT_NAME)
CFBundleExecutable
${EXECUTABLE_NAME}
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
${PRODUCT_NAME}
CFBundlePackageType
APPL
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
1.0
LSRequiresIPhoneOS
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
Main
UIRequiredDeviceCapabilities
armv7
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UISupportedInterfaceOrientations~ipad
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
================================================
FILE: Example/FMLayoutKit/FMLayoutKit-Prefix.pch
================================================
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#import
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
@import UIKit;
@import Foundation;
#endif
================================================
FILE: Example/FMLayoutKit/FMLayoutLabel.h
================================================
//
// FMLayoutLabel.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/23.
// Copyright © 2020 周发明. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutLabel : UILabel
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/FMLayoutLabel.m
================================================
//
// FMLayoutLabel.m
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/23.
// Copyright © 2020 周发明. All rights reserved.
//
#import "FMLayoutLabel.h"
@interface FMLayoutLabel ()
@property(nonatomic, assign)BOOL isLayoutSubviews;
@property(nonatomic, assign)BOOL isAttributeText;
@end
@implementation FMLayoutLabel
- (void)setText:(NSString *)text{
[super setText:text];
self.isAttributeText = NO;
if (self.isLayoutSubviews) {
[self updateFillSize];
}
}
- (void)setAttributedText:(NSAttributedString *)attributedText{
[super setAttributedText:attributedText];
self.isAttributeText = YES;
if (self.isLayoutSubviews) {
[self updateFillSize];
}
}
- (void)setFont:(UIFont *)font{
[super setFont:font];
if (self.isLayoutSubviews) {
[self updateFillSize];
}
}
- (void)layoutSubviews{
[super layoutSubviews];
self.isLayoutSubviews = YES;
[self updateFillSize];
}
- (void)updateFillSize{
CGSize size = CGSizeZero;
if (self.isAttributeText && self.attributedText != nil) {
CGFloat height = [self.attributedText boundingRectWithSize:CGSizeMake(self.bounds.size.width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:nil].size.height;
size = [self sizeThatFits:CGSizeMake(self.bounds.size.width, height)];
}
if (!self.isAttributeText && self.text != nil) {
CGFloat height = [self.text boundingRectWithSize:CGSizeMake(self.bounds.size.width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:self.font} context:nil].size.height;
size = [self sizeThatFits:CGSizeMake(self.bounds.size.width, height)];
}
NSLog(@"updateFillSize %@", [NSValue valueWithCGSize:size]);
}
@end
================================================
FILE: Example/FMLayoutKit/FMViewController.h
================================================
//
// FMViewController.h
// FMCollectionLayout
//
// Created by 周发明 on 04/01/2020.
// Copyright (c) 2020 周发明. All rights reserved.
//
@import UIKit;
@interface FMViewController : UIViewController
@end
================================================
FILE: Example/FMLayoutKit/FMViewController.m
================================================
//
// FMViewController.m
// FMLayoutKit
//
// Created by zhoufaming251@163.com on 06/09/2020.
// Copyright (c) 2020 zhoufaming251@163.com. All rights reserved.
//
#import "FMViewController.h"
#import
#import
#import "FMCollectionCustomDecoration.h"
#import "FMCollectionCustomCell.h"
#import "FMCollectionNavTitleView.h"
#import "FMCollViewController.h"
#import "LS_HomeActivityCell.h"
#import "FMFPSLabel.h"
@interface FMViewController ()
@property(nonatomic, strong)NSMutableArray *shareSections;
@property(nonatomic, strong)NSMutableArray *sections;
@property(nonatomic, weak)FMTeslaLayoutView *multiScreen;
@property(nonatomic, weak)FMCollectionNavTitleView *navTitleView;
@property(nonatomic, weak)UILabel *fpsLabel;
@property(nonatomic, assign)BOOL hasAdd;
@end
@implementation FMViewController
- (FMTeslaLayoutView *)multiScreen{
if (_multiScreen == nil) {
FMTeslaLayoutView *multi = [[FMTeslaLayoutView alloc] init];
multi.selectIndex = 2;
multi.delegate = self;
multi.dataSource = self;
// multi.clipsToBounds = YES;
// multi.allShareStickTop = YES;
[self.view addSubview:multi];
_multiScreen = multi;
}
return _multiScreen;
}
- (void)setNavTitleView:(FMCollectionNavTitleView *)navTitleView{
if (_navTitleView == nil) {
[navTitleView selectWithIndex:self.multiScreen.selectIndex];
}
_navTitleView = navTitleView;
__weak typeof(self) weakSelf = self;
[navTitleView setClickBlock:^(NSInteger tag) {
[weakSelf.multiScreen scrollToIndex:tag animated:YES];
}];
}
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
if (!self.fpsLabel) {
FMFPSLabel *label = [[FMFPSLabel alloc] initWithFrame:CGRectMake(40, 50, 100, 20)];
[self.view.window addSubview:label];
self.fpsLabel = label;
}
}
- (void)add{
self.hasAdd = YES;
[self.multiScreen reLoadSubViews];
}
- (void)viewDidLoad {
[super viewDidLoad];
// self.navigationItem.title = @"特斯拉布局";
self.automaticallyAdjustsScrollViewInsets = NO;
UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithTitle:@"添加刷新" style:UIBarButtonItemStyleDone target:self action:@selector(add)];
self.navigationItem.rightBarButtonItem = item1;
self.shareSections = [NSMutableArray array];
self.sections = [NSMutableArray array];
__weak typeof(self) weakSelf = self;
// [FMLayoutDebugLog closeLog];
// FMLayoutOpenLog();
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(5, 15, 5, 15) itemSpace:10 lineSpace:10 column:2];
section.cellFixedSize = 166;
section.autoHeightFixedWidth = YES;
//
section.itemDatas = [@[@1, @1, @1, @1, @1, @1] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[LS_HomeActivityCell class]];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
if (item == 0) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
return;
}
if (item == 1) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的";
return;
}
if (item == 2) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述";
return;
}
if (item == 3) {
((LS_HomeActivityCell *)cell).introLabel.text = @" 一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少\n离开时尽量少肯德基分离式的";
} else {
((LS_HomeActivityCell *)cell).introLabel.text = @"asdjlakjdlaksjdlakjdlask";
}
}];
[self.shareSections addObject:section];
}
{
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(0, 15, 15, 15) itemSpace:10 lineSpace:10 column:2];
section.hidden = YES;
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
section.header.lastMargin = 10;
// section.header.type = FMSupplementaryTypeSuspensionAlways;
// section.header.isStickTop = YES;
section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
// section.footer = [FMSupplementaryFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
// section.footer.topMargin = 10;
section.itemSize = CGSizeMake(100, 100);
section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
FMCollectionCustomCell *customCell = (FMCollectionCustomCell *)cell;
customCell.contentView.backgroundColor = [UIColor yellowColor];
}];
[section setClickCellBlock:^(FMLayoutBaseSection * _Nonnull section, NSInteger item) {
FMCollViewController *vc = [[FMCollViewController alloc] init];
[weakSelf.navigationController pushViewController:vc animated:YES];
}];
[self.shareSections addObject:section];
}
// {
// FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:10 lineSpace:10 column:3];
//
// section.header = [FMSupplementaryHeader elementSize:150 viewClass:[FMCollectionCustomDecoration class]];
// section.header.zIndex = FMLayoutZIndexFrontOfItem;
// section.header.type = FMSupplementaryTypeFixed;
// section.header.lastMargin = 10;
//
// section.isHorizontalCanScroll = YES;
// section.itemSize = CGSizeMake(150, 100);
// section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
// section.cellElement = [FMCollectionViewElement elementWithViewClass:[FMCollectionCustomCell class]];
// [section setConfigureCellData:^(FMLayoutBaseSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger item) {
//
// }];
// [self.shareSections addObject:section];
// }
//
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:0 lineSpace:10 column:1];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionNavTitleView class]];
section.header.type = FMLayoutHeaderTypeSuspensionAlways;
section.header.zIndex = FMLayoutZIndexFrontAlways;
// section.header.isStickTop = YES;
[section setConfigureHeaderData:^(FMLayoutBaseSection * _Nonnull section, UICollectionReusableView * _Nonnull header) {
weakSelf.navTitleView = (FMCollectionNavTitleView *)header;
}];
[self.shareSections addObject:section];
}
// self.multiScreen.shareSections = self.shareSections;
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:0 lineSpace:10 column:1];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
section.header.lastMargin = 10;
// section.header.suspensionTopHeight = 70;
// section.header.type = FMSupplementaryTypeSuspensionAlways;
// section.header.zIndex = FMLayoutZIndexFrontAlways;
// section.header.isStickTop = YES;
section.header.inset = UIEdgeInsetsMake(0, -15, 0, -15);
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemDatas = [@[@"1", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
section.cellFixedSize = [UIScreen mainScreen].bounds.size.width;
[section setOtherBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return 100 + item * 100;
}];
[self.sections addObject:section];
}
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(10, 0, 0, 0) itemSpace:10 lineSpace:10 column:2];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
section.header.lastMargin = 10;
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemDatas = [@[@"1", @"2", @"3", @"2", @"3", @"2", @"3"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
section.cellFixedSize = ([UIScreen mainScreen].bounds.size.width - 10) * 0.5;
[section setOtherBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return 100 + item * 30;
}];
__weak typeof(self) weakSelf = self;
[section setClickCellBlock:^(FMLayoutBaseSection * _Nonnull section, NSInteger item) {
FMCollViewController *vc = [[FMCollViewController alloc] init];
[weakSelf.navigationController pushViewController:vc animated:YES];
}];
FMLayoutCrossSection *horSection = [FMLayoutCrossSection sectionAutoWithSection:section];
[horSection setConfigureCollectionView:^(UICollectionView * _Nonnull collectionView, FMLayoutCrossSection *inSection) {
collectionView.pagingEnabled = YES;
}];
[self.sections addObject:horSection];
}
{
FMLayoutDynamicSection *section = [FMLayoutDynamicSection sectionWithSectionInset:UIEdgeInsetsMake(10, 0, 0, 0) itemSpace:10 lineSpace:10 column:2];
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
section.header.lastMargin = 10;
section.footer = [FMLayoutFooter elementSize:50 viewClass:[FMCollectionCustomDecoration class]];
section.footer.topMargin = 10;
section.itemDatas = [@[@"1\n1", @"2\n2\n2", @"3", @"2\n2\n2\n2\n2\n2\n2\n2\n2", @"3\n2\n2\n2\n2", @"2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2", @"3\n2\n2"] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
section.cellFixedSize = ([UIScreen mainScreen].bounds.size.width - 10) * 0.5;
section.autoHeightFixedWidth = YES;
__weak typeof(self) weakSelf = self;
[section setConfigurationCell:^(FMLayoutDynamicSection * _Nonnull section, UICollectionViewCell * _Nonnull cell, NSInteger index) {
FMCollectionCustomCell *custom = (FMCollectionCustomCell *)cell;
custom.label.text = section.itemDatas[index];
// [weakSelf tesla:nil configurationCell:cell indexPath:[NSIndexPath indexPathForItem:index inSection:section.indexPath.section] isShare:NO multiIndex:0 layoutView:nil];
}];
// [self.sections addObject:section];
}
//
{
FMLayoutLabelSection *section = [FMLayoutLabelSection sectionWithSectionInset:UIEdgeInsetsMake(0, 0, 0, 0) itemSpace:10 lineSpace:10 column:3];
section.header = [FMLayoutHeader elementSize:30 viewClass:[FMCollectionCustomDecoration class]];
section.header.zIndex = FMLayoutZIndexFrontOfItem;
section.header.type = FMLayoutHeaderTypeFixed;
section.header.lastMargin = 10;
// section.isSingleLineCanScroll = YES;
section.maxLine = 6;
section.cellFixedHeight = 40;
[section setWidthBlock:^CGFloat(id _Nonnull section, NSInteger item) {
return item * 20 + 100;
}];
section.itemDatas = [@[@"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", @"1", @"2", @"3", ] mutableCopy];
section.cellElement = [FMLayoutElement elementWithViewClass:[FMCollectionCustomCell class]];
[self.sections addObject:section];
}
//
self.view.backgroundColor = [UIColor cyanColor];
[self.multiScreen reLoadSubViews];
[self.multiScreen reloadData];
}
- (void)viewWillLayoutSubviews{
[super viewWillLayoutSubviews];
self.multiScreen.frame = CGRectMake(0, 100, self.view.bounds.size.width, self.view.bounds.size.height - 100);
}
- (CGFloat)shareSuspensionMinHeightWithTesla:(FMTeslaLayoutView *)tesla{
return 70;
}
- (void)tesla:(FMTeslaLayoutView *)tesla willCreateScrollViewWithIndex:(NSInteger)index{
NSLog(@"willCreateLayoutViewWithIndex %ld", (long)index);
}
- (void)tesla:(FMTeslaLayoutView *)tesla didCreatedScrollViewWithIndex:(NSInteger)index scrollView:(UIScrollView *)scrollView{
if ([scrollView isKindOfClass:[FMLayoutView class]]) {
((FMLayoutView *)scrollView).sections = [self.sections mutableCopy];
}
NSLog(@"didCreatedLayoutViewWithIndex %ld", (long)index);
}
- (UIScrollView *)tesla:(FMTeslaLayoutView *)tesla customCreateWithIndex:(NSInteger)index shareHeight:(CGFloat)shareHeight{
if (index == 3) {
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, shareHeight + 100)];
header.backgroundColor = [UIColor purpleColor];
tableView.tableHeaderView = header;
UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 1000)];
footer.backgroundColor = [UIColor orangeColor];
tableView.tableFooterView = footer;
return tableView;
}
return nil;
}
- (void)tesla:(FMTeslaLayoutView *)tesla didScrollEnd:(NSInteger)index currentScrollView:(nonnull FMLayoutView *)layoutView{
[self.navTitleView selectWithIndex:index];
}
- (NSInteger)numberOfScreenInTesla:(nonnull FMTeslaLayoutView *)tesla {
return self.hasAdd ? 4 : 0;
}
- (NSArray *)shareSectionsInTesla:(FMTeslaLayoutView *)tesla{
return self.shareSections;
}
@end
================================================
FILE: Example/FMLayoutKit/Images.xcassets/AppIcon.appiconset/Contents.json
================================================
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Example/FMLayoutKit/Images.xcassets/Contents.json
================================================
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Example/FMLayoutKit/Images.xcassets/timg.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "timg.jpeg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Example/FMLayoutKit/LS_HomeActivityCell.h
================================================
//
// LS_HomeActivityCell.h
// LiangShanApp
//
// Created by 周发明 on 2020/4/9.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface LS_HomeActivityCell : UICollectionViewCell
@property(nonatomic, weak)UIImageView *leftImageView;
@property(nonatomic, weak)UILabel *introLabel;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKit/LS_HomeActivityCell.m
================================================
//
// LS_HomeActivityCell.m
// LiangShanApp
//
// Created by 周发明 on 2020/4/9.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "LS_HomeActivityCell.h"
#import
#import "FMLayoutLabel.h"
@implementation LS_HomeActivityCell
- (void)dealloc{
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.contentView.backgroundColor = [UIColor cyanColor];
UILabel *title = [[UILabel alloc] init];
title.text = @"大标题";
title.font = [UIFont systemFontOfSize:18];
[self.contentView addSubview:title];
[title mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(0);
make.top.mas_equalTo(15);
}];
UILabel *detail = [[UILabel alloc] init];
detail.text = @"小标题";
detail.font = [UIFont systemFontOfSize:14];
[self.contentView addSubview:detail];
[detail mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(0);
make.top.mas_equalTo(title.mas_bottom).offset(5);
}];
UIImageView *left = [[UIImageView alloc] init];
left.backgroundColor = [UIColor redColor];
[self.contentView addSubview:left];
[left mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.top.mas_equalTo(detail.mas_bottom).offset(9);
make.width.height.mas_equalTo(81);
}];
self.leftImageView = left;
UIImageView *right = [[UIImageView alloc] init];
right.backgroundColor = [UIColor blueColor];
[self.contentView addSubview:right];
[right mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(left.mas_right).offset(5);
make.top.mas_equalTo(left);
make.width.height.mas_equalTo(81);
}];
UILabel *intro = [[UILabel alloc] init];
intro.preferredMaxLayoutWidth = 166;
intro.numberOfLines = 0;
// intro.text = @"一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的\n";
intro.text = @"一些描述";
[self.contentView addSubview:intro];
[intro mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.right.mas_equalTo(0);
make.top.mas_equalTo(left.mas_bottom);
make.bottom.mas_equalTo(-10);
}];
self.introLabel = intro;
}
return self;
}
@end
================================================
FILE: Example/FMLayoutKit/en.lproj/InfoPlist.strings
================================================
/* Localized versions of Info.plist keys */
================================================
FILE: Example/FMLayoutKit/main.m
================================================
//
// main.m
// FMLayoutKit
//
// Created by zhoufaming251@163.com on 06/09/2020.
// Copyright (c) 2020 zhoufaming251@163.com. All rights reserved.
//
@import UIKit;
#import "FMAppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([FMAppDelegate class]));
}
}
================================================
FILE: Example/FMLayoutKit.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
3BFF6A316B994187A788CFD9 /* Pods_FMLayoutKit_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05923D8C8C630E1B426CA144 /* Pods_FMLayoutKit_Tests.framework */; };
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
6003F59E195388D20070C39A /* FMAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* FMAppDelegate.m */; };
6003F5A7195388D20070C39A /* FMViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* FMViewController.m */; };
6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; };
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
ADA669444312E818D0F6D99C /* Pods_FMLayoutKit_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E1FF4A9BE374E5DE19B3342 /* Pods_FMLayoutKit_Example.framework */; };
C34E984F2497A9ED00E8EC44 /* FMCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C34E984D2497A9ED00E8EC44 /* FMCollectionViewCell.m */; };
C34E98502497A9ED00E8EC44 /* FMCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C34E984E2497A9ED00E8EC44 /* FMCollectionViewCell.xib */; };
C34E98532497ABE600E8EC44 /* FMHorizontalLayoutController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34E98522497ABE600E8EC44 /* FMHorizontalLayoutController.m */; };
C385261024AC6AAE00386DBB /* FMFPSLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = C385260F24AC6AAE00386DBB /* FMFPSLabel.m */; };
C3973877248F705000A7A2C2 /* FMCollectionCustomDecoration.m in Sources */ = {isa = PBXBuildFile; fileRef = C3973867248F704E00A7A2C2 /* FMCollectionCustomDecoration.m */; };
C3973878248F705000A7A2C2 /* FMCollViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C397386F248F704F00A7A2C2 /* FMCollViewController.m */; };
C3973879248F705000A7A2C2 /* FMAddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C3973870248F704F00A7A2C2 /* FMAddViewController.m */; };
C397387A248F705000A7A2C2 /* FMCollectionNavTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = C3973871248F704F00A7A2C2 /* FMCollectionNavTitleView.m */; };
C397387B248F705000A7A2C2 /* FMExcuteTimeTool.m in Sources */ = {isa = PBXBuildFile; fileRef = C3973872248F704F00A7A2C2 /* FMExcuteTimeTool.m */; };
C397387C248F705000A7A2C2 /* FMCollectionCustomCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C3973873248F704F00A7A2C2 /* FMCollectionCustomCell.m */; };
C397387D248F705000A7A2C2 /* FMLayoutLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = C3973874248F705000A7A2C2 /* FMLayoutLabel.m */; };
C397387E248F705000A7A2C2 /* LS_HomeActivityCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C3973875248F705000A7A2C2 /* LS_HomeActivityCell.m */; };
C399E9A324AEC11D00353B76 /* FMAotuSizeReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = C399E9A224AEC11D00353B76 /* FMAotuSizeReusableView.m */; };
C3C47B9F24BAC2810020C071 /* FMCombineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C47B9E24BAC2810020C071 /* FMCombineViewController.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6003F582195388D10070C39A /* Project object */;
proxyType = 1;
remoteGlobalIDString = 6003F589195388D20070C39A;
remoteInfo = FMLayoutKit;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
04E8703A16484F3E1A933C88 /* FMLayoutKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = FMLayoutKit.podspec; path = ../FMLayoutKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
05923D8C8C630E1B426CA144 /* Pods_FMLayoutKit_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FMLayoutKit_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0C1C4C8575B73D703C9D0B5D /* Pods-FMLayoutKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FMLayoutKit_Example.debug.xcconfig"; path = "Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example.debug.xcconfig"; sourceTree = ""; };
17F812EE8B554502C8DA01FA /* Pods-FMLayoutKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FMLayoutKit_Example.release.xcconfig"; path = "Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example.release.xcconfig"; sourceTree = ""; };
26DEFFE1DA7457947895DDDC /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; };
2A07CACD9869F5819B6A0803 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; };
3E1FF4A9BE374E5DE19B3342 /* Pods_FMLayoutKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FMLayoutKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4ECA8A4093CF864F4FA6C5CA /* Pods-FMLayoutKit_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FMLayoutKit_Tests.debug.xcconfig"; path = "Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests.debug.xcconfig"; sourceTree = ""; };
6003F58A195388D20070C39A /* FMLayoutKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FMLayoutKit.app; sourceTree = BUILT_PRODUCTS_DIR; };
6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
6003F595195388D20070C39A /* FMLayoutKit-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FMLayoutKit-Info.plist"; sourceTree = ""; };
6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
6003F59B195388D20070C39A /* FMLayoutKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FMLayoutKit-Prefix.pch"; sourceTree = ""; };
6003F59C195388D20070C39A /* FMAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMAppDelegate.h; sourceTree = ""; };
6003F59D195388D20070C39A /* FMAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FMAppDelegate.m; sourceTree = ""; };
6003F5A5195388D20070C39A /* FMViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMViewController.h; sourceTree = ""; };
6003F5A6195388D20070C39A /* FMViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FMViewController.m; sourceTree = ""; };
6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
6003F5AE195388D20070C39A /* FMLayoutKit_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FMLayoutKit_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; };
6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; };
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; };
71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; };
A8EFB03ECBAF6C997935840C /* Pods-FMLayoutKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FMLayoutKit_Tests.release.xcconfig"; path = "Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests.release.xcconfig"; sourceTree = ""; };
C34E984C2497A9ED00E8EC44 /* FMCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMCollectionViewCell.h; sourceTree = ""; };
C34E984D2497A9ED00E8EC44 /* FMCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FMCollectionViewCell.m; sourceTree = ""; };
C34E984E2497A9ED00E8EC44 /* FMCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FMCollectionViewCell.xib; sourceTree = ""; };
C34E98512497ABE600E8EC44 /* FMHorizontalLayoutController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMHorizontalLayoutController.h; sourceTree = ""; };
C34E98522497ABE600E8EC44 /* FMHorizontalLayoutController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FMHorizontalLayoutController.m; sourceTree = ""; };
C385260E24AC6AAE00386DBB /* FMFPSLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMFPSLabel.h; sourceTree = ""; };
C385260F24AC6AAE00386DBB /* FMFPSLabel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FMFPSLabel.m; sourceTree = ""; };
C3973867248F704E00A7A2C2 /* FMCollectionCustomDecoration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMCollectionCustomDecoration.m; sourceTree = ""; };
C3973868248F704F00A7A2C2 /* FMCollectionNavTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMCollectionNavTitleView.h; sourceTree = ""; };
C3973869248F704F00A7A2C2 /* FMCollectionCustomCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMCollectionCustomCell.h; sourceTree = ""; };
C397386A248F704F00A7A2C2 /* FMAddViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMAddViewController.h; sourceTree = ""; };
C397386B248F704F00A7A2C2 /* FMExcuteTimeTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMExcuteTimeTool.h; sourceTree = ""; };
C397386C248F704F00A7A2C2 /* FMLayoutLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMLayoutLabel.h; sourceTree = ""; };
C397386D248F704F00A7A2C2 /* LS_HomeActivityCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LS_HomeActivityCell.h; sourceTree = ""; };
C397386E248F704F00A7A2C2 /* FMCollViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMCollViewController.h; sourceTree = ""; };
C397386F248F704F00A7A2C2 /* FMCollViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMCollViewController.m; sourceTree = ""; };
C3973870248F704F00A7A2C2 /* FMAddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMAddViewController.m; sourceTree = ""; };
C3973871248F704F00A7A2C2 /* FMCollectionNavTitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMCollectionNavTitleView.m; sourceTree = ""; };
C3973872248F704F00A7A2C2 /* FMExcuteTimeTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMExcuteTimeTool.m; sourceTree = ""; };
C3973873248F704F00A7A2C2 /* FMCollectionCustomCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMCollectionCustomCell.m; sourceTree = ""; };
C3973874248F705000A7A2C2 /* FMLayoutLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMLayoutLabel.m; sourceTree = ""; };
C3973875248F705000A7A2C2 /* LS_HomeActivityCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LS_HomeActivityCell.m; sourceTree = ""; };
C3973876248F705000A7A2C2 /* FMCollectionCustomDecoration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMCollectionCustomDecoration.h; sourceTree = ""; };
C399E9A124AEC11D00353B76 /* FMAotuSizeReusableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMAotuSizeReusableView.h; sourceTree = ""; };
C399E9A224AEC11D00353B76 /* FMAotuSizeReusableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FMAotuSizeReusableView.m; sourceTree = ""; };
C3C47B9D24BAC2810020C071 /* FMCombineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMCombineViewController.h; sourceTree = ""; };
C3C47B9E24BAC2810020C071 /* FMCombineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FMCombineViewController.m; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
6003F587195388D20070C39A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
ADA669444312E818D0F6D99C /* Pods_FMLayoutKit_Example.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AB195388D20070C39A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
3BFF6A316B994187A788CFD9 /* Pods_FMLayoutKit_Tests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6003F581195388D10070C39A = {
isa = PBXGroup;
children = (
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */,
6003F593195388D20070C39A /* Example for FMLayoutKit */,
6003F5B5195388D20070C39A /* Tests */,
6003F58C195388D20070C39A /* Frameworks */,
6003F58B195388D20070C39A /* Products */,
700796DF9A3CFC35B3E6E2B9 /* Pods */,
);
sourceTree = "";
};
6003F58B195388D20070C39A /* Products */ = {
isa = PBXGroup;
children = (
6003F58A195388D20070C39A /* FMLayoutKit.app */,
6003F5AE195388D20070C39A /* FMLayoutKit_Tests.xctest */,
);
name = Products;
sourceTree = "";
};
6003F58C195388D20070C39A /* Frameworks */ = {
isa = PBXGroup;
children = (
6003F58D195388D20070C39A /* Foundation.framework */,
6003F58F195388D20070C39A /* CoreGraphics.framework */,
6003F591195388D20070C39A /* UIKit.framework */,
6003F5AF195388D20070C39A /* XCTest.framework */,
3E1FF4A9BE374E5DE19B3342 /* Pods_FMLayoutKit_Example.framework */,
05923D8C8C630E1B426CA144 /* Pods_FMLayoutKit_Tests.framework */,
);
name = Frameworks;
sourceTree = "";
};
6003F593195388D20070C39A /* Example for FMLayoutKit */ = {
isa = PBXGroup;
children = (
6003F59C195388D20070C39A /* FMAppDelegate.h */,
6003F59D195388D20070C39A /* FMAppDelegate.m */,
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
6003F5A5195388D20070C39A /* FMViewController.h */,
6003F5A6195388D20070C39A /* FMViewController.m */,
C397386A248F704F00A7A2C2 /* FMAddViewController.h */,
C3973870248F704F00A7A2C2 /* FMAddViewController.m */,
C34E98512497ABE600E8EC44 /* FMHorizontalLayoutController.h */,
C34E98522497ABE600E8EC44 /* FMHorizontalLayoutController.m */,
C3C47B9D24BAC2810020C071 /* FMCombineViewController.h */,
C3C47B9E24BAC2810020C071 /* FMCombineViewController.m */,
C3973869248F704F00A7A2C2 /* FMCollectionCustomCell.h */,
C3973873248F704F00A7A2C2 /* FMCollectionCustomCell.m */,
C3973876248F705000A7A2C2 /* FMCollectionCustomDecoration.h */,
C3973867248F704E00A7A2C2 /* FMCollectionCustomDecoration.m */,
C3973868248F704F00A7A2C2 /* FMCollectionNavTitleView.h */,
C3973871248F704F00A7A2C2 /* FMCollectionNavTitleView.m */,
C397386E248F704F00A7A2C2 /* FMCollViewController.h */,
C397386F248F704F00A7A2C2 /* FMCollViewController.m */,
C397386B248F704F00A7A2C2 /* FMExcuteTimeTool.h */,
C3973872248F704F00A7A2C2 /* FMExcuteTimeTool.m */,
C397386C248F704F00A7A2C2 /* FMLayoutLabel.h */,
C3973874248F705000A7A2C2 /* FMLayoutLabel.m */,
C385260E24AC6AAE00386DBB /* FMFPSLabel.h */,
C385260F24AC6AAE00386DBB /* FMFPSLabel.m */,
C397386D248F704F00A7A2C2 /* LS_HomeActivityCell.h */,
C3973875248F705000A7A2C2 /* LS_HomeActivityCell.m */,
C399E9A124AEC11D00353B76 /* FMAotuSizeReusableView.h */,
C399E9A224AEC11D00353B76 /* FMAotuSizeReusableView.m */,
C34E984C2497A9ED00E8EC44 /* FMCollectionViewCell.h */,
C34E984D2497A9ED00E8EC44 /* FMCollectionViewCell.m */,
C34E984E2497A9ED00E8EC44 /* FMCollectionViewCell.xib */,
71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */,
6003F5A8195388D20070C39A /* Images.xcassets */,
6003F594195388D20070C39A /* Supporting Files */,
);
name = "Example for FMLayoutKit";
path = FMLayoutKit;
sourceTree = "";
};
6003F594195388D20070C39A /* Supporting Files */ = {
isa = PBXGroup;
children = (
6003F595195388D20070C39A /* FMLayoutKit-Info.plist */,
6003F596195388D20070C39A /* InfoPlist.strings */,
6003F599195388D20070C39A /* main.m */,
6003F59B195388D20070C39A /* FMLayoutKit-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "";
};
6003F5B5195388D20070C39A /* Tests */ = {
isa = PBXGroup;
children = (
6003F5BB195388D20070C39A /* Tests.m */,
6003F5B6195388D20070C39A /* Supporting Files */,
);
path = Tests;
sourceTree = "";
};
6003F5B6195388D20070C39A /* Supporting Files */ = {
isa = PBXGroup;
children = (
6003F5B7195388D20070C39A /* Tests-Info.plist */,
6003F5B8195388D20070C39A /* InfoPlist.strings */,
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "";
};
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = {
isa = PBXGroup;
children = (
04E8703A16484F3E1A933C88 /* FMLayoutKit.podspec */,
26DEFFE1DA7457947895DDDC /* README.md */,
2A07CACD9869F5819B6A0803 /* LICENSE */,
);
name = "Podspec Metadata";
sourceTree = "";
};
700796DF9A3CFC35B3E6E2B9 /* Pods */ = {
isa = PBXGroup;
children = (
0C1C4C8575B73D703C9D0B5D /* Pods-FMLayoutKit_Example.debug.xcconfig */,
17F812EE8B554502C8DA01FA /* Pods-FMLayoutKit_Example.release.xcconfig */,
4ECA8A4093CF864F4FA6C5CA /* Pods-FMLayoutKit_Tests.debug.xcconfig */,
A8EFB03ECBAF6C997935840C /* Pods-FMLayoutKit_Tests.release.xcconfig */,
);
path = Pods;
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
6003F589195388D20070C39A /* FMLayoutKit_Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "FMLayoutKit_Example" */;
buildPhases = (
F6034618A8944DCB8BA13160 /* [CP] Check Pods Manifest.lock */,
6003F586195388D20070C39A /* Sources */,
6003F587195388D20070C39A /* Frameworks */,
6003F588195388D20070C39A /* Resources */,
873C41F871FCACDC54DB3051 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = FMLayoutKit_Example;
productName = FMLayoutKit;
productReference = 6003F58A195388D20070C39A /* FMLayoutKit.app */;
productType = "com.apple.product-type.application";
};
6003F5AD195388D20070C39A /* FMLayoutKit_Tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "FMLayoutKit_Tests" */;
buildPhases = (
70D615FDCB17048872CB0778 /* [CP] Check Pods Manifest.lock */,
6003F5AA195388D20070C39A /* Sources */,
6003F5AB195388D20070C39A /* Frameworks */,
6003F5AC195388D20070C39A /* Resources */,
);
buildRules = (
);
dependencies = (
6003F5B4195388D20070C39A /* PBXTargetDependency */,
);
name = FMLayoutKit_Tests;
productName = FMLayoutKitTests;
productReference = 6003F5AE195388D20070C39A /* FMLayoutKit_Tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
6003F582195388D10070C39A /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = FM;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "zhoufaming251@163.com";
TargetAttributes = {
6003F589195388D20070C39A = {
DevelopmentTeam = T82JQ7P486;
};
6003F5AD195388D20070C39A = {
TestTargetID = 6003F589195388D20070C39A;
};
};
};
buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "FMLayoutKit" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
mainGroup = 6003F581195388D10070C39A;
productRefGroup = 6003F58B195388D20070C39A /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
6003F589195388D20070C39A /* FMLayoutKit_Example */,
6003F5AD195388D20070C39A /* FMLayoutKit_Tests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
6003F588195388D20070C39A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
C34E98502497A9ED00E8EC44 /* FMCollectionViewCell.xib in Resources */,
6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AC195388D20070C39A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
70D615FDCB17048872CB0778 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-FMLayoutKit_Tests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
873C41F871FCACDC54DB3051 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/FMLayoutKit/FMLayoutKit.framework",
"${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMLayoutKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
F6034618A8944DCB8BA13160 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-FMLayoutKit_Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
6003F586195388D20070C39A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6003F59E195388D20070C39A /* FMAppDelegate.m in Sources */,
C3973878248F705000A7A2C2 /* FMCollViewController.m in Sources */,
6003F5A7195388D20070C39A /* FMViewController.m in Sources */,
C3C47B9F24BAC2810020C071 /* FMCombineViewController.m in Sources */,
C385261024AC6AAE00386DBB /* FMFPSLabel.m in Sources */,
C397387D248F705000A7A2C2 /* FMLayoutLabel.m in Sources */,
C34E98532497ABE600E8EC44 /* FMHorizontalLayoutController.m in Sources */,
C397387B248F705000A7A2C2 /* FMExcuteTimeTool.m in Sources */,
C397387A248F705000A7A2C2 /* FMCollectionNavTitleView.m in Sources */,
C399E9A324AEC11D00353B76 /* FMAotuSizeReusableView.m in Sources */,
C397387E248F705000A7A2C2 /* LS_HomeActivityCell.m in Sources */,
C34E984F2497A9ED00E8EC44 /* FMCollectionViewCell.m in Sources */,
6003F59A195388D20070C39A /* main.m in Sources */,
C397387C248F705000A7A2C2 /* FMCollectionCustomCell.m in Sources */,
C3973877248F705000A7A2C2 /* FMCollectionCustomDecoration.m in Sources */,
C3973879248F705000A7A2C2 /* FMAddViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AA195388D20070C39A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5BC195388D20070C39A /* Tests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
6003F5B4195388D20070C39A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 6003F589195388D20070C39A /* FMLayoutKit_Example */;
targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
6003F596195388D20070C39A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6003F597195388D20070C39A /* en */,
);
name = InfoPlist.strings;
sourceTree = "";
};
6003F5B8195388D20070C39A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6003F5B9195388D20070C39A /* en */,
);
name = InfoPlist.strings;
sourceTree = "";
};
71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
71719F9E1E33DC2100824A3D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
6003F5BD195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
6003F5BE195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
6003F5C0195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0C1C4C8575B73D703C9D0B5D /* Pods-FMLayoutKit_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = T82JQ7P486;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "FMLayoutKit/FMLayoutKit-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
);
INFOPLIST_FILE = "FMLayoutKit/FMLayoutKit-Info.plist";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = FMLayoutKit;
SWIFT_VERSION = 4.0;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
6003F5C1195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 17F812EE8B554502C8DA01FA /* Pods-FMLayoutKit_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = T82JQ7P486;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "FMLayoutKit/FMLayoutKit-Prefix.pch";
INFOPLIST_FILE = "FMLayoutKit/FMLayoutKit-Info.plist";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = FMLayoutKit;
SWIFT_VERSION = 4.0;
WRAPPER_EXTENSION = app;
};
name = Release;
};
6003F5C3195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 4ECA8A4093CF864F4FA6C5CA /* Pods-FMLayoutKit_Tests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "Tests/Tests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FMLayoutKit_Example.app/FMLayoutKit_Example";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
6003F5C4195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A8EFB03ECBAF6C997935840C /* Pods-FMLayoutKit_Tests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
INFOPLIST_FILE = "Tests/Tests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FMLayoutKit_Example.app/FMLayoutKit_Example";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6003F585195388D10070C39A /* Build configuration list for PBXProject "FMLayoutKit" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5BD195388D20070C39A /* Debug */,
6003F5BE195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "FMLayoutKit_Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5C0195388D20070C39A /* Debug */,
6003F5C1195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "FMLayoutKit_Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5C3195388D20070C39A /* Debug */,
6003F5C4195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 6003F582195388D10070C39A /* Project object */;
}
================================================
FILE: Example/FMLayoutKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: Example/FMLayoutKit.xcodeproj/xcshareddata/xcschemes/FMLayoutKit-Example.xcscheme
================================================
================================================
FILE: Example/FMLayoutKit.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: Example/FMLayoutKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
IDEDidComputeMac32BitWarning
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMCollectionLayoutAttributes.h
================================================
//
// FMCollectionLayoutAttributes.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/25.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import "FMLayoutBaseSection.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMCollectionLayoutAttributes : UICollectionViewLayoutAttributes
@property(nonatomic, assign)FMLayoutDirection direction;
+ (instancetype)headerAttributesWithSection:(FMLayoutBaseSection *)section;
- (instancetype)updateHeaderAttributesWithSection:(FMLayoutBaseSection *)section;
+ (instancetype)suspensionShowHeaderAttributes:(FMLayoutBaseSection *)section;
+ (instancetype)footerAttributesWithSection:(FMLayoutBaseSection *)section;
- (instancetype)updateFooterAttributesWithSection:(FMLayoutBaseSection *)section;
+ (instancetype)bgAttributesWithSection:(FMLayoutBaseSection *)section;
- (instancetype)updateBgAttributesWithSection:(FMLayoutBaseSection *)section;
- (void)_onlyUpdateOffsetWith:(FMLayoutBaseSection *)section;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMCollectionViewDelegateDataSourceProvider.h
================================================
//
// FMCollectionViewDelegateDataSourceProvider.h
// FMLayoutKit
//
// Created by 郑桂华 on 2021/3/27.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@class FMLayoutBaseSection;
@interface FMCollectionViewDelegateDataSourceProvider : NSObject
///重写了set get 目标指向->layout.sections
@property(nonatomic, strong)NSMutableArray *sections;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMKVOArrayObject.h
================================================
//
// FMKVOArrayObject.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/6/5.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMKVOArrayObject : NSObject
@property (strong,nonatomic)NSMutableArray *targetArray;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayout.h
================================================
//
// FMLayout.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/16.
//
#import
#import "FMLayoutBaseSection.h"
#import "FMLayoutHeader.h"
#import "FMLayoutFooter.h"
#import "FMLayoutBackground.h"
#import "FMCollectionLayoutAttributes.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayout : UICollectionViewLayout
@property(nonatomic, assign)FMLayoutDirection direction;
@property(nonatomic, strong)NSMutableArray *sections;
///最后固定边距 跟section的inset无关 contentSize会自动加上去
@property(nonatomic, assign)CGFloat fixedLastMargin;
///是否只计算改变的布局 NO为每一次 都是重新计算所有布局
@property(nonatomic, assign)BOOL reLayoutOlnyChanged;
///最小可滑动的大小 横向-高度 纵向-宽度
@property(nonatomic, assign)CGFloat minContentSize;
///第一个Section的偏移量
@property(nonatomic, assign)CGFloat firstSectionOffset;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutAbsoluteSection.h
================================================
//
// FMLayoutAbsoluteSection.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/6/9.
//
#import "FMLayoutDynamicSection.h"
NS_ASSUME_NONNULL_BEGIN
typedef CGRect(^FMLayoutBaseSectionItemFrameBlock)(id section, NSInteger item);
///支持纵向插横向
@interface FMLayoutAbsoluteSection : FMLayoutDynamicSection
@property(nonatomic, copy)FMLayoutBaseSectionItemFrameBlock frameBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutBackground.h
================================================
//
// FMLayoutBackground.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/27.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMSupplementary.h"
NS_ASSUME_NONNULL_BEGIN
static NSString *const UICollectionElementKindSectionBackground = @"UICollectionElementKindSectionBackground";
@interface FMLayoutBackground : FMSupplementary
+ (instancetype)bgWithViewClass:(Class)viewClass;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutBaseSection.h
================================================
//
// FMLayoutBaseSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import
#import "FMLayoutDebugLog.h"
typedef NS_ENUM(NSUInteger, FMLayoutHandleType) {
/// 重新计算 重新布局该分组
FMLayoutHandleTypeReLayout,
/// 只是分组偏移高度改变
FMLayoutHandleTypeOlnyChangeOffset,
/// 追加布局
FMLayoutHandleTypeAppend
};
///布局方向
typedef NS_ENUM(NSUInteger, FMLayoutDirection) {
///垂直布局
FMLayoutDirectionVertical,
///水平布局
FMLayoutDirectionHorizontal
};
///Item布局方向
typedef NS_ENUM(NSUInteger, FMLayoutItemDirection) {
///水平左边开始 垂直上面开始
FMLayoutItemDirectionLeftTop,
///水平右边开始 垂直下面开始
FMLayoutItemDirectionRightBottom
};
///长按移动的方式
typedef NS_ENUM(NSUInteger, FMLayoutLongMoveType) {
///方格布局时 长按哪里 该cell的中心点就会跟着移动
FMLayoutLongMoveItem,
///列表布局时 上下移动 X不动
FMLayoutLongMoveTable,
};
NS_ASSUME_NONNULL_BEGIN
@class FMLayoutHeader, FMLayoutFooter, FMLayoutBackground, FMCollectionLayoutAttributes;
@interface FMLayoutBaseSection : NSObject
///仅当布局生效之后才会有值
@property(nonatomic, weak)UICollectionView *collectionView;
///仅当布局生效之后才会有值
@property(nonatomic, strong)NSIndexPath *indexPath;
///是否需要重新计算 设置为NO 布局会重新计算
@property(nonatomic, assign)FMLayoutDirection direction;
@property(nonatomic, assign)BOOL hasHandle;
@property(nonatomic, assign)NSInteger handleItemStart;///重新计算哪一个开始
@property(nonatomic, assign)FMLayoutHandleType handleType;
@property(nonatomic, assign)CGFloat changeOffset;
@property(nonatomic, strong)FMCollectionLayoutAttributes * __nullable bgAttribute;
@property(nonatomic, strong)FMCollectionLayoutAttributes * __nullable headerAttribute;
@property(nonatomic, strong)FMCollectionLayoutAttributes * __nullable footerAttribute;
@property(nonatomic, strong)NSArray *itemsAttribute;
/// 分组偏移高度
@property(nonatomic, assign)CGFloat sectionOffset;
/// 分组大小 纵向-高度 横向-宽度
@property(nonatomic, assign)CGFloat sectionSize;
/// 分组内边距
@property(nonatomic, assign)UIEdgeInsets sectionInset;
///分组头部
@property(nonatomic, strong)FMLayoutHeader * __nullable header;
///分组底部
@property(nonatomic, strong)FMLayoutFooter * __nullable footer;
///分组背景
@property(nonatomic, strong)FMLayoutBackground * __nullable background;
///cell行间距
@property(nonatomic, assign)CGFloat lineSpace;
///cell间距
@property(nonatomic, assign)CGFloat itemSpace;
///cell列数 纵向-列数 横向-行数
@property(nonatomic, assign)NSInteger column;
///每一列的高度缓存
@property(nonatomic, strong)NSMutableDictionary *columnSizes;
///每一个分组的item个数 默认返回itemDatas.count
@property(nonatomic, assign)NSInteger itemCount;
///cell数据数组
@property(nonatomic, strong)NSMutableArray *itemDatas;
///是否可以长按移动排序该分组 默认No 需配合FMLayoutView的enableLongPressDrag使用
@property(nonatomic, assign)BOOL canLongPressExchange;
///长按移动的方式
@property(nonatomic, assign)FMLayoutLongMoveType moveType;
///某一个item是否可以移动替换
@property(nonatomic, copy)BOOL(^canLongPressExchangeItem)(id section, NSInteger item);
/// 显示隐藏
@property(nonatomic, assign, getter=isHidden)BOOL hidden;
///第一个Item的Y值 横向纵向有区别
@property(nonatomic, assign, readonly)CGFloat firstItemStartY;
///第一个Item的X值 横向纵向有区别
@property(nonatomic, assign, readonly)CGFloat firstItemStartX;
///配置一下Attributes
@property(nonatomic, copy)void(^configureCellLayoutAttributes)(id section, UICollectionViewLayoutAttributes *attributes, NSInteger item);
///配置头部的block
@property(nonatomic, copy)void(^configureHeaderData)(FMLayoutBaseSection *section, UICollectionReusableView *header);
///配置底部的block
@property(nonatomic, copy)void(^configureFooterData)(FMLayoutBaseSection *section, UICollectionReusableView *footer);
///配置背景的block
@property(nonatomic, copy)void(^configureBg)(FMLayoutBaseSection *section, UICollectionReusableView *bg);
///配置Cell的block
@property(nonatomic, copy)void(^configureCellData)(FMLayoutBaseSection *section, UICollectionViewCell *cell, NSInteger item);
///cell点击事件
@property(nonatomic, copy)void(^clickCellBlock)(FMLayoutBaseSection *section, NSInteger item);
+ (instancetype)sectionWithSectionInset:(UIEdgeInsets)inset itemSpace:(CGFloat)itemSpace lineSpace:(CGFloat)lineSpace column:(NSInteger)column;
///标记某一个改变 即将刷新该分组的大小 主要用于动态分组
- (void)markChangeAt:(NSInteger)index;
- (void)handleLayout;
- (BOOL)intersectsRect:(CGRect)rect;
- (void)prepareHeader;
- (void)prepareFooter;
- (void)prepareItems;
- (void)prepareBackground;
- (NSArray *)showLayoutAttributesInRect:(CGRect)rect;
///即将显示的头部布局
- (UICollectionViewLayoutAttributes *)showHeaderLayout;
///根据index计算出该布局对象
- (FMCollectionLayoutAttributes *)getItemAttributesWithIndex:(NSInteger)index;
- (BOOL)prepareLayoutItemsIsOlnyChangeOffset;
///获取最小高度的列
- (NSInteger)getMinHeightColumn;
- (CGFloat)getColumnMaxHeight;
///重置所有列的高度缓存
- (void)resetcolumnSizes;
///交叉布局时单一sention的大小
- (CGFloat)crossSingleSectionSize;
- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
- (UICollectionViewCell *)dequeueReusableCellForIndexPath:(NSIndexPath *)indexPath;
- (UICollectionViewCell *)dequeueReusableCellForIndexPath:(NSIndexPath *)indexPath collectionView:(UICollectionView *)collectionView;
- (void)registerCells;
- (void)registerCellsWithCollectionView:(UICollectionView *)collectionView;
- (void)reload;
- (void)reloadItem:(NSInteger)item;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutCombineSection.h
================================================
//
// FMLayoutCombineSection.h
// FMLayoutKit
//
// Created by 郑桂华 on 2020/7/12.
//
#import "FMLayoutBaseSection.h"
NS_ASSUME_NONNULL_BEGIN
///可以将不同Cell, 不同的布局方式, 放到同一个分组去合并,只合并cell, 如果子分组有头部和底部讲被忽略,合并分组的头部与底部不影响配置, cell的点击事件已经在init方法中配置block分发到子分组上 合并分组不支持拖拽排序 想要支持 可以继承自该类重写canLongPressExchange的get方法 并实现- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
@interface FMLayoutCombineSection : FMLayoutBaseSection
@property(nonatomic, readonly)NSArray *subSections;
+ (instancetype)combineSections:(NSArray *)sections;
- (void)appendSection:(FMLayoutBaseSection *)section;
- (void)insetSection:(FMLayoutBaseSection *)section atIndex:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutCrossSection.h
================================================
//
// FMLayoutCrossSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/16.
//
#import "FMLayoutBaseSection.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutCrossSection : FMLayoutBaseSection
@property(nonatomic, assign, readonly)FMLayoutDirection crossDirection;
/// 所有section计算获取最大的高度
@property(nonatomic, assign)BOOL autoMaxSize;
/// 所有section计算获取最大的高度
@property(nonatomic, assign)CGFloat size;
@property(nonatomic, assign)BOOL canReuseCell;
@property(nonatomic, assign, readonly)CGFloat maxContentWidth;
@property(nonatomic, strong)NSMutableArray *sections;
@property(nonatomic, copy)void(^scrollDidScroll)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
@property(nonatomic, copy)void(^configureCollectionView)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
+ (instancetype)sectionAutoWithSection:(FMLayoutBaseSection *)section;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutCrossTransformSection.h
================================================
//
// FMLayoutCrossTransformSection.h
// FMLayoutKit
//
// Created by 郑桂华 on 2020/7/15.
//
#import "FMLayoutCrossSection.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, FMLayoutCrossTransformType) {
///什么都不做
FMLayoutCrossTransformNone,
///缩小0.9 + 0.1*进度
FMLayoutCrossTransformScale,
///简拼App首页样式 M_PI_4 * 0.5 * 进度
FMLayoutCrossTransformCrooked,
///折叠效果
FMLayoutCrossTransformFold,
};
///Cell是需要做处理的cell, progress是指cell中心点到屏幕边缘移动的进度 -1 ~ 1 0为在最中间 -1在左边 1在右边
typedef void(^FMLayoutCrossTransformBlock)(UICollectionViewCell *cell, CGFloat progress);
///当前仅针对横向做适配 更多的动画
@interface FMLayoutCrossTransformSection : FMLayoutCrossSection
///形变类型
@property(nonatomic, assign)FMLayoutCrossTransformType transformType;
///如果有该Block 则优先执行此block
@property(nonatomic, copy)FMLayoutCrossTransformBlock __nullable transformBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutDebugLog.h
================================================
//
// FMLayoutDebugLog.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/17.
//
#import
NS_ASSUME_NONNULL_BEGIN
extern void FMLayoutLog(NSString *format);
extern void FMLayoutOpenLog(void);
extern void FMLayoutCloseLog(void);
extern NSInteger FMLayoutRandomValue(NSInteger start, NSInteger end);
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutDynamicSection.h
================================================
//
// FMLayoutDynamicSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMLayoutBaseSection.h"
#import "FMLayoutElement.h"
NS_ASSUME_NONNULL_BEGIN
///返回cell大小的block 横向-返回宽度 纵向-返回高度
typedef CGFloat(^FMLayoutItemOtherBlock)(id section, NSInteger item);
typedef CGFloat(^FMLayoutAutoHeightLaterBlock)(id section, NSInteger item, CGFloat autoHeight);
///动态 可以注册多种cell 宽度固定 高度可以自适应 但需要用block填充数据 需要设置deqCellReturnReuseId该block值以获取cell 高度亦可以通过手动计算heightBlock返回 手动计算优先级要高
@interface FMLayoutDynamicSection : FMLayoutBaseSection
/// yes时 布局耗时比较长 是否自动计算高度 需设置configurationCell方法填充数据 仅支持纵向布局时使用
@property(nonatomic, assign)BOOL autoHeightFixedWidth;
@property(nonatomic, copy)FMLayoutAutoHeightLaterBlock autoHeightLaterHander;
///cell固定一个方向的大小 纵向-宽度 横向-高度
@property(nonatomic, assign)CGFloat cellFixedSize;
///需要注册的cell元素
@property(nonatomic, strong)NSArray *cellElements;
///固定单一分组 当固定单一分组时 可以不用手动配置deqCellReturnReuseId
@property(nonatomic, strong)FMLayoutElement *cellElement;
///获取cell的复用FMLayoutElement
@property(nonatomic, copy)FMLayoutElement *(^deqCellReturnElement)(FMLayoutDynamicSection *section, NSInteger item);
///填充数据 仅当autoHeightFixedWidth为Yes时有用
@property(nonatomic, copy)void(^configurationCell)(FMLayoutDynamicSection *section, UICollectionViewCell *cell, NSInteger item);
///block返回手动计算的高度 优先级比自动的高
@property(nonatomic, copy)FMLayoutItemOtherBlock otherBlock;
- (CGFloat)autoHeightVerticalWithWidth:(CGFloat)fixedWidth index:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutElement.h
================================================
//
// FMLayoutElement.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutElement : NSObject
@property(nonatomic, copy)NSString *reuseIdentifier;
@property(nonatomic, assign)BOOL isNib;
@property(nonatomic, weak)Class viewClass;///视图的类
+ (instancetype)elementWithViewClass:(Class)vCalss;
+ (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib;
+ (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
- (void)registerElementWithCollection:(UICollectionView *)collectionView;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutFillSection.h
================================================
//
// FMLayoutFillSection.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/4/11.
//
#import "FMLayoutDynamicSection.h"
NS_ASSUME_NONNULL_BEGIN
///返回cell大小的block
typedef CGSize(^FMLayoutItemSizeBlock)(id section, NSInteger item);
///支持纵向插横向 只可以上对齐以及左对齐
@interface FMLayoutFillSection : FMLayoutDynamicSection
@property(nonatomic, copy)FMLayoutItemSizeBlock sizeBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutFixedSection.h
================================================
//
// FMLayoutFixedSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMLayoutBaseSection.h"
#import "FMLayoutElement.h"
NS_ASSUME_NONNULL_BEGIN
///固定cell的大小 单一一种cell样式 支持同样cell是否可以横向滚动 内嵌collectionView 支持纵向插横向
@interface FMLayoutFixedSection : FMLayoutBaseSection
@property(nonatomic, assign)CGSize itemSize;///分组cell大小
@property(nonatomic, strong)FMLayoutElement *cellElement;///固定分组
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutFooter.h
================================================
//
// FMLayoutFooter.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMSupplementary.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutFooter : FMSupplementary
/// 距离最后Item的距离 纵向-上方 横向-左边
@property(nonatomic, assign)CGFloat topMargin;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutHeader.h
================================================
//
// FMLayoutHeader.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMSupplementary.h"
NS_ASSUME_NONNULL_BEGIN
/// 悬浮方式
typedef NS_ENUM(NSInteger, FMLayoutHeaderType) {
///跟着滚动
FMLayoutHeaderTypeFixed,
///悬浮在顶部 跟着section动
FMLayoutHeaderTypeSuspension,
///悬浮在顶部 不跟随section动 如果出现多个可能会被覆盖
FMLayoutHeaderTypeSuspensionAlways,
///仅支持在第一个头部 下拉放大效果
FMLayoutHeaderTypeSuspensionBigger
};
@interface FMLayoutHeader : FMSupplementary
/// 显示方式 是悬浮 还是跟着滚动 默认跟着滚动
@property(nonatomic, assign)FMLayoutHeaderType type;
/// 悬浮模式时距离顶部的高度 可以来设置两个悬浮的方式 多个顶部悬浮时 可以通过这个来达到层叠悬浮的模式
@property(nonatomic, assign)CGFloat suspensionTopMargin;
/// 距离第一个Item的距离 纵向-下方 横向-右边
@property(nonatomic, assign)CGFloat lastMargin;
///是否黏在顶部 目前仅支持FMLayoutHeaderTypeSuspensionAlways, FMLayoutHeaderTypeSuspensionBigger悬浮模式 不同的type效果不同 FMLayoutHeaderTypeSuspensionAlways是下拉黏在当前位置 上拉黏在顶部 而FMLayoutHeaderTypeSuspensionBiggers是上拉黏在顶部 下拉时放大效果
@property(nonatomic, assign)BOOL isStickTop;
/// 缩放模式(SuspensionBigger)下最小值 横向-宽度 纵向-高度 该值请务必小于size 默认是0
@property(nonatomic, assign)CGFloat minSize;
/// 缩放模式(SuspensionBigger)下最大值 横向-宽度 纵向-高度 该值请务必大于size 默认是CGFLOAT_MAX
@property(nonatomic, assign)CGFloat maxSize;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutKit-umbrella.h
================================================
#ifdef __OBJC__
#import
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "FMLayoutBackground.h"
#import "FMLayoutElement.h"
#import "FMLayoutFooter.h"
#import "FMLayoutHeader.h"
#import "FMSupplementary.h"
#import "FMCollectionLayoutAttributes.h"
#import "FMKVOArrayObject.h"
#import "FMLayout.h"
#import "FMLayoutView.h"
#import "FMTeslaLayoutView.h"
#import "FMTeslaSuspensionHeightChangeDelegate.h"
#import "FMLayoutCrossSection.h"
#import "FMLayoutAbsoluteSection.h"
#import "FMLayoutBaseSection.h"
#import "FMLayoutDynamicSection.h"
#import "FMLayoutFillSection.h"
#import "FMLayoutFixedSection.h"
#import "FMLayoutLabelSection.h"
FOUNDATION_EXPORT double FMLayoutKitVersionNumber;
FOUNDATION_EXPORT const unsigned char FMLayoutKitVersionString[];
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutKit.h
================================================
//
// FMLayoutKit.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/9.
//
#ifndef FMLayoutKit_h
#define FMLayoutKit_h
#import "FMTeslaLayoutView.h"
#import "FMLayoutView.h"
#import "FMLayout.h"
#import "FMCollectionLayoutAttributes.h"
#import "FMTeslaSuspensionHeightChangeDelegate.h"
#import "FMLayoutFixedSection.h"
#import "FMLayoutDynamicSection.h"
#import "FMLayoutLabelSection.h"
#import "FMLayoutFillSection.h"
#import "FMLayoutAbsoluteSection.h"
#import "FMLayoutCrossSection.h"
#import "FMLayoutCrossTransformSection.h"
#import "FMLayoutCombineSection.h"
#import "FMLayoutScaleSection.h"
#import "FMSupplementary.h"
#import "FMLayoutHeader.h"
#import "FMLayoutFooter.h"
#import "FMLayoutBackground.h"
#endif /* FMLayoutKit_h */
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutLabelSection.h
================================================
//
// FMLayoutLabelSection.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/4/8.
//
#import "FMLayoutDynamicSection.h"
#import "FMLayoutElement.h"
NS_ASSUME_NONNULL_BEGIN
///返回cell大小的block
typedef CGFloat(^FMLayoutItemWidthBlock)(id section, NSInteger item);
///当到第多少个的时候超出最大行 可移除数据处理 itemDatas会清理 否则frame为zero
typedef CGFloat(^FMLayoutOverItemBlock)(id section, NSInteger item);
///标签式布局 根据文本伸缩布局 宽度不够 换行 适用于历史搜索记录 sku选择等样式
@interface FMLayoutLabelSection : FMLayoutDynamicSection
///最大行数 超出讲不显示 纵向布局时生效
@property(nonatomic, assign)NSInteger maxLine;
///cell固定的高度
@property(nonatomic, assign)CGFloat cellFixedHeight;
///cell最大宽度 不设置的话 就是collection的宽度减去左右分组内边距
@property(nonatomic, assign)CGFloat cellMaxWidth;
///block返回手动计算的宽度
@property(nonatomic, copy)FMLayoutItemWidthBlock widthBlock;
///block返回手动计算的宽度
@property(nonatomic, copy)FMLayoutOverItemBlock overItemBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutScaleSection.h
================================================
//
// FMLayoutScaleSection.h
// FMLayoutKit
//
// Created by 郑桂华 on 2020/7/20.
//
#import "FMLayoutDynamicSection.h"
NS_ASSUME_NONNULL_BEGIN
///支持两种设置固定大小的方式 一种直接给数组sizeNums 一种给比例字符串scales 后设置的生效
@interface FMLayoutScaleSection : FMLayoutDynamicSection
/// 纵向布局 则是宽度比例 横向布局 则是高度比例 例如纵向布局时该值为: 1:2:3 则就是3列 宽度比为剩下的值的比例 仅支持当前样式 可以是小数值 但不能为非数值类型
@property(nonatomic, copy)NSString *scales;
///每一列的固定大小 如:@[@100, @200] 则表示两列 一个固定宽度为100 另外一列为200 共两列
@property(nonatomic, strong)NSArray *sizeNums;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutView.h
================================================
//
// FMLayoutView.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import "FMLayout.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutView : UICollectionView
@property(nonatomic, weak)FMLayout *layout;
///重写了set get 目标指向->layout.sections
@property(nonatomic)NSMutableArray *sections;
@property(nonatomic, assign)BOOL reloadOlnyChanged;
///是否允许长按拖拽排序 不支持夸分组 分组需要开启canLongPressExchange才可以移动拖拽排序
@property(nonatomic, assign)BOOL enableLongPressDrag;
///长按拖拽开始时配置cell显示的样式
@property(nonatomic, copy)UIView *(^configureSourceView)(UICollectionViewCell *sourceCell);
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout NS_UNAVAILABLE;
- (instancetype)initHorizontal;
- (instancetype)initHorizontalWithFrame:(CGRect)frame;
/// 循环遍历出更改过的sections 如果有过增删分组 请使用原有的reloadData方法
- (void)reloadChangedSectionsData;
///获取到滚动到indexPath位置偏移量 如果获取到的不准确 请先调用layoutIfNeeded方法
- (CGPoint)contentOffsetScrollToIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMSupplementary.h
================================================
//
// FMSupplementary.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMLayoutElement.h"
typedef NS_ENUM(NSInteger, FMLayoutZIndex) {
///最底层 头部 底部 Item的下方
FMLayoutZIndexBg = -9999,
///Item的下方
FMLayoutZIndexBackOfItem = -1,
/// 自动悬浮可能会被覆盖
FMLayoutZIndexAuto = 0,
/// Item的上方
FMLayoutZIndexFrontOfItem = 1,
/// 最最上方
FMLayoutZIndexFrontAlways = 9999
};
NS_ASSUME_NONNULL_BEGIN
/// 请使用子类Footer, Header, Background
@interface FMSupplementary : FMLayoutElement
///该Element的大小 纵向-高度 横向-宽度
@property(nonatomic, assign)CGFloat size;
///视图层级 最上方还是最下方等
@property(nonatomic, assign)FMLayoutZIndex zIndex;
///内边距 HeaderFooter受sectionInset影响 Background不受sectionInset影响
@property(nonatomic, assign)UIEdgeInsets inset;
///Element类型 Header Footer Background等
@property(nonatomic, copy, readonly)NSString *elementKind;
///是否自适应高度 仅当垂直布局时可用
@property(nonatomic, assign)BOOL autoHeight;
@property(nonatomic, copy)void(^configureDataAutoHeight)(UICollectionReusableView *view);
+ (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass;
+ (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib;
+ (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
- (UICollectionReusableView *)dequeueReusableViewWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath;
- (void)updateHeightWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath maxWidth:(CGFloat)maxWidth;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMTeslaLayoutView.h
================================================
//
// FMTeslaLayoutView.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/8.
// Copyright © 2020 周发明. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@class FMLayoutView, FMTeslaLayoutView, FMLayoutBaseSection;
@protocol FMTeslaLayoutViewDelegate
@optional
///滚动结束事件
- (void)tesla:(FMTeslaLayoutView *)tesla didScrollEnd:(NSInteger)index currentScrollView:(UIScrollView *)scrollView;
///滚动事件
- (void)tesla:(FMTeslaLayoutView *)tesla scrollViewDidScroll:(UIScrollView *)scrollView;
/// 当前上下滚动的事件
- (void)tesla:(FMTeslaLayoutView *)tesla currentScrollViewScrollDidScroll:(UIScrollView *)currentScrollView contentOffset:(CGPoint)contentOffset;
/// 配置FMCollectionLayoutView
///2
- (void)tesla:(FMTeslaLayoutView *)tesla currentShowScrollView:(UIScrollView *)scrollView index:(NSInteger)index;
///0 即将根据Index创建FMCollectionLayoutView
- (void)tesla:(FMTeslaLayoutView *)tesla willCreateScrollViewWithIndex:(NSInteger)index;
///0.5 根据Index自己创建FMCollectionLayoutView shareHeight为共享头部的高度 请将shareHeight顶部空出来并且请保持不使用contentInset 如果返回nil会自动创建FMLayoutView
- (UIScrollView *)tesla:(FMTeslaLayoutView *)tesla customCreateWithIndex:(NSInteger)index shareHeight:(CGFloat)shareHeight;
///1 根据Index创建完毕UIScrollView
- (void)tesla:(FMTeslaLayoutView *)tesla didCreatedScrollViewWithIndex:(NSInteger)index scrollView:(UIScrollView *)scrollView;
/// 悬停标签控制view的尺寸最小高度 可以留着做效果
- (CGFloat)shareSuspensionMinHeightWithTesla:(FMTeslaLayoutView *)tesla;
@end
@protocol FMTeslaLayoutViewDataSource
@required
- (NSInteger)numberOfScreenInTesla:(FMTeslaLayoutView *)tesla;
@optional
- (NSArray *)shareSectionsInTesla:(FMTeslaLayoutView *)tesla;
@end
@class FMLayoutBaseSection;
@interface FMTeslaLayoutView : UIView
@property(nonatomic, weak)id delegate;
@property(nonatomic, weak)id dataSource;
@property(nonatomic, assign)BOOL horizontalCanScroll;
@property(nonatomic, assign)BOOL allShareStickTop;
@property(nonatomic, assign)NSInteger selectIndex;
@property(nonatomic, assign)BOOL isLoadSubView;
@property(nonatomic, assign)CGFloat shareHeight;
@property(nonatomic, strong, readonly)FMLayoutView *shareLayoutView;
- (void)reLoadSubViews;
- (void)reloadData;
- (void)reloadDataWithIndex:(NSInteger)index;
- (void)scrollToIndex:(NSInteger)index animated:(BOOL)animated;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMTeslaSuspensionHeightChangeDelegate.h
================================================
//
// FMTeslaSuspensionHeightChangeDelegate.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/5/13.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@protocol FMTeslaSuspensionHeightChangeDelegate
- (void)teslaSuspensionHeaderShouldShowHeight:(CGFloat)showHeight;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/Modules/module.modulemap
================================================
framework module FMLayoutKit {
umbrella header "FMLayoutKit-umbrella.h"
export *
module * { export * }
}
================================================
FILE: Example/FMLayoutKitFramework/FMLayoutKit.framework/_CodeSignature/CodeResources
================================================
files
Headers/FMCollectionLayoutAttributes.h
O30CaMucsbKG9WZDD3g+/zKOfdM=
Headers/FMCollectionViewDelegateDataSourceProvider.h
ev11njieIDCjXwxq6tE+0Go8Q2U=
Headers/FMKVOArrayObject.h
kcnRWMH4+X3NQn5BnR4efXkPI48=
Headers/FMLayout.h
GQflgCCxMGkdLFIzyju1R2oJpf8=
Headers/FMLayoutAbsoluteSection.h
O2MA6nxtIs47HrBwUMOfcGnKJ0o=
Headers/FMLayoutBackground.h
VDMpTbXT56ILF3enWgcXnqMGjMw=
Headers/FMLayoutBaseSection.h
/jt+WcYC5h4CPHpOd36eSQTRBaQ=
Headers/FMLayoutCombineSection.h
9Ca3BaGs0c0NZfHxfZBVe0ls80w=
Headers/FMLayoutCrossSection.h
o9roPsaYR9oNzgGMFa75Mgdza+Y=
Headers/FMLayoutCrossTransformSection.h
U0NpzET9KhE6GXk9fud72RNE3lQ=
Headers/FMLayoutDebugLog.h
hcHKMAS/zM85rSoKqtsh6YPUy8w=
Headers/FMLayoutDynamicSection.h
HuPBUS7LR6FPj2xsGw0DepkUn4s=
Headers/FMLayoutElement.h
8j97vy5ReOxOZXWPyyMjpBjkw5o=
Headers/FMLayoutFillSection.h
q1u3flkbJnUv725iYsAygE/6IW8=
Headers/FMLayoutFixedSection.h
MaPJ7tBFI85i25VGlklMiKKpzDE=
Headers/FMLayoutFooter.h
2lb118tQJQgTVN+H8Og17xOvvhE=
Headers/FMLayoutHeader.h
2wulFPpiYi/uV9uGVsKHMJCern0=
Headers/FMLayoutKit-umbrella.h
NilO12VNPzuBwk9x0e+lUmull3c=
Headers/FMLayoutKit.h
HIOrlmnsHlyNgbdt0mpA4dFeWBc=
Headers/FMLayoutLabelSection.h
ycPX8RMIU6oksfjdGsVVn9O5TEI=
Headers/FMLayoutScaleSection.h
gSjqmu/leF1yywOB6KoxeRlRgEA=
Headers/FMLayoutView.h
lP9zIEONqVArA35PEiIK+U+ZNvU=
Headers/FMSupplementary.h
4a81sKmC/RMUO21JmLjBKfzkkMw=
Headers/FMTeslaLayoutView.h
MwC3uPYp+7202ev6w/XfyvYLCys=
Headers/FMTeslaSuspensionHeightChangeDelegate.h
lOgFWZxDriaARd5TuLHcp2YF6cw=
Info.plist
5NI7zkvtvlP1PUJdEbD/5J1CORQ=
Modules/module.modulemap
Z/5Z445TliUtpHrk7ROMmxzLDDs=
files2
Headers/FMCollectionLayoutAttributes.h
hash
O30CaMucsbKG9WZDD3g+/zKOfdM=
hash2
SCNBzW5LNIJojXnqfuLkihBO9jxcvnaqvxxfo7C5ZSU=
Headers/FMCollectionViewDelegateDataSourceProvider.h
hash
ev11njieIDCjXwxq6tE+0Go8Q2U=
hash2
hmN+CbBZ5zDyEvRMSd6A4eviJMA/TyC5tlorNzw5fnc=
Headers/FMKVOArrayObject.h
hash
kcnRWMH4+X3NQn5BnR4efXkPI48=
hash2
0KMHK5kWPwHQZh/osJ5KJXYeAdvZCy6/8D9IMJkw2SA=
Headers/FMLayout.h
hash
GQflgCCxMGkdLFIzyju1R2oJpf8=
hash2
H67WFCXwOBJ9siR0RKfVNt6BrkIzHgl/zwkxIbbNpbo=
Headers/FMLayoutAbsoluteSection.h
hash
O2MA6nxtIs47HrBwUMOfcGnKJ0o=
hash2
iHDQ1jmsfUo7qcQ9OTjQkgp96/rrOotyC9htTOWlNR0=
Headers/FMLayoutBackground.h
hash
VDMpTbXT56ILF3enWgcXnqMGjMw=
hash2
CW8h/vOzmlw2IZWcpW2jxe1PxDARpIxonuIDQmlIbO0=
Headers/FMLayoutBaseSection.h
hash
/jt+WcYC5h4CPHpOd36eSQTRBaQ=
hash2
batXXhqHW6BZLaMuSziNhp9yQAxbau9enfI6FpqOhoU=
Headers/FMLayoutCombineSection.h
hash
9Ca3BaGs0c0NZfHxfZBVe0ls80w=
hash2
PMvd1uBvRZLMthhOlow1a0S+2bJDgb988cjE6bNZv8A=
Headers/FMLayoutCrossSection.h
hash
o9roPsaYR9oNzgGMFa75Mgdza+Y=
hash2
mvztFegbd5j2kvLnIwTnffY9pnYNIRvz4g/nx++OxOU=
Headers/FMLayoutCrossTransformSection.h
hash
U0NpzET9KhE6GXk9fud72RNE3lQ=
hash2
sl96qMNZLLBY2KBdLqxoaLG3SXlrSAHqX/SSBR0McCU=
Headers/FMLayoutDebugLog.h
hash
hcHKMAS/zM85rSoKqtsh6YPUy8w=
hash2
taTztq608Z0h6SkQDJaxSV3a2QYVQ2JRAb3lLKD2ZHQ=
Headers/FMLayoutDynamicSection.h
hash
HuPBUS7LR6FPj2xsGw0DepkUn4s=
hash2
Ej6/nfzrs2yDH+Xyv7AXjHNuabjb1IjuJABodcY4PAg=
Headers/FMLayoutElement.h
hash
8j97vy5ReOxOZXWPyyMjpBjkw5o=
hash2
cQd54yq/XVSc9SxhSuoeR4dvAjTmHq91IFYzq/2Wm7k=
Headers/FMLayoutFillSection.h
hash
q1u3flkbJnUv725iYsAygE/6IW8=
hash2
hIeJINDY21gLv90VaEso9+R63BPmrJhsaU555Y3GehQ=
Headers/FMLayoutFixedSection.h
hash
MaPJ7tBFI85i25VGlklMiKKpzDE=
hash2
OaeTbT6Ir6FA5F8e9U2Uj12RqsNm2eqidKj65UP+nII=
Headers/FMLayoutFooter.h
hash
2lb118tQJQgTVN+H8Og17xOvvhE=
hash2
BzXtLCIkyAliHRZhU/pptph0GD8qO5vqHm4qpOIi5Fs=
Headers/FMLayoutHeader.h
hash
2wulFPpiYi/uV9uGVsKHMJCern0=
hash2
yqZkxJvTMCrIsIuwdJdd5DlZ248yYOjlPoKLsgyXG7k=
Headers/FMLayoutKit-umbrella.h
hash
NilO12VNPzuBwk9x0e+lUmull3c=
hash2
E3e3VBmNAwNU19lpVXQEHYxEkSaaWAbBJY0Eq58c8Ws=
Headers/FMLayoutKit.h
hash
HIOrlmnsHlyNgbdt0mpA4dFeWBc=
hash2
s/tvERCyPoaAw5jgZwhSjMp98KLnuCelRQ5bcINp3Cw=
Headers/FMLayoutLabelSection.h
hash
ycPX8RMIU6oksfjdGsVVn9O5TEI=
hash2
4Ak8oYcQ4Spvazli4pEKXOPJsAZshRCbULAUUh/aYLY=
Headers/FMLayoutScaleSection.h
hash
gSjqmu/leF1yywOB6KoxeRlRgEA=
hash2
ghd2zI3OpDzgd2XwCmOTli/Mmhv2IVNQ2O8qGVf8Pzc=
Headers/FMLayoutView.h
hash
lP9zIEONqVArA35PEiIK+U+ZNvU=
hash2
wx1am9ZXc6sIjDDUjDzFt5WiPAZ2qiHc8qqqladCHTk=
Headers/FMSupplementary.h
hash
4a81sKmC/RMUO21JmLjBKfzkkMw=
hash2
6YuaHMqNEUl3gOPsuX/Ih+Du453H5qJkiy8w6TBQcIo=
Headers/FMTeslaLayoutView.h
hash
MwC3uPYp+7202ev6w/XfyvYLCys=
hash2
LmsHrUMgKAW/6tk+QQYlrokJ+VC02DZvvASDEW4pmMs=
Headers/FMTeslaSuspensionHeightChangeDelegate.h
hash
lOgFWZxDriaARd5TuLHcp2YF6cw=
hash2
9Ku3TOJdLs0MlcrBFJzVg/LUZdqDeGMT7KTainEGyPE=
Modules/module.modulemap
hash
Z/5Z445TliUtpHrk7ROMmxzLDDs=
hash2
2Leh+uJxOIj87iJ/CeSmmbcCjX20OMUO5G6x3eou49I=
rules
^.*
^.*\.lproj/
optional
weight
1000
^.*\.lproj/locversion.plist$
omit
weight
1100
^Base\.lproj/
weight
1010
^version.plist$
rules2
.*\.dSYM($|/)
weight
11
^(.*/)?\.DS_Store$
omit
weight
2000
^.*
^.*\.lproj/
optional
weight
1000
^.*\.lproj/locversion.plist$
omit
weight
1100
^Base\.lproj/
weight
1010
^Info\.plist$
omit
weight
20
^PkgInfo$
omit
weight
20
^embedded\.provisionprofile$
weight
20
^version\.plist$
weight
20
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMCollectionLayoutAttributes.h
================================================
//
// FMCollectionLayoutAttributes.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/25.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import "FMLayoutBaseSection.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMCollectionLayoutAttributes : UICollectionViewLayoutAttributes
@property(nonatomic, assign)FMLayoutDirection direction;
+ (instancetype)headerAttributesWithSection:(FMLayoutBaseSection *)section;
- (instancetype)updateHeaderAttributesWithSection:(FMLayoutBaseSection *)section;
+ (instancetype)suspensionShowHeaderAttributes:(FMLayoutBaseSection *)section;
+ (instancetype)footerAttributesWithSection:(FMLayoutBaseSection *)section;
- (instancetype)updateFooterAttributesWithSection:(FMLayoutBaseSection *)section;
+ (instancetype)bgAttributesWithSection:(FMLayoutBaseSection *)section;
- (instancetype)updateBgAttributesWithSection:(FMLayoutBaseSection *)section;
- (void)_onlyUpdateOffsetWith:(FMLayoutBaseSection *)section;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMCollectionViewDelegateDataSourceProvider.h
================================================
//
// FMCollectionViewDelegateDataSourceProvider.h
// FMLayoutKit
//
// Created by 郑桂华 on 2021/3/27.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@class FMLayoutBaseSection;
@interface FMCollectionViewDelegateDataSourceProvider : NSObject
///重写了set get 目标指向->layout.sections
@property(nonatomic, strong)NSMutableArray *sections;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMKVOArrayObject.h
================================================
//
// FMKVOArrayObject.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/6/5.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMKVOArrayObject : NSObject
@property (strong,nonatomic)NSMutableArray *targetArray;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayout.h
================================================
//
// FMLayout.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/16.
//
#import
#import "FMLayoutBaseSection.h"
#import "FMLayoutHeader.h"
#import "FMLayoutFooter.h"
#import "FMLayoutBackground.h"
#import "FMCollectionLayoutAttributes.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayout : UICollectionViewLayout
@property(nonatomic, assign)FMLayoutDirection direction;
@property(nonatomic, strong)NSMutableArray *sections;
///最后固定边距 跟section的inset无关 contentSize会自动加上去
@property(nonatomic, assign)CGFloat fixedLastMargin;
///是否只计算改变的布局 NO为每一次 都是重新计算所有布局
@property(nonatomic, assign)BOOL reLayoutOlnyChanged;
///最小可滑动的大小 横向-高度 纵向-宽度
@property(nonatomic, assign)CGFloat minContentSize;
///第一个Section的偏移量
@property(nonatomic, assign)CGFloat firstSectionOffset;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutAbsoluteSection.h
================================================
//
// FMLayoutAbsoluteSection.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/6/9.
//
#import "FMLayoutDynamicSection.h"
NS_ASSUME_NONNULL_BEGIN
typedef CGRect(^FMLayoutBaseSectionItemFrameBlock)(id section, NSInteger item);
///支持纵向插横向
@interface FMLayoutAbsoluteSection : FMLayoutDynamicSection
@property(nonatomic, copy)FMLayoutBaseSectionItemFrameBlock frameBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutBackground.h
================================================
//
// FMLayoutBackground.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/27.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMSupplementary.h"
NS_ASSUME_NONNULL_BEGIN
static NSString *const UICollectionElementKindSectionBackground = @"UICollectionElementKindSectionBackground";
@interface FMLayoutBackground : FMSupplementary
+ (instancetype)bgWithViewClass:(Class)viewClass;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutBaseSection.h
================================================
//
// FMLayoutBaseSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import
#import "FMLayoutDebugLog.h"
typedef NS_ENUM(NSUInteger, FMLayoutHandleType) {
/// 重新计算 重新布局该分组
FMLayoutHandleTypeReLayout,
/// 只是分组偏移高度改变
FMLayoutHandleTypeOlnyChangeOffset,
/// 追加布局
FMLayoutHandleTypeAppend
};
///布局方向
typedef NS_ENUM(NSUInteger, FMLayoutDirection) {
///垂直布局
FMLayoutDirectionVertical,
///水平布局
FMLayoutDirectionHorizontal
};
///Item布局方向
typedef NS_ENUM(NSUInteger, FMLayoutItemDirection) {
///水平左边开始 垂直上面开始
FMLayoutItemDirectionLeftTop,
///水平右边开始 垂直下面开始
FMLayoutItemDirectionRightBottom
};
///长按移动的方式
typedef NS_ENUM(NSUInteger, FMLayoutLongMoveType) {
///方格布局时 长按哪里 该cell的中心点就会跟着移动
FMLayoutLongMoveItem,
///列表布局时 上下移动 X不动
FMLayoutLongMoveTable,
};
NS_ASSUME_NONNULL_BEGIN
@class FMLayoutHeader, FMLayoutFooter, FMLayoutBackground, FMCollectionLayoutAttributes;
@interface FMLayoutBaseSection : NSObject
///仅当布局生效之后才会有值
@property(nonatomic, weak)UICollectionView *collectionView;
///仅当布局生效之后才会有值
@property(nonatomic, strong)NSIndexPath *indexPath;
///是否需要重新计算 设置为NO 布局会重新计算
@property(nonatomic, assign)FMLayoutDirection direction;
@property(nonatomic, assign)BOOL hasHandle;
@property(nonatomic, assign)NSInteger handleItemStart;///重新计算哪一个开始
@property(nonatomic, assign)FMLayoutHandleType handleType;
@property(nonatomic, assign)CGFloat changeOffset;
@property(nonatomic, strong)FMCollectionLayoutAttributes * __nullable bgAttribute;
@property(nonatomic, strong)FMCollectionLayoutAttributes * __nullable headerAttribute;
@property(nonatomic, strong)FMCollectionLayoutAttributes * __nullable footerAttribute;
@property(nonatomic, strong)NSArray *itemsAttribute;
/// 分组偏移高度
@property(nonatomic, assign)CGFloat sectionOffset;
/// 分组大小 纵向-高度 横向-宽度
@property(nonatomic, assign)CGFloat sectionSize;
/// 分组内边距
@property(nonatomic, assign)UIEdgeInsets sectionInset;
///分组头部
@property(nonatomic, strong)FMLayoutHeader * __nullable header;
///分组底部
@property(nonatomic, strong)FMLayoutFooter * __nullable footer;
///分组背景
@property(nonatomic, strong)FMLayoutBackground * __nullable background;
///cell行间距
@property(nonatomic, assign)CGFloat lineSpace;
///cell间距
@property(nonatomic, assign)CGFloat itemSpace;
///cell列数 纵向-列数 横向-行数
@property(nonatomic, assign)NSInteger column;
///每一列的高度缓存
@property(nonatomic, strong)NSMutableDictionary *columnSizes;
///每一个分组的item个数 默认返回itemDatas.count
@property(nonatomic, assign)NSInteger itemCount;
///cell数据数组
@property(nonatomic, strong)NSMutableArray *itemDatas;
///是否可以长按移动排序该分组 默认No 需配合FMLayoutView的enableLongPressDrag使用
@property(nonatomic, assign)BOOL canLongPressExchange;
///长按移动的方式
@property(nonatomic, assign)FMLayoutLongMoveType moveType;
///某一个item是否可以移动替换
@property(nonatomic, copy)BOOL(^canLongPressExchangeItem)(id section, NSInteger item);
/// 显示隐藏
@property(nonatomic, assign, getter=isHidden)BOOL hidden;
///第一个Item的Y值 横向纵向有区别
@property(nonatomic, assign, readonly)CGFloat firstItemStartY;
///第一个Item的X值 横向纵向有区别
@property(nonatomic, assign, readonly)CGFloat firstItemStartX;
///配置一下Attributes
@property(nonatomic, copy)void(^configureCellLayoutAttributes)(id section, UICollectionViewLayoutAttributes *attributes, NSInteger item);
///配置头部的block
@property(nonatomic, copy)void(^configureHeaderData)(FMLayoutBaseSection *section, UICollectionReusableView *header);
///配置底部的block
@property(nonatomic, copy)void(^configureFooterData)(FMLayoutBaseSection *section, UICollectionReusableView *footer);
///配置背景的block
@property(nonatomic, copy)void(^configureBg)(FMLayoutBaseSection *section, UICollectionReusableView *bg);
///配置Cell的block
@property(nonatomic, copy)void(^configureCellData)(FMLayoutBaseSection *section, UICollectionViewCell *cell, NSInteger item);
///cell点击事件
@property(nonatomic, copy)void(^clickCellBlock)(FMLayoutBaseSection *section, NSInteger item);
+ (instancetype)sectionWithSectionInset:(UIEdgeInsets)inset itemSpace:(CGFloat)itemSpace lineSpace:(CGFloat)lineSpace column:(NSInteger)column;
///标记某一个改变 即将刷新该分组的大小 主要用于动态分组
- (void)markChangeAt:(NSInteger)index;
- (void)handleLayout;
- (BOOL)intersectsRect:(CGRect)rect;
- (void)prepareHeader;
- (void)prepareFooter;
- (void)prepareItems;
- (void)prepareBackground;
- (NSArray *)showLayoutAttributesInRect:(CGRect)rect;
///即将显示的头部布局
- (UICollectionViewLayoutAttributes *)showHeaderLayout;
///根据index计算出该布局对象
- (FMCollectionLayoutAttributes *)getItemAttributesWithIndex:(NSInteger)index;
- (BOOL)prepareLayoutItemsIsOlnyChangeOffset;
///获取最小高度的列
- (NSInteger)getMinHeightColumn;
- (CGFloat)getColumnMaxHeight;
///重置所有列的高度缓存
- (void)resetcolumnSizes;
///交叉布局时单一sention的大小
- (CGFloat)crossSingleSectionSize;
- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
- (UICollectionViewCell *)dequeueReusableCellForIndexPath:(NSIndexPath *)indexPath;
- (UICollectionViewCell *)dequeueReusableCellForIndexPath:(NSIndexPath *)indexPath collectionView:(UICollectionView *)collectionView;
- (void)registerCells;
- (void)registerCellsWithCollectionView:(UICollectionView *)collectionView;
- (void)reload;
- (void)reloadItem:(NSInteger)item;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCombineSection.h
================================================
//
// FMLayoutCombineSection.h
// FMLayoutKit
//
// Created by 郑桂华 on 2020/7/12.
//
#import "FMLayoutBaseSection.h"
NS_ASSUME_NONNULL_BEGIN
///可以将不同Cell, 不同的布局方式, 放到同一个分组去合并,只合并cell, 如果子分组有头部和底部讲被忽略,合并分组的头部与底部不影响配置, cell的点击事件已经在init方法中配置block分发到子分组上 合并分组不支持拖拽排序 想要支持 可以继承自该类重写canLongPressExchange的get方法 并实现- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
@interface FMLayoutCombineSection : FMLayoutBaseSection
@property(nonatomic, readonly)NSArray *subSections;
+ (instancetype)combineSections:(NSArray *)sections;
- (void)appendSection:(FMLayoutBaseSection *)section;
- (void)insetSection:(FMLayoutBaseSection *)section atIndex:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCrossSection.h
================================================
//
// FMLayoutCrossSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/16.
//
#import "FMLayoutBaseSection.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutCrossSection : FMLayoutBaseSection
@property(nonatomic, assign, readonly)FMLayoutDirection crossDirection;
/// 所有section计算获取最大的高度
@property(nonatomic, assign)BOOL autoMaxSize;
/// 所有section计算获取最大的高度
@property(nonatomic, assign)CGFloat size;
@property(nonatomic, assign)BOOL canReuseCell;
@property(nonatomic, assign, readonly)CGFloat maxContentWidth;
@property(nonatomic, strong)NSMutableArray *sections;
@property(nonatomic, copy)void(^scrollDidScroll)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
@property(nonatomic, copy)void(^configureCollectionView)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
+ (instancetype)sectionAutoWithSection:(FMLayoutBaseSection *)section;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCrossTransformSection.h
================================================
//
// FMLayoutCrossTransformSection.h
// FMLayoutKit
//
// Created by 郑桂华 on 2020/7/15.
//
#import "FMLayoutCrossSection.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, FMLayoutCrossTransformType) {
///什么都不做
FMLayoutCrossTransformNone,
///缩小0.9 + 0.1*进度
FMLayoutCrossTransformScale,
///简拼App首页样式 M_PI_4 * 0.5 * 进度
FMLayoutCrossTransformCrooked,
///折叠效果
FMLayoutCrossTransformFold,
};
///Cell是需要做处理的cell, progress是指cell中心点到屏幕边缘移动的进度 -1 ~ 1 0为在最中间 -1在左边 1在右边
typedef void(^FMLayoutCrossTransformBlock)(UICollectionViewCell *cell, CGFloat progress);
///当前仅针对横向做适配 更多的动画
@interface FMLayoutCrossTransformSection : FMLayoutCrossSection
///形变类型
@property(nonatomic, assign)FMLayoutCrossTransformType transformType;
///如果有该Block 则优先执行此block
@property(nonatomic, copy)FMLayoutCrossTransformBlock __nullable transformBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutDebugLog.h
================================================
//
// FMLayoutDebugLog.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/17.
//
#import
NS_ASSUME_NONNULL_BEGIN
extern void FMLayoutLog(NSString *format);
extern void FMLayoutOpenLog(void);
extern void FMLayoutCloseLog(void);
extern NSInteger FMLayoutRandomValue(NSInteger start, NSInteger end);
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutDynamicSection.h
================================================
//
// FMLayoutDynamicSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMLayoutBaseSection.h"
#import "FMLayoutElement.h"
NS_ASSUME_NONNULL_BEGIN
///返回cell大小的block 横向-返回宽度 纵向-返回高度
typedef CGFloat(^FMLayoutItemOtherBlock)(id section, NSInteger item);
typedef CGFloat(^FMLayoutAutoHeightLaterBlock)(id section, NSInteger item, CGFloat autoHeight);
///动态 可以注册多种cell 宽度固定 高度可以自适应 但需要用block填充数据 需要设置deqCellReturnReuseId该block值以获取cell 高度亦可以通过手动计算heightBlock返回 手动计算优先级要高
@interface FMLayoutDynamicSection : FMLayoutBaseSection
/// yes时 布局耗时比较长 是否自动计算高度 需设置configurationCell方法填充数据 仅支持纵向布局时使用
@property(nonatomic, assign)BOOL autoHeightFixedWidth;
@property(nonatomic, copy)FMLayoutAutoHeightLaterBlock autoHeightLaterHander;
///cell固定一个方向的大小 纵向-宽度 横向-高度
@property(nonatomic, assign)CGFloat cellFixedSize;
///需要注册的cell元素
@property(nonatomic, strong)NSArray *cellElements;
///固定单一分组 当固定单一分组时 可以不用手动配置deqCellReturnReuseId
@property(nonatomic, strong)FMLayoutElement *cellElement;
///获取cell的复用FMLayoutElement
@property(nonatomic, copy)FMLayoutElement *(^deqCellReturnElement)(FMLayoutDynamicSection *section, NSInteger item);
///填充数据 仅当autoHeightFixedWidth为Yes时有用
@property(nonatomic, copy)void(^configurationCell)(FMLayoutDynamicSection *section, UICollectionViewCell *cell, NSInteger item);
///block返回手动计算的高度 优先级比自动的高
@property(nonatomic, copy)FMLayoutItemOtherBlock otherBlock;
- (CGFloat)autoHeightVerticalWithWidth:(CGFloat)fixedWidth index:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutElement.h
================================================
//
// FMLayoutElement.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutElement : NSObject
@property(nonatomic, copy)NSString *reuseIdentifier;
@property(nonatomic, assign)BOOL isNib;
@property(nonatomic, weak)Class viewClass;///视图的类
+ (instancetype)elementWithViewClass:(Class)vCalss;
+ (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib;
+ (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
- (void)registerElementWithCollection:(UICollectionView *)collectionView;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFillSection.h
================================================
//
// FMLayoutFillSection.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/4/11.
//
#import "FMLayoutDynamicSection.h"
NS_ASSUME_NONNULL_BEGIN
///返回cell大小的block
typedef CGSize(^FMLayoutItemSizeBlock)(id section, NSInteger item);
///支持纵向插横向 只可以上对齐以及左对齐
@interface FMLayoutFillSection : FMLayoutDynamicSection
@property(nonatomic, copy)FMLayoutItemSizeBlock sizeBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFixedSection.h
================================================
//
// FMLayoutFixedSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMLayoutBaseSection.h"
#import "FMLayoutElement.h"
NS_ASSUME_NONNULL_BEGIN
///固定cell的大小 单一一种cell样式 支持同样cell是否可以横向滚动 内嵌collectionView 支持纵向插横向
@interface FMLayoutFixedSection : FMLayoutBaseSection
@property(nonatomic, assign)CGSize itemSize;///分组cell大小
@property(nonatomic, strong)FMLayoutElement *cellElement;///固定分组
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFooter.h
================================================
//
// FMLayoutFooter.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMSupplementary.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutFooter : FMSupplementary
/// 距离最后Item的距离 纵向-上方 横向-左边
@property(nonatomic, assign)CGFloat topMargin;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutHeader.h
================================================
//
// FMLayoutHeader.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMSupplementary.h"
NS_ASSUME_NONNULL_BEGIN
/// 悬浮方式
typedef NS_ENUM(NSInteger, FMLayoutHeaderType) {
///跟着滚动
FMLayoutHeaderTypeFixed,
///悬浮在顶部 跟着section动
FMLayoutHeaderTypeSuspension,
///悬浮在顶部 不跟随section动 如果出现多个可能会被覆盖
FMLayoutHeaderTypeSuspensionAlways,
///仅支持在第一个头部 下拉放大效果
FMLayoutHeaderTypeSuspensionBigger
};
@interface FMLayoutHeader : FMSupplementary
/// 显示方式 是悬浮 还是跟着滚动 默认跟着滚动
@property(nonatomic, assign)FMLayoutHeaderType type;
/// 悬浮模式时距离顶部的高度 可以来设置两个悬浮的方式 多个顶部悬浮时 可以通过这个来达到层叠悬浮的模式
@property(nonatomic, assign)CGFloat suspensionTopMargin;
/// 距离第一个Item的距离 纵向-下方 横向-右边
@property(nonatomic, assign)CGFloat lastMargin;
///是否黏在顶部 目前仅支持FMLayoutHeaderTypeSuspensionAlways, FMLayoutHeaderTypeSuspensionBigger悬浮模式 不同的type效果不同 FMLayoutHeaderTypeSuspensionAlways是下拉黏在当前位置 上拉黏在顶部 而FMLayoutHeaderTypeSuspensionBiggers是上拉黏在顶部 下拉时放大效果
@property(nonatomic, assign)BOOL isStickTop;
/// 缩放模式(SuspensionBigger)下最小值 横向-宽度 纵向-高度 该值请务必小于size 默认是0
@property(nonatomic, assign)CGFloat minSize;
/// 缩放模式(SuspensionBigger)下最大值 横向-宽度 纵向-高度 该值请务必大于size 默认是CGFLOAT_MAX
@property(nonatomic, assign)CGFloat maxSize;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutKit-umbrella.h
================================================
#ifdef __OBJC__
#import
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "FMLayoutBackground.h"
#import "FMLayoutElement.h"
#import "FMLayoutFooter.h"
#import "FMLayoutHeader.h"
#import "FMSupplementary.h"
#import "FMCollectionLayoutAttributes.h"
#import "FMKVOArrayObject.h"
#import "FMLayout.h"
#import "FMLayoutView.h"
#import "FMTeslaLayoutView.h"
#import "FMTeslaSuspensionHeightChangeDelegate.h"
#import "FMLayoutCrossSection.h"
#import "FMLayoutAbsoluteSection.h"
#import "FMLayoutBaseSection.h"
#import "FMLayoutDynamicSection.h"
#import "FMLayoutFillSection.h"
#import "FMLayoutFixedSection.h"
#import "FMLayoutLabelSection.h"
FOUNDATION_EXPORT double FMLayoutKitVersionNumber;
FOUNDATION_EXPORT const unsigned char FMLayoutKitVersionString[];
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutKit.h
================================================
//
// FMLayoutKit.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/9.
//
#ifndef FMLayoutKit_h
#define FMLayoutKit_h
#import "FMTeslaLayoutView.h"
#import "FMLayoutView.h"
#import "FMLayout.h"
#import "FMCollectionLayoutAttributes.h"
#import "FMTeslaSuspensionHeightChangeDelegate.h"
#import "FMLayoutFixedSection.h"
#import "FMLayoutDynamicSection.h"
#import "FMLayoutLabelSection.h"
#import "FMLayoutFillSection.h"
#import "FMLayoutAbsoluteSection.h"
#import "FMLayoutCrossSection.h"
#import "FMLayoutCrossTransformSection.h"
#import "FMLayoutCombineSection.h"
#import "FMLayoutScaleSection.h"
#import "FMSupplementary.h"
#import "FMLayoutHeader.h"
#import "FMLayoutFooter.h"
#import "FMLayoutBackground.h"
#endif /* FMLayoutKit_h */
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutLabelSection.h
================================================
//
// FMLayoutLabelSection.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/4/8.
//
#import "FMLayoutDynamicSection.h"
#import "FMLayoutElement.h"
NS_ASSUME_NONNULL_BEGIN
///返回cell大小的block
typedef CGFloat(^FMLayoutItemWidthBlock)(id section, NSInteger item);
///当到第多少个的时候超出最大行 可移除数据处理 itemDatas会清理 否则frame为zero
typedef CGFloat(^FMLayoutOverItemBlock)(id section, NSInteger item);
///标签式布局 根据文本伸缩布局 宽度不够 换行 适用于历史搜索记录 sku选择等样式
@interface FMLayoutLabelSection : FMLayoutDynamicSection
///最大行数 超出讲不显示 纵向布局时生效
@property(nonatomic, assign)NSInteger maxLine;
///cell固定的高度
@property(nonatomic, assign)CGFloat cellFixedHeight;
///cell最大宽度 不设置的话 就是collection的宽度减去左右分组内边距
@property(nonatomic, assign)CGFloat cellMaxWidth;
///block返回手动计算的宽度
@property(nonatomic, copy)FMLayoutItemWidthBlock widthBlock;
///block返回手动计算的宽度
@property(nonatomic, copy)FMLayoutOverItemBlock overItemBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutScaleSection.h
================================================
//
// FMLayoutScaleSection.h
// FMLayoutKit
//
// Created by 郑桂华 on 2020/7/20.
//
#import "FMLayoutDynamicSection.h"
NS_ASSUME_NONNULL_BEGIN
///支持两种设置固定大小的方式 一种直接给数组sizeNums 一种给比例字符串scales 后设置的生效
@interface FMLayoutScaleSection : FMLayoutDynamicSection
/// 纵向布局 则是宽度比例 横向布局 则是高度比例 例如纵向布局时该值为: 1:2:3 则就是3列 宽度比为剩下的值的比例 仅支持当前样式 可以是小数值 但不能为非数值类型
@property(nonatomic, copy)NSString *scales;
///每一列的固定大小 如:@[@100, @200] 则表示两列 一个固定宽度为100 另外一列为200 共两列
@property(nonatomic, strong)NSArray *sizeNums;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutView.h
================================================
//
// FMLayoutView.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import "FMLayout.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutView : UICollectionView
@property(nonatomic, weak)FMLayout *layout;
///重写了set get 目标指向->layout.sections
@property(nonatomic)NSMutableArray *sections;
@property(nonatomic, assign)BOOL reloadOlnyChanged;
///是否允许长按拖拽排序 不支持夸分组 分组需要开启canLongPressExchange才可以移动拖拽排序
@property(nonatomic, assign)BOOL enableLongPressDrag;
///长按拖拽开始时配置cell显示的样式
@property(nonatomic, copy)UIView *(^configureSourceView)(UICollectionViewCell *sourceCell);
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout NS_UNAVAILABLE;
- (instancetype)initHorizontal;
- (instancetype)initHorizontalWithFrame:(CGRect)frame;
/// 循环遍历出更改过的sections 如果有过增删分组 请使用原有的reloadData方法
- (void)reloadChangedSectionsData;
///获取到滚动到indexPath位置偏移量 如果获取到的不准确 请先调用layoutIfNeeded方法
- (CGPoint)contentOffsetScrollToIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMSupplementary.h
================================================
//
// FMSupplementary.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMLayoutElement.h"
typedef NS_ENUM(NSInteger, FMLayoutZIndex) {
///最底层 头部 底部 Item的下方
FMLayoutZIndexBg = -9999,
///Item的下方
FMLayoutZIndexBackOfItem = -1,
/// 自动悬浮可能会被覆盖
FMLayoutZIndexAuto = 0,
/// Item的上方
FMLayoutZIndexFrontOfItem = 1,
/// 最最上方
FMLayoutZIndexFrontAlways = 9999
};
NS_ASSUME_NONNULL_BEGIN
/// 请使用子类Footer, Header, Background
@interface FMSupplementary : FMLayoutElement
///该Element的大小 纵向-高度 横向-宽度
@property(nonatomic, assign)CGFloat size;
///视图层级 最上方还是最下方等
@property(nonatomic, assign)FMLayoutZIndex zIndex;
///内边距 HeaderFooter受sectionInset影响 Background不受sectionInset影响
@property(nonatomic, assign)UIEdgeInsets inset;
///Element类型 Header Footer Background等
@property(nonatomic, copy, readonly)NSString *elementKind;
///是否自适应高度 仅当垂直布局时可用
@property(nonatomic, assign)BOOL autoHeight;
@property(nonatomic, copy)void(^configureDataAutoHeight)(UICollectionReusableView *view);
+ (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass;
+ (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib;
+ (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
- (UICollectionReusableView *)dequeueReusableViewWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath;
- (void)updateHeightWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath maxWidth:(CGFloat)maxWidth;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMTeslaLayoutView.h
================================================
//
// FMTeslaLayoutView.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/8.
// Copyright © 2020 周发明. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@class FMLayoutView, FMTeslaLayoutView, FMLayoutBaseSection;
@protocol FMTeslaLayoutViewDelegate
@optional
///滚动结束事件
- (void)tesla:(FMTeslaLayoutView *)tesla didScrollEnd:(NSInteger)index currentScrollView:(UIScrollView *)scrollView;
///滚动事件
- (void)tesla:(FMTeslaLayoutView *)tesla scrollViewDidScroll:(UIScrollView *)scrollView;
/// 当前上下滚动的事件
- (void)tesla:(FMTeslaLayoutView *)tesla currentScrollViewScrollDidScroll:(UIScrollView *)currentScrollView contentOffset:(CGPoint)contentOffset;
/// 配置FMCollectionLayoutView
///2
- (void)tesla:(FMTeslaLayoutView *)tesla currentShowScrollView:(UIScrollView *)scrollView index:(NSInteger)index;
///0 即将根据Index创建FMCollectionLayoutView
- (void)tesla:(FMTeslaLayoutView *)tesla willCreateScrollViewWithIndex:(NSInteger)index;
///0.5 根据Index自己创建FMCollectionLayoutView shareHeight为共享头部的高度 请将shareHeight顶部空出来并且请保持不使用contentInset 如果返回nil会自动创建FMLayoutView
- (UIScrollView *)tesla:(FMTeslaLayoutView *)tesla customCreateWithIndex:(NSInteger)index shareHeight:(CGFloat)shareHeight;
///1 根据Index创建完毕UIScrollView
- (void)tesla:(FMTeslaLayoutView *)tesla didCreatedScrollViewWithIndex:(NSInteger)index scrollView:(UIScrollView *)scrollView;
/// 悬停标签控制view的尺寸最小高度 可以留着做效果
- (CGFloat)shareSuspensionMinHeightWithTesla:(FMTeslaLayoutView *)tesla;
@end
@protocol FMTeslaLayoutViewDataSource
@required
- (NSInteger)numberOfScreenInTesla:(FMTeslaLayoutView *)tesla;
@optional
- (NSArray *)shareSectionsInTesla:(FMTeslaLayoutView *)tesla;
@end
@class FMLayoutBaseSection;
@interface FMTeslaLayoutView : UIView
@property(nonatomic, weak)id delegate;
@property(nonatomic, weak)id dataSource;
@property(nonatomic, assign)BOOL horizontalCanScroll;
@property(nonatomic, assign)BOOL allShareStickTop;
@property(nonatomic, assign)NSInteger selectIndex;
@property(nonatomic, assign)BOOL isLoadSubView;
@property(nonatomic, assign)CGFloat shareHeight;
@property(nonatomic, strong, readonly)FMLayoutView *shareLayoutView;
- (void)reLoadSubViews;
- (void)reloadData;
- (void)reloadDataWithIndex:(NSInteger)index;
- (void)scrollToIndex:(NSInteger)index animated:(BOOL)animated;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMTeslaSuspensionHeightChangeDelegate.h
================================================
//
// FMTeslaSuspensionHeightChangeDelegate.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/5/13.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@protocol FMTeslaSuspensionHeightChangeDelegate
- (void)teslaSuspensionHeaderShouldShowHeight:(CGFloat)showHeight;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Modules/module.modulemap
================================================
framework module FMLayoutKit {
umbrella header "FMLayoutKit-umbrella.h"
export *
module * { export * }
}
================================================
FILE: Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework.dSYM/Contents/Info.plist
================================================
CFBundleDevelopmentRegion
English
CFBundleIdentifier
com.apple.xcode.dsym.org.cocoapods.FMLayoutKit
CFBundleInfoDictionaryVersion
6.0
CFBundlePackageType
dSYM
CFBundleSignature
????
CFBundleShortVersionString
1.0.0
CFBundleVersion
1
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMCollectionLayoutAttributes.h
================================================
//
// FMCollectionLayoutAttributes.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/25.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import "FMLayoutBaseSection.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMCollectionLayoutAttributes : UICollectionViewLayoutAttributes
@property(nonatomic, assign)FMLayoutDirection direction;
+ (instancetype)headerAttributesWithSection:(FMLayoutBaseSection *)section;
- (instancetype)updateHeaderAttributesWithSection:(FMLayoutBaseSection *)section;
+ (instancetype)suspensionShowHeaderAttributes:(FMLayoutBaseSection *)section;
+ (instancetype)footerAttributesWithSection:(FMLayoutBaseSection *)section;
- (instancetype)updateFooterAttributesWithSection:(FMLayoutBaseSection *)section;
+ (instancetype)bgAttributesWithSection:(FMLayoutBaseSection *)section;
- (instancetype)updateBgAttributesWithSection:(FMLayoutBaseSection *)section;
- (void)_onlyUpdateOffsetWith:(FMLayoutBaseSection *)section;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMCollectionViewDelegateDataSourceProvider.h
================================================
//
// FMCollectionViewDelegateDataSourceProvider.h
// FMLayoutKit
//
// Created by 郑桂华 on 2021/3/27.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@class FMLayoutBaseSection;
@interface FMCollectionViewDelegateDataSourceProvider : NSObject
///重写了set get 目标指向->layout.sections
@property(nonatomic, strong)NSMutableArray *sections;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMKVOArrayObject.h
================================================
//
// FMKVOArrayObject.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/6/5.
//
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMKVOArrayObject : NSObject
@property (strong,nonatomic)NSMutableArray *targetArray;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayout.h
================================================
//
// FMLayout.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/16.
//
#import
#import "FMLayoutBaseSection.h"
#import "FMLayoutHeader.h"
#import "FMLayoutFooter.h"
#import "FMLayoutBackground.h"
#import "FMCollectionLayoutAttributes.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayout : UICollectionViewLayout
@property(nonatomic, assign)FMLayoutDirection direction;
@property(nonatomic, strong)NSMutableArray *sections;
///最后固定边距 跟section的inset无关 contentSize会自动加上去
@property(nonatomic, assign)CGFloat fixedLastMargin;
///是否只计算改变的布局 NO为每一次 都是重新计算所有布局
@property(nonatomic, assign)BOOL reLayoutOlnyChanged;
///最小可滑动的大小 横向-高度 纵向-宽度
@property(nonatomic, assign)CGFloat minContentSize;
///第一个Section的偏移量
@property(nonatomic, assign)CGFloat firstSectionOffset;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutAbsoluteSection.h
================================================
//
// FMLayoutAbsoluteSection.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/6/9.
//
#import "FMLayoutDynamicSection.h"
NS_ASSUME_NONNULL_BEGIN
typedef CGRect(^FMLayoutBaseSectionItemFrameBlock)(id section, NSInteger item);
///支持纵向插横向
@interface FMLayoutAbsoluteSection : FMLayoutDynamicSection
@property(nonatomic, copy)FMLayoutBaseSectionItemFrameBlock frameBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutBackground.h
================================================
//
// FMLayoutBackground.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/27.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMSupplementary.h"
NS_ASSUME_NONNULL_BEGIN
static NSString *const UICollectionElementKindSectionBackground = @"UICollectionElementKindSectionBackground";
@interface FMLayoutBackground : FMSupplementary
+ (instancetype)bgWithViewClass:(Class)viewClass;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutBaseSection.h
================================================
//
// FMLayoutBaseSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import
#import "FMLayoutDebugLog.h"
typedef NS_ENUM(NSUInteger, FMLayoutHandleType) {
/// 重新计算 重新布局该分组
FMLayoutHandleTypeReLayout,
/// 只是分组偏移高度改变
FMLayoutHandleTypeOlnyChangeOffset,
/// 追加布局
FMLayoutHandleTypeAppend
};
///布局方向
typedef NS_ENUM(NSUInteger, FMLayoutDirection) {
///垂直布局
FMLayoutDirectionVertical,
///水平布局
FMLayoutDirectionHorizontal
};
///Item布局方向
typedef NS_ENUM(NSUInteger, FMLayoutItemDirection) {
///水平左边开始 垂直上面开始
FMLayoutItemDirectionLeftTop,
///水平右边开始 垂直下面开始
FMLayoutItemDirectionRightBottom
};
///长按移动的方式
typedef NS_ENUM(NSUInteger, FMLayoutLongMoveType) {
///方格布局时 长按哪里 该cell的中心点就会跟着移动
FMLayoutLongMoveItem,
///列表布局时 上下移动 X不动
FMLayoutLongMoveTable,
};
NS_ASSUME_NONNULL_BEGIN
@class FMLayoutHeader, FMLayoutFooter, FMLayoutBackground, FMCollectionLayoutAttributes;
@interface FMLayoutBaseSection : NSObject
///仅当布局生效之后才会有值
@property(nonatomic, weak)UICollectionView *collectionView;
///仅当布局生效之后才会有值
@property(nonatomic, strong)NSIndexPath *indexPath;
///是否需要重新计算 设置为NO 布局会重新计算
@property(nonatomic, assign)FMLayoutDirection direction;
@property(nonatomic, assign)BOOL hasHandle;
@property(nonatomic, assign)NSInteger handleItemStart;///重新计算哪一个开始
@property(nonatomic, assign)FMLayoutHandleType handleType;
@property(nonatomic, assign)CGFloat changeOffset;
@property(nonatomic, strong)FMCollectionLayoutAttributes * __nullable bgAttribute;
@property(nonatomic, strong)FMCollectionLayoutAttributes * __nullable headerAttribute;
@property(nonatomic, strong)FMCollectionLayoutAttributes * __nullable footerAttribute;
@property(nonatomic, strong)NSArray *itemsAttribute;
/// 分组偏移高度
@property(nonatomic, assign)CGFloat sectionOffset;
/// 分组大小 纵向-高度 横向-宽度
@property(nonatomic, assign)CGFloat sectionSize;
/// 分组内边距
@property(nonatomic, assign)UIEdgeInsets sectionInset;
///分组头部
@property(nonatomic, strong)FMLayoutHeader * __nullable header;
///分组底部
@property(nonatomic, strong)FMLayoutFooter * __nullable footer;
///分组背景
@property(nonatomic, strong)FMLayoutBackground * __nullable background;
///cell行间距
@property(nonatomic, assign)CGFloat lineSpace;
///cell间距
@property(nonatomic, assign)CGFloat itemSpace;
///cell列数 纵向-列数 横向-行数
@property(nonatomic, assign)NSInteger column;
///每一列的高度缓存
@property(nonatomic, strong)NSMutableDictionary *columnSizes;
///每一个分组的item个数 默认返回itemDatas.count
@property(nonatomic, assign)NSInteger itemCount;
///cell数据数组
@property(nonatomic, strong)NSMutableArray *itemDatas;
///是否可以长按移动排序该分组 默认No 需配合FMLayoutView的enableLongPressDrag使用
@property(nonatomic, assign)BOOL canLongPressExchange;
///长按移动的方式
@property(nonatomic, assign)FMLayoutLongMoveType moveType;
///某一个item是否可以移动替换
@property(nonatomic, copy)BOOL(^canLongPressExchangeItem)(id section, NSInteger item);
/// 显示隐藏
@property(nonatomic, assign, getter=isHidden)BOOL hidden;
///第一个Item的Y值 横向纵向有区别
@property(nonatomic, assign, readonly)CGFloat firstItemStartY;
///第一个Item的X值 横向纵向有区别
@property(nonatomic, assign, readonly)CGFloat firstItemStartX;
///配置一下Attributes
@property(nonatomic, copy)void(^configureCellLayoutAttributes)(id section, UICollectionViewLayoutAttributes *attributes, NSInteger item);
///配置头部的block
@property(nonatomic, copy)void(^configureHeaderData)(FMLayoutBaseSection *section, UICollectionReusableView *header);
///配置底部的block
@property(nonatomic, copy)void(^configureFooterData)(FMLayoutBaseSection *section, UICollectionReusableView *footer);
///配置背景的block
@property(nonatomic, copy)void(^configureBg)(FMLayoutBaseSection *section, UICollectionReusableView *bg);
///配置Cell的block
@property(nonatomic, copy)void(^configureCellData)(FMLayoutBaseSection *section, UICollectionViewCell *cell, NSInteger item);
///cell点击事件
@property(nonatomic, copy)void(^clickCellBlock)(FMLayoutBaseSection *section, NSInteger item);
+ (instancetype)sectionWithSectionInset:(UIEdgeInsets)inset itemSpace:(CGFloat)itemSpace lineSpace:(CGFloat)lineSpace column:(NSInteger)column;
///标记某一个改变 即将刷新该分组的大小 主要用于动态分组
- (void)markChangeAt:(NSInteger)index;
- (void)handleLayout;
- (BOOL)intersectsRect:(CGRect)rect;
- (void)prepareHeader;
- (void)prepareFooter;
- (void)prepareItems;
- (void)prepareBackground;
- (NSArray *)showLayoutAttributesInRect:(CGRect)rect;
///即将显示的头部布局
- (UICollectionViewLayoutAttributes *)showHeaderLayout;
///根据index计算出该布局对象
- (FMCollectionLayoutAttributes *)getItemAttributesWithIndex:(NSInteger)index;
- (BOOL)prepareLayoutItemsIsOlnyChangeOffset;
///获取最小高度的列
- (NSInteger)getMinHeightColumn;
- (CGFloat)getColumnMaxHeight;
///重置所有列的高度缓存
- (void)resetcolumnSizes;
///交叉布局时单一sention的大小
- (CGFloat)crossSingleSectionSize;
- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
- (UICollectionViewCell *)dequeueReusableCellForIndexPath:(NSIndexPath *)indexPath;
- (UICollectionViewCell *)dequeueReusableCellForIndexPath:(NSIndexPath *)indexPath collectionView:(UICollectionView *)collectionView;
- (void)registerCells;
- (void)registerCellsWithCollectionView:(UICollectionView *)collectionView;
- (void)reload;
- (void)reloadItem:(NSInteger)item;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCombineSection.h
================================================
//
// FMLayoutCombineSection.h
// FMLayoutKit
//
// Created by 郑桂华 on 2020/7/12.
//
#import "FMLayoutBaseSection.h"
NS_ASSUME_NONNULL_BEGIN
///可以将不同Cell, 不同的布局方式, 放到同一个分组去合并,只合并cell, 如果子分组有头部和底部讲被忽略,合并分组的头部与底部不影响配置, cell的点击事件已经在init方法中配置block分发到子分组上 合并分组不支持拖拽排序 想要支持 可以继承自该类重写canLongPressExchange的get方法 并实现- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
@interface FMLayoutCombineSection : FMLayoutBaseSection
@property(nonatomic, readonly)NSArray *subSections;
+ (instancetype)combineSections:(NSArray *)sections;
- (void)appendSection:(FMLayoutBaseSection *)section;
- (void)insetSection:(FMLayoutBaseSection *)section atIndex:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCrossSection.h
================================================
//
// FMLayoutCrossSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/16.
//
#import "FMLayoutBaseSection.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutCrossSection : FMLayoutBaseSection
@property(nonatomic, assign, readonly)FMLayoutDirection crossDirection;
/// 所有section计算获取最大的高度
@property(nonatomic, assign)BOOL autoMaxSize;
/// 所有section计算获取最大的高度
@property(nonatomic, assign)CGFloat size;
@property(nonatomic, assign)BOOL canReuseCell;
@property(nonatomic, assign, readonly)CGFloat maxContentWidth;
@property(nonatomic, strong)NSMutableArray *sections;
@property(nonatomic, copy)void(^scrollDidScroll)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
@property(nonatomic, copy)void(^configureCollectionView)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
+ (instancetype)sectionAutoWithSection:(FMLayoutBaseSection *)section;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCrossTransformSection.h
================================================
//
// FMLayoutCrossTransformSection.h
// FMLayoutKit
//
// Created by 郑桂华 on 2020/7/15.
//
#import "FMLayoutCrossSection.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, FMLayoutCrossTransformType) {
///什么都不做
FMLayoutCrossTransformNone,
///缩小0.9 + 0.1*进度
FMLayoutCrossTransformScale,
///简拼App首页样式 M_PI_4 * 0.5 * 进度
FMLayoutCrossTransformCrooked,
///折叠效果
FMLayoutCrossTransformFold,
};
///Cell是需要做处理的cell, progress是指cell中心点到屏幕边缘移动的进度 -1 ~ 1 0为在最中间 -1在左边 1在右边
typedef void(^FMLayoutCrossTransformBlock)(UICollectionViewCell *cell, CGFloat progress);
///当前仅针对横向做适配 更多的动画
@interface FMLayoutCrossTransformSection : FMLayoutCrossSection
///形变类型
@property(nonatomic, assign)FMLayoutCrossTransformType transformType;
///如果有该Block 则优先执行此block
@property(nonatomic, copy)FMLayoutCrossTransformBlock __nullable transformBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutDebugLog.h
================================================
//
// FMLayoutDebugLog.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/17.
//
#import
NS_ASSUME_NONNULL_BEGIN
extern void FMLayoutLog(NSString *format);
extern void FMLayoutOpenLog(void);
extern void FMLayoutCloseLog(void);
extern NSInteger FMLayoutRandomValue(NSInteger start, NSInteger end);
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutDynamicSection.h
================================================
//
// FMLayoutDynamicSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMLayoutBaseSection.h"
#import "FMLayoutElement.h"
NS_ASSUME_NONNULL_BEGIN
///返回cell大小的block 横向-返回宽度 纵向-返回高度
typedef CGFloat(^FMLayoutItemOtherBlock)(id section, NSInteger item);
typedef CGFloat(^FMLayoutAutoHeightLaterBlock)(id section, NSInteger item, CGFloat autoHeight);
///动态 可以注册多种cell 宽度固定 高度可以自适应 但需要用block填充数据 需要设置deqCellReturnReuseId该block值以获取cell 高度亦可以通过手动计算heightBlock返回 手动计算优先级要高
@interface FMLayoutDynamicSection : FMLayoutBaseSection
/// yes时 布局耗时比较长 是否自动计算高度 需设置configurationCell方法填充数据 仅支持纵向布局时使用
@property(nonatomic, assign)BOOL autoHeightFixedWidth;
@property(nonatomic, copy)FMLayoutAutoHeightLaterBlock autoHeightLaterHander;
///cell固定一个方向的大小 纵向-宽度 横向-高度
@property(nonatomic, assign)CGFloat cellFixedSize;
///需要注册的cell元素
@property(nonatomic, strong)NSArray *cellElements;
///固定单一分组 当固定单一分组时 可以不用手动配置deqCellReturnReuseId
@property(nonatomic, strong)FMLayoutElement *cellElement;
///获取cell的复用FMLayoutElement
@property(nonatomic, copy)FMLayoutElement *(^deqCellReturnElement)(FMLayoutDynamicSection *section, NSInteger item);
///填充数据 仅当autoHeightFixedWidth为Yes时有用
@property(nonatomic, copy)void(^configurationCell)(FMLayoutDynamicSection *section, UICollectionViewCell *cell, NSInteger item);
///block返回手动计算的高度 优先级比自动的高
@property(nonatomic, copy)FMLayoutItemOtherBlock otherBlock;
- (CGFloat)autoHeightVerticalWithWidth:(CGFloat)fixedWidth index:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutElement.h
================================================
//
// FMLayoutElement.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutElement : NSObject
@property(nonatomic, copy)NSString *reuseIdentifier;
@property(nonatomic, assign)BOOL isNib;
@property(nonatomic, weak)Class viewClass;///视图的类
+ (instancetype)elementWithViewClass:(Class)vCalss;
+ (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib;
+ (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
- (void)registerElementWithCollection:(UICollectionView *)collectionView;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFillSection.h
================================================
//
// FMLayoutFillSection.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/4/11.
//
#import "FMLayoutDynamicSection.h"
NS_ASSUME_NONNULL_BEGIN
///返回cell大小的block
typedef CGSize(^FMLayoutItemSizeBlock)(id section, NSInteger item);
///支持纵向插横向 只可以上对齐以及左对齐
@interface FMLayoutFillSection : FMLayoutDynamicSection
@property(nonatomic, copy)FMLayoutItemSizeBlock sizeBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFixedSection.h
================================================
//
// FMLayoutFixedSection.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMLayoutBaseSection.h"
#import "FMLayoutElement.h"
NS_ASSUME_NONNULL_BEGIN
///固定cell的大小 单一一种cell样式 支持同样cell是否可以横向滚动 内嵌collectionView 支持纵向插横向
@interface FMLayoutFixedSection : FMLayoutBaseSection
@property(nonatomic, assign)CGSize itemSize;///分组cell大小
@property(nonatomic, strong)FMLayoutElement *cellElement;///固定分组
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFooter.h
================================================
//
// FMLayoutFooter.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMSupplementary.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutFooter : FMSupplementary
/// 距离最后Item的距离 纵向-上方 横向-左边
@property(nonatomic, assign)CGFloat topMargin;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutHeader.h
================================================
//
// FMLayoutHeader.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMSupplementary.h"
NS_ASSUME_NONNULL_BEGIN
/// 悬浮方式
typedef NS_ENUM(NSInteger, FMLayoutHeaderType) {
///跟着滚动
FMLayoutHeaderTypeFixed,
///悬浮在顶部 跟着section动
FMLayoutHeaderTypeSuspension,
///悬浮在顶部 不跟随section动 如果出现多个可能会被覆盖
FMLayoutHeaderTypeSuspensionAlways,
///仅支持在第一个头部 下拉放大效果
FMLayoutHeaderTypeSuspensionBigger
};
@interface FMLayoutHeader : FMSupplementary
/// 显示方式 是悬浮 还是跟着滚动 默认跟着滚动
@property(nonatomic, assign)FMLayoutHeaderType type;
/// 悬浮模式时距离顶部的高度 可以来设置两个悬浮的方式 多个顶部悬浮时 可以通过这个来达到层叠悬浮的模式
@property(nonatomic, assign)CGFloat suspensionTopMargin;
/// 距离第一个Item的距离 纵向-下方 横向-右边
@property(nonatomic, assign)CGFloat lastMargin;
///是否黏在顶部 目前仅支持FMLayoutHeaderTypeSuspensionAlways, FMLayoutHeaderTypeSuspensionBigger悬浮模式 不同的type效果不同 FMLayoutHeaderTypeSuspensionAlways是下拉黏在当前位置 上拉黏在顶部 而FMLayoutHeaderTypeSuspensionBiggers是上拉黏在顶部 下拉时放大效果
@property(nonatomic, assign)BOOL isStickTop;
/// 缩放模式(SuspensionBigger)下最小值 横向-宽度 纵向-高度 该值请务必小于size 默认是0
@property(nonatomic, assign)CGFloat minSize;
/// 缩放模式(SuspensionBigger)下最大值 横向-宽度 纵向-高度 该值请务必大于size 默认是CGFLOAT_MAX
@property(nonatomic, assign)CGFloat maxSize;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutKit-umbrella.h
================================================
#ifdef __OBJC__
#import
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "FMLayoutBackground.h"
#import "FMLayoutElement.h"
#import "FMLayoutFooter.h"
#import "FMLayoutHeader.h"
#import "FMSupplementary.h"
#import "FMCollectionLayoutAttributes.h"
#import "FMKVOArrayObject.h"
#import "FMLayout.h"
#import "FMLayoutView.h"
#import "FMTeslaLayoutView.h"
#import "FMTeslaSuspensionHeightChangeDelegate.h"
#import "FMLayoutCrossSection.h"
#import "FMLayoutAbsoluteSection.h"
#import "FMLayoutBaseSection.h"
#import "FMLayoutDynamicSection.h"
#import "FMLayoutFillSection.h"
#import "FMLayoutFixedSection.h"
#import "FMLayoutLabelSection.h"
FOUNDATION_EXPORT double FMLayoutKitVersionNumber;
FOUNDATION_EXPORT const unsigned char FMLayoutKitVersionString[];
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutKit.h
================================================
//
// FMLayoutKit.h
// FMLayoutKit
//
// Created by 周发明 on 2020/6/9.
//
#ifndef FMLayoutKit_h
#define FMLayoutKit_h
#import "FMTeslaLayoutView.h"
#import "FMLayoutView.h"
#import "FMLayout.h"
#import "FMCollectionLayoutAttributes.h"
#import "FMTeslaSuspensionHeightChangeDelegate.h"
#import "FMLayoutFixedSection.h"
#import "FMLayoutDynamicSection.h"
#import "FMLayoutLabelSection.h"
#import "FMLayoutFillSection.h"
#import "FMLayoutAbsoluteSection.h"
#import "FMLayoutCrossSection.h"
#import "FMLayoutCrossTransformSection.h"
#import "FMLayoutCombineSection.h"
#import "FMLayoutScaleSection.h"
#import "FMSupplementary.h"
#import "FMLayoutHeader.h"
#import "FMLayoutFooter.h"
#import "FMLayoutBackground.h"
#endif /* FMLayoutKit_h */
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutLabelSection.h
================================================
//
// FMLayoutLabelSection.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/4/8.
//
#import "FMLayoutDynamicSection.h"
#import "FMLayoutElement.h"
NS_ASSUME_NONNULL_BEGIN
///返回cell大小的block
typedef CGFloat(^FMLayoutItemWidthBlock)(id section, NSInteger item);
///当到第多少个的时候超出最大行 可移除数据处理 itemDatas会清理 否则frame为zero
typedef CGFloat(^FMLayoutOverItemBlock)(id section, NSInteger item);
///标签式布局 根据文本伸缩布局 宽度不够 换行 适用于历史搜索记录 sku选择等样式
@interface FMLayoutLabelSection : FMLayoutDynamicSection
///最大行数 超出讲不显示 纵向布局时生效
@property(nonatomic, assign)NSInteger maxLine;
///cell固定的高度
@property(nonatomic, assign)CGFloat cellFixedHeight;
///cell最大宽度 不设置的话 就是collection的宽度减去左右分组内边距
@property(nonatomic, assign)CGFloat cellMaxWidth;
///block返回手动计算的宽度
@property(nonatomic, copy)FMLayoutItemWidthBlock widthBlock;
///block返回手动计算的宽度
@property(nonatomic, copy)FMLayoutOverItemBlock overItemBlock;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutScaleSection.h
================================================
//
// FMLayoutScaleSection.h
// FMLayoutKit
//
// Created by 郑桂华 on 2020/7/20.
//
#import "FMLayoutDynamicSection.h"
NS_ASSUME_NONNULL_BEGIN
///支持两种设置固定大小的方式 一种直接给数组sizeNums 一种给比例字符串scales 后设置的生效
@interface FMLayoutScaleSection : FMLayoutDynamicSection
/// 纵向布局 则是宽度比例 横向布局 则是高度比例 例如纵向布局时该值为: 1:2:3 则就是3列 宽度比为剩下的值的比例 仅支持当前样式 可以是小数值 但不能为非数值类型
@property(nonatomic, copy)NSString *scales;
///每一列的固定大小 如:@[@100, @200] 则表示两列 一个固定宽度为100 另外一列为200 共两列
@property(nonatomic, strong)NSArray *sizeNums;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutView.h
================================================
//
// FMLayoutView.h
// FMLayoutKit
//
// Created by 周发明 on 2020/4/1.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import
#import "FMLayout.h"
NS_ASSUME_NONNULL_BEGIN
@interface FMLayoutView : UICollectionView
@property(nonatomic, weak)FMLayout *layout;
///重写了set get 目标指向->layout.sections
@property(nonatomic)NSMutableArray *sections;
@property(nonatomic, assign)BOOL reloadOlnyChanged;
///是否允许长按拖拽排序 不支持夸分组 分组需要开启canLongPressExchange才可以移动拖拽排序
@property(nonatomic, assign)BOOL enableLongPressDrag;
///长按拖拽开始时配置cell显示的样式
@property(nonatomic, copy)UIView *(^configureSourceView)(UICollectionViewCell *sourceCell);
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout NS_UNAVAILABLE;
- (instancetype)initHorizontal;
- (instancetype)initHorizontalWithFrame:(CGRect)frame;
/// 循环遍历出更改过的sections 如果有过增删分组 请使用原有的reloadData方法
- (void)reloadChangedSectionsData;
///获取到滚动到indexPath位置偏移量 如果获取到的不准确 请先调用layoutIfNeeded方法
- (CGPoint)contentOffsetScrollToIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMSupplementary.h
================================================
//
// FMSupplementary.h
// FMLayoutKit
//
// Created by 周发明 on 2020/3/20.
// Copyright © 2020 ZhouFaMing. All rights reserved.
//
#import "FMLayoutElement.h"
typedef NS_ENUM(NSInteger, FMLayoutZIndex) {
///最底层 头部 底部 Item的下方
FMLayoutZIndexBg = -9999,
///Item的下方
FMLayoutZIndexBackOfItem = -1,
/// 自动悬浮可能会被覆盖
FMLayoutZIndexAuto = 0,
/// Item的上方
FMLayoutZIndexFrontOfItem = 1,
/// 最最上方
FMLayoutZIndexFrontAlways = 9999
};
NS_ASSUME_NONNULL_BEGIN
/// 请使用子类Footer, Header, Background
@interface FMSupplementary : FMLayoutElement
///该Element的大小 纵向-高度 横向-宽度
@property(nonatomic, assign)CGFloat size;
///视图层级 最上方还是最下方等
@property(nonatomic, assign)FMLayoutZIndex zIndex;
///内边距 HeaderFooter受sectionInset影响 Background不受sectionInset影响
@property(nonatomic, assign)UIEdgeInsets inset;
///Element类型 Header Footer Background等
@property(nonatomic, copy, readonly)NSString *elementKind;
///是否自适应高度 仅当垂直布局时可用
@property(nonatomic, assign)BOOL autoHeight;
@property(nonatomic, copy)void(^configureDataAutoHeight)(UICollectionReusableView *view);
+ (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass;
+ (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib;
+ (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
- (UICollectionReusableView *)dequeueReusableViewWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath;
- (void)updateHeightWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath maxWidth:(CGFloat)maxWidth;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMTeslaLayoutView.h
================================================
//
// FMTeslaLayoutView.h
// FMCollectionLayout_Example
//
// Created by 周发明 on 2020/4/8.
// Copyright © 2020 周发明. All rights reserved.
//
#import
NS_ASSUME_NONNULL_BEGIN
@class FMLayoutView, FMTeslaLayoutView, FMLayoutBaseSection;
@protocol FMTeslaLayoutViewDelegate
@optional
///滚动结束事件
- (void)tesla:(FMTeslaLayoutView *)tesla didScrollEnd:(NSInteger)index currentScrollView:(UIScrollView *)scrollView;
///滚动事件
- (void)tesla:(FMTeslaLayoutView *)tesla scrollViewDidScroll:(UIScrollView *)scrollView;
/// 当前上下滚动的事件
- (void)tesla:(FMTeslaLayoutView *)tesla currentScrollViewScrollDidScroll:(UIScrollView *)currentScrollView contentOffset:(CGPoint)contentOffset;
/// 配置FMCollectionLayoutView
///2
- (void)tesla:(FMTeslaLayoutView *)tesla currentShowScrollView:(UIScrollView *)scrollView index:(NSInteger)index;
///0 即将根据Index创建FMCollectionLayoutView
- (void)tesla:(FMTeslaLayoutView *)tesla willCreateScrollViewWithIndex:(NSInteger)index;
///0.5 根据Index自己创建FMCollectionLayoutView shareHeight为共享头部的高度 请将shareHeight顶部空出来并且请保持不使用contentInset 如果返回nil会自动创建FMLayoutView
- (UIScrollView *)tesla:(FMTeslaLayoutView *)tesla customCreateWithIndex:(NSInteger)index shareHeight:(CGFloat)shareHeight;
///1 根据Index创建完毕UIScrollView
- (void)tesla:(FMTeslaLayoutView *)tesla didCreatedScrollViewWithIndex:(NSInteger)index scrollView:(UIScrollView *)scrollView;
/// 悬停标签控制view的尺寸最小高度 可以留着做效果
- (CGFloat)shareSuspensionMinHeightWithTesla:(FMTeslaLayoutView *)tesla;
@end
@protocol FMTeslaLayoutViewDataSource
@required
- (NSInteger)numberOfScreenInTesla:(FMTeslaLayoutView *)tesla;
@optional
- (NSArray *)shareSectionsInTesla:(FMTeslaLayoutView *)tesla;
@end
@class FMLayoutBaseSection;
@interface FMTeslaLayoutView : UIView
@property(nonatomic, weak)id delegate;
@property(nonatomic, weak)id dataSource;
@property(nonatomic, assign)BOOL horizontalCanScroll;
@property(nonatomic, assign)BOOL allShareStickTop;
@property(nonatomic, assign)NSInteger selectIndex;
@property(nonatomic, assign)BOOL isLoadSubView;
@property(nonatomic, assign)CGFloat shareHeight;
@property(nonatomic, strong, readonly)FMLayoutView *shareLayoutView;
- (void)reLoadSubViews;
- (void)reloadData;
- (void)reloadDataWithIndex:(NSInteger)index;
- (void)scrollToIndex:(NSInteger)index animated:(BOOL)animated;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMTeslaSuspensionHeightChangeDelegate.h
================================================
//
// FMTeslaSuspensionHeightChangeDelegate.h
// FMCollectionLayout
//
// Created by 周发明 on 2020/5/13.
//
#import
#import
NS_ASSUME_NONNULL_BEGIN
@protocol FMTeslaSuspensionHeightChangeDelegate
- (void)teslaSuspensionHeaderShouldShowHeight:(CGFloat)showHeight;
@end
NS_ASSUME_NONNULL_END
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Modules/module.modulemap
================================================
framework module FMLayoutKit {
umbrella header "FMLayoutKit-umbrella.h"
export *
module * { export * }
}
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/_CodeSignature/CodeResources
================================================
files
Headers/FMCollectionLayoutAttributes.h
O30CaMucsbKG9WZDD3g+/zKOfdM=
Headers/FMCollectionViewDelegateDataSourceProvider.h
ev11njieIDCjXwxq6tE+0Go8Q2U=
Headers/FMKVOArrayObject.h
kcnRWMH4+X3NQn5BnR4efXkPI48=
Headers/FMLayout.h
GQflgCCxMGkdLFIzyju1R2oJpf8=
Headers/FMLayoutAbsoluteSection.h
O2MA6nxtIs47HrBwUMOfcGnKJ0o=
Headers/FMLayoutBackground.h
VDMpTbXT56ILF3enWgcXnqMGjMw=
Headers/FMLayoutBaseSection.h
/jt+WcYC5h4CPHpOd36eSQTRBaQ=
Headers/FMLayoutCombineSection.h
9Ca3BaGs0c0NZfHxfZBVe0ls80w=
Headers/FMLayoutCrossSection.h
o9roPsaYR9oNzgGMFa75Mgdza+Y=
Headers/FMLayoutCrossTransformSection.h
U0NpzET9KhE6GXk9fud72RNE3lQ=
Headers/FMLayoutDebugLog.h
hcHKMAS/zM85rSoKqtsh6YPUy8w=
Headers/FMLayoutDynamicSection.h
HuPBUS7LR6FPj2xsGw0DepkUn4s=
Headers/FMLayoutElement.h
8j97vy5ReOxOZXWPyyMjpBjkw5o=
Headers/FMLayoutFillSection.h
q1u3flkbJnUv725iYsAygE/6IW8=
Headers/FMLayoutFixedSection.h
MaPJ7tBFI85i25VGlklMiKKpzDE=
Headers/FMLayoutFooter.h
2lb118tQJQgTVN+H8Og17xOvvhE=
Headers/FMLayoutHeader.h
2wulFPpiYi/uV9uGVsKHMJCern0=
Headers/FMLayoutKit-umbrella.h
NilO12VNPzuBwk9x0e+lUmull3c=
Headers/FMLayoutKit.h
HIOrlmnsHlyNgbdt0mpA4dFeWBc=
Headers/FMLayoutLabelSection.h
ycPX8RMIU6oksfjdGsVVn9O5TEI=
Headers/FMLayoutScaleSection.h
gSjqmu/leF1yywOB6KoxeRlRgEA=
Headers/FMLayoutView.h
lP9zIEONqVArA35PEiIK+U+ZNvU=
Headers/FMSupplementary.h
4a81sKmC/RMUO21JmLjBKfzkkMw=
Headers/FMTeslaLayoutView.h
MwC3uPYp+7202ev6w/XfyvYLCys=
Headers/FMTeslaSuspensionHeightChangeDelegate.h
lOgFWZxDriaARd5TuLHcp2YF6cw=
Info.plist
5NI7zkvtvlP1PUJdEbD/5J1CORQ=
Modules/module.modulemap
Z/5Z445TliUtpHrk7ROMmxzLDDs=
files2
Headers/FMCollectionLayoutAttributes.h
hash
O30CaMucsbKG9WZDD3g+/zKOfdM=
hash2
SCNBzW5LNIJojXnqfuLkihBO9jxcvnaqvxxfo7C5ZSU=
Headers/FMCollectionViewDelegateDataSourceProvider.h
hash
ev11njieIDCjXwxq6tE+0Go8Q2U=
hash2
hmN+CbBZ5zDyEvRMSd6A4eviJMA/TyC5tlorNzw5fnc=
Headers/FMKVOArrayObject.h
hash
kcnRWMH4+X3NQn5BnR4efXkPI48=
hash2
0KMHK5kWPwHQZh/osJ5KJXYeAdvZCy6/8D9IMJkw2SA=
Headers/FMLayout.h
hash
GQflgCCxMGkdLFIzyju1R2oJpf8=
hash2
H67WFCXwOBJ9siR0RKfVNt6BrkIzHgl/zwkxIbbNpbo=
Headers/FMLayoutAbsoluteSection.h
hash
O2MA6nxtIs47HrBwUMOfcGnKJ0o=
hash2
iHDQ1jmsfUo7qcQ9OTjQkgp96/rrOotyC9htTOWlNR0=
Headers/FMLayoutBackground.h
hash
VDMpTbXT56ILF3enWgcXnqMGjMw=
hash2
CW8h/vOzmlw2IZWcpW2jxe1PxDARpIxonuIDQmlIbO0=
Headers/FMLayoutBaseSection.h
hash
/jt+WcYC5h4CPHpOd36eSQTRBaQ=
hash2
batXXhqHW6BZLaMuSziNhp9yQAxbau9enfI6FpqOhoU=
Headers/FMLayoutCombineSection.h
hash
9Ca3BaGs0c0NZfHxfZBVe0ls80w=
hash2
PMvd1uBvRZLMthhOlow1a0S+2bJDgb988cjE6bNZv8A=
Headers/FMLayoutCrossSection.h
hash
o9roPsaYR9oNzgGMFa75Mgdza+Y=
hash2
mvztFegbd5j2kvLnIwTnffY9pnYNIRvz4g/nx++OxOU=
Headers/FMLayoutCrossTransformSection.h
hash
U0NpzET9KhE6GXk9fud72RNE3lQ=
hash2
sl96qMNZLLBY2KBdLqxoaLG3SXlrSAHqX/SSBR0McCU=
Headers/FMLayoutDebugLog.h
hash
hcHKMAS/zM85rSoKqtsh6YPUy8w=
hash2
taTztq608Z0h6SkQDJaxSV3a2QYVQ2JRAb3lLKD2ZHQ=
Headers/FMLayoutDynamicSection.h
hash
HuPBUS7LR6FPj2xsGw0DepkUn4s=
hash2
Ej6/nfzrs2yDH+Xyv7AXjHNuabjb1IjuJABodcY4PAg=
Headers/FMLayoutElement.h
hash
8j97vy5ReOxOZXWPyyMjpBjkw5o=
hash2
cQd54yq/XVSc9SxhSuoeR4dvAjTmHq91IFYzq/2Wm7k=
Headers/FMLayoutFillSection.h
hash
q1u3flkbJnUv725iYsAygE/6IW8=
hash2
hIeJINDY21gLv90VaEso9+R63BPmrJhsaU555Y3GehQ=
Headers/FMLayoutFixedSection.h
hash
MaPJ7tBFI85i25VGlklMiKKpzDE=
hash2
OaeTbT6Ir6FA5F8e9U2Uj12RqsNm2eqidKj65UP+nII=
Headers/FMLayoutFooter.h
hash
2lb118tQJQgTVN+H8Og17xOvvhE=
hash2
BzXtLCIkyAliHRZhU/pptph0GD8qO5vqHm4qpOIi5Fs=
Headers/FMLayoutHeader.h
hash
2wulFPpiYi/uV9uGVsKHMJCern0=
hash2
yqZkxJvTMCrIsIuwdJdd5DlZ248yYOjlPoKLsgyXG7k=
Headers/FMLayoutKit-umbrella.h
hash
NilO12VNPzuBwk9x0e+lUmull3c=
hash2
E3e3VBmNAwNU19lpVXQEHYxEkSaaWAbBJY0Eq58c8Ws=
Headers/FMLayoutKit.h
hash
HIOrlmnsHlyNgbdt0mpA4dFeWBc=
hash2
s/tvERCyPoaAw5jgZwhSjMp98KLnuCelRQ5bcINp3Cw=
Headers/FMLayoutLabelSection.h
hash
ycPX8RMIU6oksfjdGsVVn9O5TEI=
hash2
4Ak8oYcQ4Spvazli4pEKXOPJsAZshRCbULAUUh/aYLY=
Headers/FMLayoutScaleSection.h
hash
gSjqmu/leF1yywOB6KoxeRlRgEA=
hash2
ghd2zI3OpDzgd2XwCmOTli/Mmhv2IVNQ2O8qGVf8Pzc=
Headers/FMLayoutView.h
hash
lP9zIEONqVArA35PEiIK+U+ZNvU=
hash2
wx1am9ZXc6sIjDDUjDzFt5WiPAZ2qiHc8qqqladCHTk=
Headers/FMSupplementary.h
hash
4a81sKmC/RMUO21JmLjBKfzkkMw=
hash2
6YuaHMqNEUl3gOPsuX/Ih+Du453H5qJkiy8w6TBQcIo=
Headers/FMTeslaLayoutView.h
hash
MwC3uPYp+7202ev6w/XfyvYLCys=
hash2
LmsHrUMgKAW/6tk+QQYlrokJ+VC02DZvvASDEW4pmMs=
Headers/FMTeslaSuspensionHeightChangeDelegate.h
hash
lOgFWZxDriaARd5TuLHcp2YF6cw=
hash2
9Ku3TOJdLs0MlcrBFJzVg/LUZdqDeGMT7KTainEGyPE=
Modules/module.modulemap
hash
Z/5Z445TliUtpHrk7ROMmxzLDDs=
hash2
2Leh+uJxOIj87iJ/CeSmmbcCjX20OMUO5G6x3eou49I=
rules
^.*
^.*\.lproj/
optional
weight
1000
^.*\.lproj/locversion.plist$
omit
weight
1100
^Base\.lproj/
weight
1010
^version.plist$
rules2
.*\.dSYM($|/)
weight
11
^(.*/)?\.DS_Store$
omit
weight
2000
^.*
^.*\.lproj/
optional
weight
1000
^.*\.lproj/locversion.plist$
omit
weight
1100
^Base\.lproj/
weight
1010
^Info\.plist$
omit
weight
20
^PkgInfo$
omit
weight
20
^embedded\.provisionprofile$
weight
20
^version\.plist$
weight
20
================================================
FILE: Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework.dSYM/Contents/Info.plist
================================================
CFBundleDevelopmentRegion
English
CFBundleIdentifier
com.apple.xcode.dsym.org.cocoapods.FMLayoutKit
CFBundleInfoDictionaryVersion
6.0
CFBundlePackageType
dSYM
CFBundleSignature
????
CFBundleShortVersionString
1.0.0
CFBundleVersion
1
================================================
FILE: Example/Podfile
================================================
use_frameworks!
platform :ios, '8.0'
target 'FMLayoutKit_Example' do
pod 'FMLayoutKit', :path => '../'
pod 'Masonry'
# pod 'MJRefresh'
target 'FMLayoutKit_Tests' do
inherit! :search_paths
end
end
================================================
FILE: Example/Pods/Local Podspecs/FMLayoutKit.podspec.json
================================================
{
"name": "FMLayoutKit",
"version": "1.0.0",
"summary": "A short description of FMLayoutKit.",
"description": "TODO: Add long description of the pod here.",
"homepage": "https://github.com/Coder_FM/FMLayoutKit",
"license": {
"type": "MIT",
"file": "LICENSE"
},
"authors": {
"Coder_FM": "zhoufaming251@163.com"
},
"source": {
"git": "https://github.com/Coder_FM/FMLayoutKit.git",
"tag": "1.0.0"
},
"platforms": {
"ios": "8.0"
},
"source_files": "FMLayoutKit/Classes/**/*"
}
================================================
FILE: Example/Pods/Masonry/LICENSE
================================================
Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: Example/Pods/Masonry/Masonry/MASCompositeConstraint.h
================================================
//
// MASCompositeConstraint.h
// Masonry
//
// Created by Jonas Budelmann on 21/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASConstraint.h"
#import "MASUtilities.h"
/**
* A group of MASConstraint objects
*/
@interface MASCompositeConstraint : MASConstraint
/**
* Creates a composite with a predefined array of children
*
* @param children child MASConstraints
*
* @return a composite constraint
*/
- (id)initWithChildren:(NSArray *)children;
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASCompositeConstraint.m
================================================
//
// MASCompositeConstraint.m
// Masonry
//
// Created by Jonas Budelmann on 21/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASCompositeConstraint.h"
#import "MASConstraint+Private.h"
@interface MASCompositeConstraint ()
@property (nonatomic, strong) id mas_key;
@property (nonatomic, strong) NSMutableArray *childConstraints;
@end
@implementation MASCompositeConstraint
- (id)initWithChildren:(NSArray *)children {
self = [super init];
if (!self) return nil;
_childConstraints = [children mutableCopy];
for (MASConstraint *constraint in _childConstraints) {
constraint.delegate = self;
}
return self;
}
#pragma mark - MASConstraintDelegate
- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint {
NSUInteger index = [self.childConstraints indexOfObject:constraint];
NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint);
[self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint];
}
- (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
id strongDelegate = self.delegate;
MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
newConstraint.delegate = self;
[self.childConstraints addObject:newConstraint];
return newConstraint;
}
#pragma mark - NSLayoutConstraint multiplier proxies
- (MASConstraint * (^)(CGFloat))multipliedBy {
return ^id(CGFloat multiplier) {
for (MASConstraint *constraint in self.childConstraints) {
constraint.multipliedBy(multiplier);
}
return self;
};
}
- (MASConstraint * (^)(CGFloat))dividedBy {
return ^id(CGFloat divider) {
for (MASConstraint *constraint in self.childConstraints) {
constraint.dividedBy(divider);
}
return self;
};
}
#pragma mark - MASLayoutPriority proxy
- (MASConstraint * (^)(MASLayoutPriority))priority {
return ^id(MASLayoutPriority priority) {
for (MASConstraint *constraint in self.childConstraints) {
constraint.priority(priority);
}
return self;
};
}
#pragma mark - NSLayoutRelation proxy
- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation {
return ^id(id attr, NSLayoutRelation relation) {
for (MASConstraint *constraint in self.childConstraints.copy) {
constraint.equalToWithRelation(attr, relation);
}
return self;
};
}
#pragma mark - attribute chaining
- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
[self constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
return self;
}
#pragma mark - Animator proxy
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
- (MASConstraint *)animator {
for (MASConstraint *constraint in self.childConstraints) {
[constraint animator];
}
return self;
}
#endif
#pragma mark - debug helpers
- (MASConstraint * (^)(id))key {
return ^id(id key) {
self.mas_key = key;
int i = 0;
for (MASConstraint *constraint in self.childConstraints) {
constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]);
}
return self;
};
}
#pragma mark - NSLayoutConstraint constant setters
- (void)setInsets:(MASEdgeInsets)insets {
for (MASConstraint *constraint in self.childConstraints) {
constraint.insets = insets;
}
}
- (void)setInset:(CGFloat)inset {
for (MASConstraint *constraint in self.childConstraints) {
constraint.inset = inset;
}
}
- (void)setOffset:(CGFloat)offset {
for (MASConstraint *constraint in self.childConstraints) {
constraint.offset = offset;
}
}
- (void)setSizeOffset:(CGSize)sizeOffset {
for (MASConstraint *constraint in self.childConstraints) {
constraint.sizeOffset = sizeOffset;
}
}
- (void)setCenterOffset:(CGPoint)centerOffset {
for (MASConstraint *constraint in self.childConstraints) {
constraint.centerOffset = centerOffset;
}
}
#pragma mark - MASConstraint
- (void)activate {
for (MASConstraint *constraint in self.childConstraints) {
[constraint activate];
}
}
- (void)deactivate {
for (MASConstraint *constraint in self.childConstraints) {
[constraint deactivate];
}
}
- (void)install {
for (MASConstraint *constraint in self.childConstraints) {
constraint.updateExisting = self.updateExisting;
[constraint install];
}
}
- (void)uninstall {
for (MASConstraint *constraint in self.childConstraints) {
[constraint uninstall];
}
}
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASConstraint+Private.h
================================================
//
// MASConstraint+Private.h
// Masonry
//
// Created by Nick Tymchenko on 29/04/14.
// Copyright (c) 2014 cloudling. All rights reserved.
//
#import "MASConstraint.h"
@protocol MASConstraintDelegate;
@interface MASConstraint ()
/**
* Whether or not to check for an existing constraint instead of adding constraint
*/
@property (nonatomic, assign) BOOL updateExisting;
/**
* Usually MASConstraintMaker but could be a parent MASConstraint
*/
@property (nonatomic, weak) id delegate;
/**
* Based on a provided value type, is equal to calling:
* NSNumber - setOffset:
* NSValue with CGPoint - setPointOffset:
* NSValue with CGSize - setSizeOffset:
* NSValue with MASEdgeInsets - setInsets:
*/
- (void)setLayoutConstantWithValue:(NSValue *)value;
@end
@interface MASConstraint (Abstract)
/**
* Sets the constraint relation to given NSLayoutRelation
* returns a block which accepts one of the following:
* MASViewAttribute, UIView, NSValue, NSArray
* see readme for more details.
*/
- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation;
/**
* Override to set a custom chaining behaviour
*/
- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
@end
@protocol MASConstraintDelegate
/**
* Notifies the delegate when the constraint needs to be replaced with another constraint. For example
* A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks
*/
- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint;
- (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASConstraint.h
================================================
//
// MASConstraint.h
// Masonry
//
// Created by Jonas Budelmann on 22/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASUtilities.h"
/**
* Enables Constraints to be created with chainable syntax
* Constraint can represent single NSLayoutConstraint (MASViewConstraint)
* or a group of NSLayoutConstraints (MASComposisteConstraint)
*/
@interface MASConstraint : NSObject
// Chaining Support
/**
* Modifies the NSLayoutConstraint constant,
* only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
* NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
*/
- (MASConstraint * (^)(MASEdgeInsets insets))insets;
/**
* Modifies the NSLayoutConstraint constant,
* only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
* NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
*/
- (MASConstraint * (^)(CGFloat inset))inset;
/**
* Modifies the NSLayoutConstraint constant,
* only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
* NSLayoutAttributeWidth, NSLayoutAttributeHeight
*/
- (MASConstraint * (^)(CGSize offset))sizeOffset;
/**
* Modifies the NSLayoutConstraint constant,
* only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
* NSLayoutAttributeCenterX, NSLayoutAttributeCenterY
*/
- (MASConstraint * (^)(CGPoint offset))centerOffset;
/**
* Modifies the NSLayoutConstraint constant
*/
- (MASConstraint * (^)(CGFloat offset))offset;
/**
* Modifies the NSLayoutConstraint constant based on a value type
*/
- (MASConstraint * (^)(NSValue *value))valueOffset;
/**
* Sets the NSLayoutConstraint multiplier property
*/
- (MASConstraint * (^)(CGFloat multiplier))multipliedBy;
/**
* Sets the NSLayoutConstraint multiplier to 1.0/dividedBy
*/
- (MASConstraint * (^)(CGFloat divider))dividedBy;
/**
* Sets the NSLayoutConstraint priority to a float or MASLayoutPriority
*/
- (MASConstraint * (^)(MASLayoutPriority priority))priority;
/**
* Sets the NSLayoutConstraint priority to MASLayoutPriorityLow
*/
- (MASConstraint * (^)(void))priorityLow;
/**
* Sets the NSLayoutConstraint priority to MASLayoutPriorityMedium
*/
- (MASConstraint * (^)(void))priorityMedium;
/**
* Sets the NSLayoutConstraint priority to MASLayoutPriorityHigh
*/
- (MASConstraint * (^)(void))priorityHigh;
/**
* Sets the constraint relation to NSLayoutRelationEqual
* returns a block which accepts one of the following:
* MASViewAttribute, UIView, NSValue, NSArray
* see readme for more details.
*/
- (MASConstraint * (^)(id attr))equalTo;
/**
* Sets the constraint relation to NSLayoutRelationGreaterThanOrEqual
* returns a block which accepts one of the following:
* MASViewAttribute, UIView, NSValue, NSArray
* see readme for more details.
*/
- (MASConstraint * (^)(id attr))greaterThanOrEqualTo;
/**
* Sets the constraint relation to NSLayoutRelationLessThanOrEqual
* returns a block which accepts one of the following:
* MASViewAttribute, UIView, NSValue, NSArray
* see readme for more details.
*/
- (MASConstraint * (^)(id attr))lessThanOrEqualTo;
/**
* Optional semantic property which has no effect but improves the readability of constraint
*/
- (MASConstraint *)with;
/**
* Optional semantic property which has no effect but improves the readability of constraint
*/
- (MASConstraint *)and;
/**
* Creates a new MASCompositeConstraint with the called attribute and reciever
*/
- (MASConstraint *)left;
- (MASConstraint *)top;
- (MASConstraint *)right;
- (MASConstraint *)bottom;
- (MASConstraint *)leading;
- (MASConstraint *)trailing;
- (MASConstraint *)width;
- (MASConstraint *)height;
- (MASConstraint *)centerX;
- (MASConstraint *)centerY;
- (MASConstraint *)baseline;
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
- (MASConstraint *)firstBaseline;
- (MASConstraint *)lastBaseline;
#endif
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
- (MASConstraint *)leftMargin;
- (MASConstraint *)rightMargin;
- (MASConstraint *)topMargin;
- (MASConstraint *)bottomMargin;
- (MASConstraint *)leadingMargin;
- (MASConstraint *)trailingMargin;
- (MASConstraint *)centerXWithinMargins;
- (MASConstraint *)centerYWithinMargins;
#endif
/**
* Sets the constraint debug name
*/
- (MASConstraint * (^)(id key))key;
// NSLayoutConstraint constant Setters
// for use outside of mas_updateConstraints/mas_makeConstraints blocks
/**
* Modifies the NSLayoutConstraint constant,
* only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
* NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
*/
- (void)setInsets:(MASEdgeInsets)insets;
/**
* Modifies the NSLayoutConstraint constant,
* only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
* NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
*/
- (void)setInset:(CGFloat)inset;
/**
* Modifies the NSLayoutConstraint constant,
* only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
* NSLayoutAttributeWidth, NSLayoutAttributeHeight
*/
- (void)setSizeOffset:(CGSize)sizeOffset;
/**
* Modifies the NSLayoutConstraint constant,
* only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
* NSLayoutAttributeCenterX, NSLayoutAttributeCenterY
*/
- (void)setCenterOffset:(CGPoint)centerOffset;
/**
* Modifies the NSLayoutConstraint constant
*/
- (void)setOffset:(CGFloat)offset;
// NSLayoutConstraint Installation support
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
/**
* Whether or not to go through the animator proxy when modifying the constraint
*/
@property (nonatomic, copy, readonly) MASConstraint *animator;
#endif
/**
* Activates an NSLayoutConstraint if it's supported by an OS.
* Invokes install otherwise.
*/
- (void)activate;
/**
* Deactivates previously installed/activated NSLayoutConstraint.
*/
- (void)deactivate;
/**
* Creates a NSLayoutConstraint and adds it to the appropriate view.
*/
- (void)install;
/**
* Removes previously installed NSLayoutConstraint
*/
- (void)uninstall;
@end
/**
* Convenience auto-boxing macros for MASConstraint methods.
*
* Defining MAS_SHORTHAND_GLOBALS will turn on auto-boxing for default syntax.
* A potential drawback of this is that the unprefixed macros will appear in global scope.
*/
#define mas_equalTo(...) equalTo(MASBoxValue((__VA_ARGS__)))
#define mas_greaterThanOrEqualTo(...) greaterThanOrEqualTo(MASBoxValue((__VA_ARGS__)))
#define mas_lessThanOrEqualTo(...) lessThanOrEqualTo(MASBoxValue((__VA_ARGS__)))
#define mas_offset(...) valueOffset(MASBoxValue((__VA_ARGS__)))
#ifdef MAS_SHORTHAND_GLOBALS
#define equalTo(...) mas_equalTo(__VA_ARGS__)
#define greaterThanOrEqualTo(...) mas_greaterThanOrEqualTo(__VA_ARGS__)
#define lessThanOrEqualTo(...) mas_lessThanOrEqualTo(__VA_ARGS__)
#define offset(...) mas_offset(__VA_ARGS__)
#endif
@interface MASConstraint (AutoboxingSupport)
/**
* Aliases to corresponding relation methods (for shorthand macros)
* Also needed to aid autocompletion
*/
- (MASConstraint * (^)(id attr))mas_equalTo;
- (MASConstraint * (^)(id attr))mas_greaterThanOrEqualTo;
- (MASConstraint * (^)(id attr))mas_lessThanOrEqualTo;
/**
* A dummy method to aid autocompletion
*/
- (MASConstraint * (^)(id offset))mas_offset;
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASConstraint.m
================================================
//
// MASConstraint.m
// Masonry
//
// Created by Nick Tymchenko on 1/20/14.
//
#import "MASConstraint.h"
#import "MASConstraint+Private.h"
#define MASMethodNotImplemented() \
@throw [NSException exceptionWithName:NSInternalInconsistencyException \
reason:[NSString stringWithFormat:@"You must override %@ in a subclass.", NSStringFromSelector(_cmd)] \
userInfo:nil]
@implementation MASConstraint
#pragma mark - Init
- (id)init {
NSAssert(![self isMemberOfClass:[MASConstraint class]], @"MASConstraint is an abstract class, you should not instantiate it directly.");
return [super init];
}
#pragma mark - NSLayoutRelation proxies
- (MASConstraint * (^)(id))equalTo {
return ^id(id attribute) {
return self.equalToWithRelation(attribute, NSLayoutRelationEqual);
};
}
- (MASConstraint * (^)(id))mas_equalTo {
return ^id(id attribute) {
return self.equalToWithRelation(attribute, NSLayoutRelationEqual);
};
}
- (MASConstraint * (^)(id))greaterThanOrEqualTo {
return ^id(id attribute) {
return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual);
};
}
- (MASConstraint * (^)(id))mas_greaterThanOrEqualTo {
return ^id(id attribute) {
return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual);
};
}
- (MASConstraint * (^)(id))lessThanOrEqualTo {
return ^id(id attribute) {
return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual);
};
}
- (MASConstraint * (^)(id))mas_lessThanOrEqualTo {
return ^id(id attribute) {
return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual);
};
}
#pragma mark - MASLayoutPriority proxies
- (MASConstraint * (^)(void))priorityLow {
return ^id{
self.priority(MASLayoutPriorityDefaultLow);
return self;
};
}
- (MASConstraint * (^)(void))priorityMedium {
return ^id{
self.priority(MASLayoutPriorityDefaultMedium);
return self;
};
}
- (MASConstraint * (^)(void))priorityHigh {
return ^id{
self.priority(MASLayoutPriorityDefaultHigh);
return self;
};
}
#pragma mark - NSLayoutConstraint constant proxies
- (MASConstraint * (^)(MASEdgeInsets))insets {
return ^id(MASEdgeInsets insets){
self.insets = insets;
return self;
};
}
- (MASConstraint * (^)(CGFloat))inset {
return ^id(CGFloat inset){
self.inset = inset;
return self;
};
}
- (MASConstraint * (^)(CGSize))sizeOffset {
return ^id(CGSize offset) {
self.sizeOffset = offset;
return self;
};
}
- (MASConstraint * (^)(CGPoint))centerOffset {
return ^id(CGPoint offset) {
self.centerOffset = offset;
return self;
};
}
- (MASConstraint * (^)(CGFloat))offset {
return ^id(CGFloat offset){
self.offset = offset;
return self;
};
}
- (MASConstraint * (^)(NSValue *value))valueOffset {
return ^id(NSValue *offset) {
NSAssert([offset isKindOfClass:NSValue.class], @"expected an NSValue offset, got: %@", offset);
[self setLayoutConstantWithValue:offset];
return self;
};
}
- (MASConstraint * (^)(id offset))mas_offset {
// Will never be called due to macro
return nil;
}
#pragma mark - NSLayoutConstraint constant setter
- (void)setLayoutConstantWithValue:(NSValue *)value {
if ([value isKindOfClass:NSNumber.class]) {
self.offset = [(NSNumber *)value doubleValue];
} else if (strcmp(value.objCType, @encode(CGPoint)) == 0) {
CGPoint point;
[value getValue:&point];
self.centerOffset = point;
} else if (strcmp(value.objCType, @encode(CGSize)) == 0) {
CGSize size;
[value getValue:&size];
self.sizeOffset = size;
} else if (strcmp(value.objCType, @encode(MASEdgeInsets)) == 0) {
MASEdgeInsets insets;
[value getValue:&insets];
self.insets = insets;
} else {
NSAssert(NO, @"attempting to set layout constant with unsupported value: %@", value);
}
}
#pragma mark - Semantic properties
- (MASConstraint *)with {
return self;
}
- (MASConstraint *)and {
return self;
}
#pragma mark - Chaining
- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute __unused)layoutAttribute {
MASMethodNotImplemented();
}
- (MASConstraint *)left {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft];
}
- (MASConstraint *)top {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop];
}
- (MASConstraint *)right {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight];
}
- (MASConstraint *)bottom {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom];
}
- (MASConstraint *)leading {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading];
}
- (MASConstraint *)trailing {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing];
}
- (MASConstraint *)width {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth];
}
- (MASConstraint *)height {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight];
}
- (MASConstraint *)centerX {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX];
}
- (MASConstraint *)centerY {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY];
}
- (MASConstraint *)baseline {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline];
}
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
- (MASConstraint *)firstBaseline {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline];
}
- (MASConstraint *)lastBaseline {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline];
}
#endif
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
- (MASConstraint *)leftMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin];
}
- (MASConstraint *)rightMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin];
}
- (MASConstraint *)topMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin];
}
- (MASConstraint *)bottomMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin];
}
- (MASConstraint *)leadingMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin];
}
- (MASConstraint *)trailingMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin];
}
- (MASConstraint *)centerXWithinMargins {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins];
}
- (MASConstraint *)centerYWithinMargins {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins];
}
#endif
#pragma mark - Abstract
- (MASConstraint * (^)(CGFloat multiplier))multipliedBy { MASMethodNotImplemented(); }
- (MASConstraint * (^)(CGFloat divider))dividedBy { MASMethodNotImplemented(); }
- (MASConstraint * (^)(MASLayoutPriority priority))priority { MASMethodNotImplemented(); }
- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { MASMethodNotImplemented(); }
- (MASConstraint * (^)(id key))key { MASMethodNotImplemented(); }
- (void)setInsets:(MASEdgeInsets __unused)insets { MASMethodNotImplemented(); }
- (void)setInset:(CGFloat __unused)inset { MASMethodNotImplemented(); }
- (void)setSizeOffset:(CGSize __unused)sizeOffset { MASMethodNotImplemented(); }
- (void)setCenterOffset:(CGPoint __unused)centerOffset { MASMethodNotImplemented(); }
- (void)setOffset:(CGFloat __unused)offset { MASMethodNotImplemented(); }
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
- (MASConstraint *)animator { MASMethodNotImplemented(); }
#endif
- (void)activate { MASMethodNotImplemented(); }
- (void)deactivate { MASMethodNotImplemented(); }
- (void)install { MASMethodNotImplemented(); }
- (void)uninstall { MASMethodNotImplemented(); }
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASConstraintMaker.h
================================================
//
// MASConstraintMaker.h
// Masonry
//
// Created by Jonas Budelmann on 20/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASConstraint.h"
#import "MASUtilities.h"
typedef NS_OPTIONS(NSInteger, MASAttribute) {
MASAttributeLeft = 1 << NSLayoutAttributeLeft,
MASAttributeRight = 1 << NSLayoutAttributeRight,
MASAttributeTop = 1 << NSLayoutAttributeTop,
MASAttributeBottom = 1 << NSLayoutAttributeBottom,
MASAttributeLeading = 1 << NSLayoutAttributeLeading,
MASAttributeTrailing = 1 << NSLayoutAttributeTrailing,
MASAttributeWidth = 1 << NSLayoutAttributeWidth,
MASAttributeHeight = 1 << NSLayoutAttributeHeight,
MASAttributeCenterX = 1 << NSLayoutAttributeCenterX,
MASAttributeCenterY = 1 << NSLayoutAttributeCenterY,
MASAttributeBaseline = 1 << NSLayoutAttributeBaseline,
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline,
MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline,
#endif
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin,
MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin,
MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin,
MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin,
MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin,
MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin,
MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins,
MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins,
#endif
};
/**
* Provides factory methods for creating MASConstraints.
* Constraints are collected until they are ready to be installed
*
*/
@interface MASConstraintMaker : NSObject
/**
* The following properties return a new MASViewConstraint
* with the first item set to the makers associated view and the appropriate MASViewAttribute
*/
@property (nonatomic, strong, readonly) MASConstraint *left;
@property (nonatomic, strong, readonly) MASConstraint *top;
@property (nonatomic, strong, readonly) MASConstraint *right;
@property (nonatomic, strong, readonly) MASConstraint *bottom;
@property (nonatomic, strong, readonly) MASConstraint *leading;
@property (nonatomic, strong, readonly) MASConstraint *trailing;
@property (nonatomic, strong, readonly) MASConstraint *width;
@property (nonatomic, strong, readonly) MASConstraint *height;
@property (nonatomic, strong, readonly) MASConstraint *centerX;
@property (nonatomic, strong, readonly) MASConstraint *centerY;
@property (nonatomic, strong, readonly) MASConstraint *baseline;
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
@property (nonatomic, strong, readonly) MASConstraint *firstBaseline;
@property (nonatomic, strong, readonly) MASConstraint *lastBaseline;
#endif
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
@property (nonatomic, strong, readonly) MASConstraint *leftMargin;
@property (nonatomic, strong, readonly) MASConstraint *rightMargin;
@property (nonatomic, strong, readonly) MASConstraint *topMargin;
@property (nonatomic, strong, readonly) MASConstraint *bottomMargin;
@property (nonatomic, strong, readonly) MASConstraint *leadingMargin;
@property (nonatomic, strong, readonly) MASConstraint *trailingMargin;
@property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins;
@property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins;
#endif
/**
* Returns a block which creates a new MASCompositeConstraint with the first item set
* to the makers associated view and children corresponding to the set bits in the
* MASAttribute parameter. Combine multiple attributes via binary-or.
*/
@property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs);
/**
* Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges
* which generates the appropriate MASViewConstraint children (top, left, bottom, right)
* with the first item set to the makers associated view
*/
@property (nonatomic, strong, readonly) MASConstraint *edges;
/**
* Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize
* which generates the appropriate MASViewConstraint children (width, height)
* with the first item set to the makers associated view
*/
@property (nonatomic, strong, readonly) MASConstraint *size;
/**
* Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter
* which generates the appropriate MASViewConstraint children (centerX, centerY)
* with the first item set to the makers associated view
*/
@property (nonatomic, strong, readonly) MASConstraint *center;
/**
* Whether or not to check for an existing constraint instead of adding constraint
*/
@property (nonatomic, assign) BOOL updateExisting;
/**
* Whether or not to remove existing constraints prior to installing
*/
@property (nonatomic, assign) BOOL removeExisting;
/**
* initialises the maker with a default view
*
* @param view any MASConstraint are created with this view as the first item
*
* @return a new MASConstraintMaker
*/
- (id)initWithView:(MAS_VIEW *)view;
/**
* Calls install method on any MASConstraints which have been created by this maker
*
* @return an array of all the installed MASConstraints
*/
- (NSArray *)install;
- (MASConstraint * (^)(dispatch_block_t))group;
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASConstraintMaker.m
================================================
//
// MASConstraintMaker.m
// Masonry
//
// Created by Jonas Budelmann on 20/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASConstraintMaker.h"
#import "MASViewConstraint.h"
#import "MASCompositeConstraint.h"
#import "MASConstraint+Private.h"
#import "MASViewAttribute.h"
#import "View+MASAdditions.h"
@interface MASConstraintMaker ()
@property (nonatomic, weak) MAS_VIEW *view;
@property (nonatomic, strong) NSMutableArray *constraints;
@end
@implementation MASConstraintMaker
- (id)initWithView:(MAS_VIEW *)view {
self = [super init];
if (!self) return nil;
self.view = view;
self.constraints = NSMutableArray.new;
return self;
}
- (NSArray *)install {
if (self.removeExisting) {
NSArray *installedConstraints = [MASViewConstraint installedConstraintsForView:self.view];
for (MASConstraint *constraint in installedConstraints) {
[constraint uninstall];
}
}
NSArray *constraints = self.constraints.copy;
for (MASConstraint *constraint in constraints) {
constraint.updateExisting = self.updateExisting;
[constraint install];
}
[self.constraints removeAllObjects];
return constraints;
}
#pragma mark - MASConstraintDelegate
- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint {
NSUInteger index = [self.constraints indexOfObject:constraint];
NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint);
[self.constraints replaceObjectAtIndex:index withObject:replacementConstraint];
}
- (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
MASViewAttribute *viewAttribute = [[MASViewAttribute alloc] initWithView:self.view layoutAttribute:layoutAttribute];
MASViewConstraint *newConstraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:viewAttribute];
if ([constraint isKindOfClass:MASViewConstraint.class]) {
//replace with composite constraint
NSArray *children = @[constraint, newConstraint];
MASCompositeConstraint *compositeConstraint = [[MASCompositeConstraint alloc] initWithChildren:children];
compositeConstraint.delegate = self;
[self constraint:constraint shouldBeReplacedWithConstraint:compositeConstraint];
return compositeConstraint;
}
if (!constraint) {
newConstraint.delegate = self;
[self.constraints addObject:newConstraint];
}
return newConstraint;
}
- (MASConstraint *)addConstraintWithAttributes:(MASAttribute)attrs {
__unused MASAttribute anyAttribute = (MASAttributeLeft | MASAttributeRight | MASAttributeTop | MASAttributeBottom | MASAttributeLeading
| MASAttributeTrailing | MASAttributeWidth | MASAttributeHeight | MASAttributeCenterX
| MASAttributeCenterY | MASAttributeBaseline
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
| MASAttributeFirstBaseline | MASAttributeLastBaseline
#endif
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
| MASAttributeLeftMargin | MASAttributeRightMargin | MASAttributeTopMargin | MASAttributeBottomMargin
| MASAttributeLeadingMargin | MASAttributeTrailingMargin | MASAttributeCenterXWithinMargins
| MASAttributeCenterYWithinMargins
#endif
);
NSAssert((attrs & anyAttribute) != 0, @"You didn't pass any attribute to make.attributes(...)");
NSMutableArray *attributes = [NSMutableArray array];
if (attrs & MASAttributeLeft) [attributes addObject:self.view.mas_left];
if (attrs & MASAttributeRight) [attributes addObject:self.view.mas_right];
if (attrs & MASAttributeTop) [attributes addObject:self.view.mas_top];
if (attrs & MASAttributeBottom) [attributes addObject:self.view.mas_bottom];
if (attrs & MASAttributeLeading) [attributes addObject:self.view.mas_leading];
if (attrs & MASAttributeTrailing) [attributes addObject:self.view.mas_trailing];
if (attrs & MASAttributeWidth) [attributes addObject:self.view.mas_width];
if (attrs & MASAttributeHeight) [attributes addObject:self.view.mas_height];
if (attrs & MASAttributeCenterX) [attributes addObject:self.view.mas_centerX];
if (attrs & MASAttributeCenterY) [attributes addObject:self.view.mas_centerY];
if (attrs & MASAttributeBaseline) [attributes addObject:self.view.mas_baseline];
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
if (attrs & MASAttributeFirstBaseline) [attributes addObject:self.view.mas_firstBaseline];
if (attrs & MASAttributeLastBaseline) [attributes addObject:self.view.mas_lastBaseline];
#endif
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
if (attrs & MASAttributeLeftMargin) [attributes addObject:self.view.mas_leftMargin];
if (attrs & MASAttributeRightMargin) [attributes addObject:self.view.mas_rightMargin];
if (attrs & MASAttributeTopMargin) [attributes addObject:self.view.mas_topMargin];
if (attrs & MASAttributeBottomMargin) [attributes addObject:self.view.mas_bottomMargin];
if (attrs & MASAttributeLeadingMargin) [attributes addObject:self.view.mas_leadingMargin];
if (attrs & MASAttributeTrailingMargin) [attributes addObject:self.view.mas_trailingMargin];
if (attrs & MASAttributeCenterXWithinMargins) [attributes addObject:self.view.mas_centerXWithinMargins];
if (attrs & MASAttributeCenterYWithinMargins) [attributes addObject:self.view.mas_centerYWithinMargins];
#endif
NSMutableArray *children = [NSMutableArray arrayWithCapacity:attributes.count];
for (MASViewAttribute *a in attributes) {
[children addObject:[[MASViewConstraint alloc] initWithFirstViewAttribute:a]];
}
MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithChildren:children];
constraint.delegate = self;
[self.constraints addObject:constraint];
return constraint;
}
#pragma mark - standard Attributes
- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
return [self constraint:nil addConstraintWithLayoutAttribute:layoutAttribute];
}
- (MASConstraint *)left {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft];
}
- (MASConstraint *)top {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop];
}
- (MASConstraint *)right {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight];
}
- (MASConstraint *)bottom {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom];
}
- (MASConstraint *)leading {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading];
}
- (MASConstraint *)trailing {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing];
}
- (MASConstraint *)width {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth];
}
- (MASConstraint *)height {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight];
}
- (MASConstraint *)centerX {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX];
}
- (MASConstraint *)centerY {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY];
}
- (MASConstraint *)baseline {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline];
}
- (MASConstraint *(^)(MASAttribute))attributes {
return ^(MASAttribute attrs){
return [self addConstraintWithAttributes:attrs];
};
}
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
- (MASConstraint *)firstBaseline {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline];
}
- (MASConstraint *)lastBaseline {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline];
}
#endif
#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
- (MASConstraint *)leftMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin];
}
- (MASConstraint *)rightMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin];
}
- (MASConstraint *)topMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin];
}
- (MASConstraint *)bottomMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin];
}
- (MASConstraint *)leadingMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin];
}
- (MASConstraint *)trailingMargin {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin];
}
- (MASConstraint *)centerXWithinMargins {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins];
}
- (MASConstraint *)centerYWithinMargins {
return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins];
}
#endif
#pragma mark - composite Attributes
- (MASConstraint *)edges {
return [self addConstraintWithAttributes:MASAttributeTop | MASAttributeLeft | MASAttributeRight | MASAttributeBottom];
}
- (MASConstraint *)size {
return [self addConstraintWithAttributes:MASAttributeWidth | MASAttributeHeight];
}
- (MASConstraint *)center {
return [self addConstraintWithAttributes:MASAttributeCenterX | MASAttributeCenterY];
}
#pragma mark - grouping
- (MASConstraint *(^)(dispatch_block_t group))group {
return ^id(dispatch_block_t group) {
NSInteger previousCount = self.constraints.count;
group();
NSArray *children = [self.constraints subarrayWithRange:NSMakeRange(previousCount, self.constraints.count - previousCount)];
MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithChildren:children];
constraint.delegate = self;
return constraint;
};
}
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASLayoutConstraint.h
================================================
//
// MASLayoutConstraint.h
// Masonry
//
// Created by Jonas Budelmann on 3/08/13.
// Copyright (c) 2013 Jonas Budelmann. All rights reserved.
//
#import "MASUtilities.h"
/**
* When you are debugging or printing the constraints attached to a view this subclass
* makes it easier to identify which constraints have been created via Masonry
*/
@interface MASLayoutConstraint : NSLayoutConstraint
/**
* a key to associate with this constraint
*/
@property (nonatomic, strong) id mas_key;
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASLayoutConstraint.m
================================================
//
// MASLayoutConstraint.m
// Masonry
//
// Created by Jonas Budelmann on 3/08/13.
// Copyright (c) 2013 Jonas Budelmann. All rights reserved.
//
#import "MASLayoutConstraint.h"
@implementation MASLayoutConstraint
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASUtilities.h
================================================
//
// MASUtilities.h
// Masonry
//
// Created by Jonas Budelmann on 19/08/13.
// Copyright (c) 2013 Jonas Budelmann. All rights reserved.
//
#import
#if TARGET_OS_IPHONE || TARGET_OS_TV
#import
#define MAS_VIEW UIView
#define MAS_VIEW_CONTROLLER UIViewController
#define MASEdgeInsets UIEdgeInsets
typedef UILayoutPriority MASLayoutPriority;
static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired;
static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh;
static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500;
static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow;
static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel;
#elif TARGET_OS_MAC
#import
#define MAS_VIEW NSView
#define MASEdgeInsets NSEdgeInsets
typedef NSLayoutPriority MASLayoutPriority;
static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired;
static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh;
static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow;
static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501;
static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut;
static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow;
static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow;
static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression;
#endif
/**
* Allows you to attach keys to objects matching the variable names passed.
*
* view1.mas_key = @"view1", view2.mas_key = @"view2";
*
* is equivalent to:
*
* MASAttachKeys(view1, view2);
*/
#define MASAttachKeys(...) \
{ \
NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \
for (id key in keyPairs.allKeys) { \
id obj = keyPairs[key]; \
NSAssert([obj respondsToSelector:@selector(setMas_key:)], \
@"Cannot attach mas_key to %@", obj); \
[obj setMas_key:key]; \
} \
}
/**
* Used to create object hashes
* Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html
*/
#define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger))
#define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch)))
/**
* Given a scalar or struct value, wraps it in NSValue
* Based on EXPObjectify: https://github.com/specta/expecta
*/
static inline id _MASBoxValue(const char *type, ...) {
va_list v;
va_start(v, type);
id obj = nil;
if (strcmp(type, @encode(id)) == 0) {
id actual = va_arg(v, id);
obj = actual;
} else if (strcmp(type, @encode(CGPoint)) == 0) {
CGPoint actual = (CGPoint)va_arg(v, CGPoint);
obj = [NSValue value:&actual withObjCType:type];
} else if (strcmp(type, @encode(CGSize)) == 0) {
CGSize actual = (CGSize)va_arg(v, CGSize);
obj = [NSValue value:&actual withObjCType:type];
} else if (strcmp(type, @encode(MASEdgeInsets)) == 0) {
MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets);
obj = [NSValue value:&actual withObjCType:type];
} else if (strcmp(type, @encode(double)) == 0) {
double actual = (double)va_arg(v, double);
obj = [NSNumber numberWithDouble:actual];
} else if (strcmp(type, @encode(float)) == 0) {
float actual = (float)va_arg(v, double);
obj = [NSNumber numberWithFloat:actual];
} else if (strcmp(type, @encode(int)) == 0) {
int actual = (int)va_arg(v, int);
obj = [NSNumber numberWithInt:actual];
} else if (strcmp(type, @encode(long)) == 0) {
long actual = (long)va_arg(v, long);
obj = [NSNumber numberWithLong:actual];
} else if (strcmp(type, @encode(long long)) == 0) {
long long actual = (long long)va_arg(v, long long);
obj = [NSNumber numberWithLongLong:actual];
} else if (strcmp(type, @encode(short)) == 0) {
short actual = (short)va_arg(v, int);
obj = [NSNumber numberWithShort:actual];
} else if (strcmp(type, @encode(char)) == 0) {
char actual = (char)va_arg(v, int);
obj = [NSNumber numberWithChar:actual];
} else if (strcmp(type, @encode(bool)) == 0) {
bool actual = (bool)va_arg(v, int);
obj = [NSNumber numberWithBool:actual];
} else if (strcmp(type, @encode(unsigned char)) == 0) {
unsigned char actual = (unsigned char)va_arg(v, unsigned int);
obj = [NSNumber numberWithUnsignedChar:actual];
} else if (strcmp(type, @encode(unsigned int)) == 0) {
unsigned int actual = (unsigned int)va_arg(v, unsigned int);
obj = [NSNumber numberWithUnsignedInt:actual];
} else if (strcmp(type, @encode(unsigned long)) == 0) {
unsigned long actual = (unsigned long)va_arg(v, unsigned long);
obj = [NSNumber numberWithUnsignedLong:actual];
} else if (strcmp(type, @encode(unsigned long long)) == 0) {
unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long);
obj = [NSNumber numberWithUnsignedLongLong:actual];
} else if (strcmp(type, @encode(unsigned short)) == 0) {
unsigned short actual = (unsigned short)va_arg(v, unsigned int);
obj = [NSNumber numberWithUnsignedShort:actual];
}
va_end(v);
return obj;
}
#define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value))
================================================
FILE: Example/Pods/Masonry/Masonry/MASViewAttribute.h
================================================
//
// MASViewAttribute.h
// Masonry
//
// Created by Jonas Budelmann on 21/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASUtilities.h"
/**
* An immutable tuple which stores the view and the related NSLayoutAttribute.
* Describes part of either the left or right hand side of a constraint equation
*/
@interface MASViewAttribute : NSObject
/**
* The view which the reciever relates to. Can be nil if item is not a view.
*/
@property (nonatomic, weak, readonly) MAS_VIEW *view;
/**
* The item which the reciever relates to.
*/
@property (nonatomic, weak, readonly) id item;
/**
* The attribute which the reciever relates to
*/
@property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute;
/**
* Convenience initializer.
*/
- (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute;
/**
* The designated initializer.
*/
- (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute;
/**
* Determine whether the layoutAttribute is a size attribute
*
* @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight
*/
- (BOOL)isSizeAttribute;
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASViewAttribute.m
================================================
//
// MASViewAttribute.m
// Masonry
//
// Created by Jonas Budelmann on 21/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASViewAttribute.h"
@implementation MASViewAttribute
- (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute {
self = [self initWithView:view item:view layoutAttribute:layoutAttribute];
return self;
}
- (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute {
self = [super init];
if (!self) return nil;
_view = view;
_item = item;
_layoutAttribute = layoutAttribute;
return self;
}
- (BOOL)isSizeAttribute {
return self.layoutAttribute == NSLayoutAttributeWidth
|| self.layoutAttribute == NSLayoutAttributeHeight;
}
- (BOOL)isEqual:(MASViewAttribute *)viewAttribute {
if ([viewAttribute isKindOfClass:self.class]) {
return self.view == viewAttribute.view
&& self.layoutAttribute == viewAttribute.layoutAttribute;
}
return [super isEqual:viewAttribute];
}
- (NSUInteger)hash {
return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute;
}
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASViewConstraint.h
================================================
//
// MASViewConstraint.h
// Masonry
//
// Created by Jonas Budelmann on 20/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASViewAttribute.h"
#import "MASConstraint.h"
#import "MASLayoutConstraint.h"
#import "MASUtilities.h"
/**
* A single constraint.
* Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view
*/
@interface MASViewConstraint : MASConstraint
/**
* First item/view and first attribute of the NSLayoutConstraint
*/
@property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute;
/**
* Second item/view and second attribute of the NSLayoutConstraint
*/
@property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute;
/**
* initialises the MASViewConstraint with the first part of the equation
*
* @param firstViewAttribute view.mas_left, view.mas_width etc.
*
* @return a new view constraint
*/
- (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute;
/**
* Returns all MASViewConstraints installed with this view as a first item.
*
* @param view A view to retrieve constraints for.
*
* @return An array of MASViewConstraints.
*/
+ (NSArray *)installedConstraintsForView:(MAS_VIEW *)view;
@end
================================================
FILE: Example/Pods/Masonry/Masonry/MASViewConstraint.m
================================================
//
// MASViewConstraint.m
// Masonry
//
// Created by Jonas Budelmann on 20/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASViewConstraint.h"
#import "MASConstraint+Private.h"
#import "MASCompositeConstraint.h"
#import "MASLayoutConstraint.h"
#import "View+MASAdditions.h"
#import
@interface MAS_VIEW (MASConstraints)
@property (nonatomic, readonly) NSMutableSet *mas_installedConstraints;
@end
@implementation MAS_VIEW (MASConstraints)
static char kInstalledConstraintsKey;
- (NSMutableSet *)mas_installedConstraints {
NSMutableSet *constraints = objc_getAssociatedObject(self, &kInstalledConstraintsKey);
if (!constraints) {
constraints = [NSMutableSet set];
objc_setAssociatedObject(self, &kInstalledConstraintsKey, constraints, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
return constraints;
}
@end
@interface MASViewConstraint ()
@property (nonatomic, strong, readwrite) MASViewAttribute *secondViewAttribute;
@property (nonatomic, weak) MAS_VIEW *installedView;
@property (nonatomic, weak) MASLayoutConstraint *layoutConstraint;
@property (nonatomic, assign) NSLayoutRelation layoutRelation;
@property (nonatomic, assign) MASLayoutPriority layoutPriority;
@property (nonatomic, assign) CGFloat layoutMultiplier;
@property (nonatomic, assign) CGFloat layoutConstant;
@property (nonatomic, assign) BOOL hasLayoutRelation;
@property (nonatomic, strong) id mas_key;
@property (nonatomic, assign) BOOL useAnimator;
@end
@implementation MASViewConstraint
- (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute {
self = [super init];
if (!self) return nil;
_firstViewAttribute = firstViewAttribute;
self.layoutPriority = MASLayoutPriorityRequired;
self.layoutMultiplier = 1;
return self;
}
#pragma mark - NSCoping
- (id)copyWithZone:(NSZone __unused *)zone {
MASViewConstraint *constraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:self.firstViewAttribute];
constraint.layoutConstant = self.layoutConstant;
constraint.layoutRelation = self.layoutRelation;
constraint.layoutPriority = self.layoutPriority;
constraint.layoutMultiplier = self.layoutMultiplier;
constraint.delegate = self.delegate;
return constraint;
}
#pragma mark - Public
+ (NSArray *)installedConstraintsForView:(MAS_VIEW *)view {
return [view.mas_installedConstraints allObjects];
}
#pragma mark - Private
- (void)setLayoutConstant:(CGFloat)layoutConstant {
_layoutConstant = layoutConstant;
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
if (self.useAnimator) {
[self.layoutConstraint.animator setConstant:layoutConstant];
} else {
self.layoutConstraint.constant = layoutConstant;
}
#else
self.layoutConstraint.constant = layoutConstant;
#endif
}
- (void)setLayoutRelation:(NSLayoutRelation)layoutRelation {
_layoutRelation = layoutRelation;
self.hasLayoutRelation = YES;
}
- (BOOL)supportsActiveProperty {
return [self.layoutConstraint respondsToSelector:@selector(isActive)];
}
- (BOOL)isActive {
BOOL active = YES;
if ([self supportsActiveProperty]) {
active = [self.layoutConstraint isActive];
}
return active;
}
- (BOOL)hasBeenInstalled {
return (self.layoutConstraint != nil) && [self isActive];
}
- (void)setSecondViewAttribute:(id)secondViewAttribute {
if ([secondViewAttribute isKindOfClass:NSValue.class]) {
[self setLayoutConstantWithValue:secondViewAttribute];
} else if ([secondViewAttribute isKindOfClass:MAS_VIEW.class]) {
_secondViewAttribute = [[MASViewAttribute alloc] initWithView:secondViewAttribute layoutAttribute:self.firstViewAttribute.layoutAttribute];
} else if ([secondViewAttribute isKindOfClass:MASViewAttribute.class]) {
_secondViewAttribute = secondViewAttribute;
} else {
NSAssert(NO, @"attempting to add unsupported attribute: %@", secondViewAttribute);
}
}
#pragma mark - NSLayoutConstraint multiplier proxies
- (MASConstraint * (^)(CGFloat))multipliedBy {
return ^id(CGFloat multiplier) {
NSAssert(!self.hasBeenInstalled,
@"Cannot modify constraint multiplier after it has been installed");
self.layoutMultiplier = multiplier;
return self;
};
}
- (MASConstraint * (^)(CGFloat))dividedBy {
return ^id(CGFloat divider) {
NSAssert(!self.hasBeenInstalled,
@"Cannot modify constraint multiplier after it has been installed");
self.layoutMultiplier = 1.0/divider;
return self;
};
}
#pragma mark - MASLayoutPriority proxy
- (MASConstraint * (^)(MASLayoutPriority))priority {
return ^id(MASLayoutPriority priority) {
NSAssert(!self.hasBeenInstalled,
@"Cannot modify constraint priority after it has been installed");
self.layoutPriority = priority;
return self;
};
}
#pragma mark - NSLayoutRelation proxy
- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation {
return ^id(id attribute, NSLayoutRelation relation) {
if ([attribute isKindOfClass:NSArray.class]) {
NSAssert(!self.hasLayoutRelation, @"Redefinition of constraint relation");
NSMutableArray *children = NSMutableArray.new;
for (id attr in attribute) {
MASViewConstraint *viewConstraint = [self copy];
viewConstraint.layoutRelation = relation;
viewConstraint.secondViewAttribute = attr;
[children addObject:viewConstraint];
}
MASCompositeConstraint *compositeConstraint = [[MASCompositeConstraint alloc] initWithChildren:children];
compositeConstraint.delegate = self.delegate;
[self.delegate constraint:self shouldBeReplacedWithConstraint:compositeConstraint];
return compositeConstraint;
} else {
NSAssert(!self.hasLayoutRelation || self.layoutRelation == relation && [attribute isKindOfClass:NSValue.class], @"Redefinition of constraint relation");
self.layoutRelation = relation;
self.secondViewAttribute = attribute;
return self;
}
};
}
#pragma mark - Semantic properties
- (MASConstraint *)with {
return self;
}
- (MASConstraint *)and {
return self;
}
#pragma mark - attribute chaining
- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
NSAssert(!self.hasLayoutRelation, @"Attributes should be chained before defining the constraint relation");
return [self.delegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
}
#pragma mark - Animator proxy
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
- (MASConstraint *)animator {
self.useAnimator = YES;
return self;
}
#endif
#pragma mark - debug helpers
- (MASConstraint * (^)(id))key {
return ^id(id key) {
self.mas_key = key;
return self;
};
}
#pragma mark - NSLayoutConstraint constant setters
- (void)setInsets:(MASEdgeInsets)insets {
NSLayoutAttribute layoutAttribute = self.firstViewAttribute.layoutAttribute;
switch (layoutAttribute) {
case NSLayoutAttributeLeft:
case NSLayoutAttributeLeading:
self.layoutConstant = insets.left;
break;
case NSLayoutAttributeTop:
self.layoutConstant = insets.top;
break;
case NSLayoutAttributeBottom:
self.layoutConstant = -insets.bottom;
break;
case NSLayoutAttributeRight:
case NSLayoutAttributeTrailing:
self.layoutConstant = -insets.right;
break;
default:
break;
}
}
- (void)setInset:(CGFloat)inset {
[self setInsets:(MASEdgeInsets){.top = inset, .left = inset, .bottom = inset, .right = inset}];
}
- (void)setOffset:(CGFloat)offset {
self.layoutConstant = offset;
}
- (void)setSizeOffset:(CGSize)sizeOffset {
NSLayoutAttribute layoutAttribute = self.firstViewAttribute.layoutAttribute;
switch (layoutAttribute) {
case NSLayoutAttributeWidth:
self.layoutConstant = sizeOffset.width;
break;
case NSLayoutAttributeHeight:
self.layoutConstant = sizeOffset.height;
break;
default:
break;
}
}
- (void)setCenterOffset:(CGPoint)centerOffset {
NSLayoutAttribute layoutAttribute = self.firstViewAttribute.layoutAttribute;
switch (layoutAttribute) {
case NSLayoutAttributeCenterX:
self.layoutConstant = centerOffset.x;
break;
case NSLayoutAttributeCenterY:
self.layoutConstant = centerOffset.y;
break;
default:
break;
}
}
#pragma mark - MASConstraint
- (void)activate {
[self install];
}
- (void)deactivate {
[self uninstall];
}
- (void)install {
if (self.hasBeenInstalled) {
return;
}
if ([self supportsActiveProperty] && self.layoutConstraint) {
self.layoutConstraint.active = YES;
[self.firstViewAttribute.view.mas_installedConstraints addObject:self];
return;
}
MAS_VIEW *firstLayoutItem = self.firstViewAttribute.item;
NSLayoutAttribute firstLayoutAttribute = self.firstViewAttribute.layoutAttribute;
MAS_VIEW *secondLayoutItem = self.secondViewAttribute.item;
NSLayoutAttribute secondLayoutAttribute = self.secondViewAttribute.layoutAttribute;
// alignment attributes must have a secondViewAttribute
// therefore we assume that is refering to superview
// eg make.left.equalTo(@10)
if (!self.firstViewAttribute.isSizeAttribute && !self.secondViewAttribute) {
secondLayoutItem = self.firstViewAttribute.view.superview;
secondLayoutAttribute = firstLayoutAttribute;
}
MASLayoutConstraint *layoutConstraint
= [MASLayoutConstraint constraintWithItem:firstLayoutItem
attribute:firstLayoutAttribute
relatedBy:self.layoutRelation
toItem:secondLayoutItem
attribute:secondLayoutAttribute
multiplier:self.layoutMultiplier
constant:self.layoutConstant];
layoutConstraint.priority = self.layoutPriority;
layoutConstraint.mas_key = self.mas_key;
if (self.secondViewAttribute.view) {
MAS_VIEW *closestCommonSuperview = [self.firstViewAttribute.view mas_closestCommonSuperview:self.secondViewAttribute.view];
NSAssert(closestCommonSuperview,
@"couldn't find a common superview for %@ and %@",
self.firstViewAttribute.view, self.secondViewAttribute.view);
self.installedView = closestCommonSuperview;
} else if (self.firstViewAttribute.isSizeAttribute) {
self.installedView = self.firstViewAttribute.view;
} else {
self.installedView = self.firstViewAttribute.view.superview;
}
MASLayoutConstraint *existingConstraint = nil;
if (self.updateExisting) {
existingConstraint = [self layoutConstraintSimilarTo:layoutConstraint];
}
if (existingConstraint) {
// just update the constant
existingConstraint.constant = layoutConstraint.constant;
self.layoutConstraint = existingConstraint;
} else {
[self.installedView addConstraint:layoutConstraint];
self.layoutConstraint = layoutConstraint;
[firstLayoutItem.mas_installedConstraints addObject:self];
}
}
- (MASLayoutConstraint *)layoutConstraintSimilarTo:(MASLayoutConstraint *)layoutConstraint {
// check if any constraints are the same apart from the only mutable property constant
// go through constraints in reverse as we do not want to match auto-resizing or interface builder constraints
// and they are likely to be added first.
for (NSLayoutConstraint *existingConstraint in self.installedView.constraints.reverseObjectEnumerator) {
if (![existingConstraint isKindOfClass:MASLayoutConstraint.class]) continue;
if (existingConstraint.firstItem != layoutConstraint.firstItem) continue;
if (existingConstraint.secondItem != layoutConstraint.secondItem) continue;
if (existingConstraint.firstAttribute != layoutConstraint.firstAttribute) continue;
if (existingConstraint.secondAttribute != layoutConstraint.secondAttribute) continue;
if (existingConstraint.relation != layoutConstraint.relation) continue;
if (existingConstraint.multiplier != layoutConstraint.multiplier) continue;
if (existingConstraint.priority != layoutConstraint.priority) continue;
return (id)existingConstraint;
}
return nil;
}
- (void)uninstall {
if ([self supportsActiveProperty]) {
self.layoutConstraint.active = NO;
[self.firstViewAttribute.view.mas_installedConstraints removeObject:self];
return;
}
[self.installedView removeConstraint:self.layoutConstraint];
self.layoutConstraint = nil;
self.installedView = nil;
[self.firstViewAttribute.view.mas_installedConstraints removeObject:self];
}
@end
================================================
FILE: Example/Pods/Masonry/Masonry/Masonry.h
================================================
//
// Masonry.h
// Masonry
//
// Created by Jonas Budelmann on 20/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import