├── .gitignore
├── .travis.yml
├── Example
├── FMLayoutKit.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── FMLayoutKit-Example.xcscheme
├── FMLayoutKit.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── 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
│ │ │ └── timg.jpeg
│ ├── LS_HomeActivityCell.h
│ ├── LS_HomeActivityCell.m
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ └── main.m
├── 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.dSYM
│ │ │ └── Contents
│ │ │ │ ├── Info.plist
│ │ │ │ └── Resources
│ │ │ │ └── DWARF
│ │ │ │ └── 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
│ └── Release-iphonesimulator
│ │ └── FMLayoutKit
│ │ ├── FMLayoutKit.framework.dSYM
│ │ └── Contents
│ │ │ ├── Info.plist
│ │ │ └── Resources
│ │ │ └── DWARF
│ │ │ └── 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
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Local Podspecs
│ │ └── FMLayoutKit.podspec.json
│ ├── Manifest.lock
│ ├── 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.podspec
├── 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
├── Jietu20200430-154528@2x.jpg
├── Jietu20200430-154538@2x.jpg
├── Jietu20200430-154610@2x.jpg
├── Jietu20200430-154705@2x.jpg
├── Jietu20200430-154718@2x.jpg
├── Jietu20200430-154732@2x.jpg
├── Jietu20200430-154739@2x.jpg
├── LICENSE
├── README.md
├── _Pods.xcodeproj
└── submitNewVersion.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | # OS X
2 | .DS_Store
3 |
4 | # Xcode
5 | build/
6 | *.pbxuser
7 | !default.pbxuser
8 | *.mode1v3
9 | !default.mode1v3
10 | *.mode2v3
11 | !default.mode2v3
12 | *.perspectivev3
13 | !default.perspectivev3
14 | xcuserdata/
15 | *.xccheckout
16 | profile
17 | *.moved-aside
18 | DerivedData
19 | *.hmap
20 | *.ipa
21 |
22 | # Bundler
23 | .bundle
24 |
25 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
26 | # Carthage/Checkouts
27 |
28 | Carthage/Build
29 |
30 | # We recommend against adding the Pods directory to your .gitignore. However
31 | # you should judge for yourself, the pros and cons are mentioned at:
32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
33 | #
34 | # Note: if you ignore the Pods directory, make sure to uncomment
35 | # `pod install` in .travis.yml
36 | #
37 | # Pods/
38 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # references:
2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/
3 | # * https://github.com/supermarin/xcpretty#usage
4 |
5 | osx_image: xcode7.3
6 | language: objective-c
7 | # cache: cocoapods
8 | # podfile: Example/Podfile
9 | # before_install:
10 | # - gem install cocoapods # Since Travis is not always on latest version
11 | # - pod install --project-directory=Example
12 | script:
13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/FMLayoutKit.xcworkspace -scheme FMLayoutKit-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
14 | - pod lib lint
15 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMAddViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMAddViewController.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/17.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMAddViewController : UIViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMAotuSizeReusableView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMAotuSizeReusableView.h
3 | // FMLayoutKit_Example
4 | //
5 | // Created by 郑桂华 on 2020/7/3.
6 | // Copyright © 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMAotuSizeReusableView : UICollectionReusableView
14 |
15 | @property(nonatomic, weak)UILabel *contentLabel;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMAotuSizeReusableView.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMAotuSizeReusableView.m
3 | // FMLayoutKit_Example
4 | //
5 | // Created by 郑桂华 on 2020/7/3.
6 | // Copyright © 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | #import "FMAotuSizeReusableView.h"
10 | #import
11 |
12 | @implementation FMAotuSizeReusableView
13 |
14 | - (instancetype)initWithFrame:(CGRect)frame
15 | {
16 | self = [super initWithFrame:frame];
17 | if (self) {
18 |
19 | self.backgroundColor = UIColor.cyanColor;
20 |
21 | UILabel *label = [[UILabel alloc] init];
22 | label.text = @"自动布局高度大小";
23 | [self addSubview:label];
24 | [label mas_makeConstraints:^(MASConstraintMaker *make) {
25 | make.centerX.mas_equalTo(0);
26 | make.top.mas_equalTo(20);
27 | }];
28 |
29 | UILabel *content = [[UILabel alloc] init];
30 | content.preferredMaxLayoutWidth = [UIScreen mainScreen].bounds.size.width - 40;
31 | content.text = @"内容\n内容埃里克森基多拉可接受的拉可视角度阿拉山口基多拉刷卡机的啦可视角度拉克丝基多拉可视角度拉克丝基多拉可视角度拉手孔";
32 | content.numberOfLines = 0;
33 | [self addSubview:content];
34 | [content mas_makeConstraints:^(MASConstraintMaker *make) {
35 | make.left.mas_equalTo(20);
36 | make.right.mas_equalTo(-20);
37 | make.top.mas_equalTo(label.mas_bottom).offset(20);
38 | make.bottom.mas_equalTo(-20);
39 | }];
40 | self.contentLabel = content;
41 | }
42 | return self;
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMAppDelegate.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 04/01/2020.
6 | // Copyright (c) 2020 周发明. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface FMAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMAppDelegate.m
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 04/01/2020.
6 | // Copyright (c) 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import "FMAppDelegate.h"
10 |
11 | /// pod trunk push FMLayoutKit.podspec --allow-warnings
12 |
13 | @implementation FMAppDelegate
14 |
15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
16 | {
17 | // Override point for customization after application launch.
18 | return YES;
19 | }
20 |
21 | - (void)applicationWillResignActive:(UIApplication *)application
22 | {
23 | // 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.
24 | // 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.
25 | }
26 |
27 | - (void)applicationDidEnterBackground:(UIApplication *)application
28 | {
29 | // 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.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application
34 | {
35 | // 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.
36 | }
37 |
38 | - (void)applicationDidBecomeActive:(UIApplication *)application
39 | {
40 | // 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.
41 | }
42 |
43 | - (void)applicationWillTerminate:(UIApplication *)application
44 | {
45 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
46 | }
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMCollViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollViewController.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/11.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCollViewController : UIViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMCollectionCustomCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionCustomCell.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCollectionCustomCell : UICollectionViewCell
14 |
15 | @property(nonatomic, weak)UILabel *label;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMCollectionCustomCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionCustomCell.m
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import "FMCollectionCustomCell.h"
10 | #import
11 |
12 | @implementation FMCollectionCustomCell
13 |
14 | - (instancetype)initWithFrame:(CGRect)frame
15 | {
16 | self = [super initWithFrame:frame];
17 | if (self) {
18 | NSInteger aRedValue =arc4random() %255;
19 | NSInteger aGreenValue =arc4random() %255;
20 | NSInteger aBlueValue =arc4random() %255;
21 | UIColor*randColor = [UIColor colorWithRed:aRedValue /255.0f green:aGreenValue /255.0f blue:aBlueValue /255.0f alpha:1.0f];
22 | self.contentView.backgroundColor = randColor;
23 |
24 | UILabel *label = [[UILabel alloc] init];
25 | label.numberOfLines = 0;
26 | label.textAlignment = NSTextAlignmentCenter;
27 | label.text = NSStringFromClass(self.class);
28 | [self.contentView addSubview:label];
29 | [label mas_makeConstraints:^(MASConstraintMaker *make) {
30 | make.left.right.top.bottom.mas_equalTo(0);
31 | }];
32 | self.label = label;
33 | }
34 | return self;
35 | }
36 |
37 | - (void)layoutSubviews{
38 | [super layoutSubviews];
39 | }
40 |
41 | - (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
42 | NSLog(@"cell:%p attr:%p", self, layoutAttributes);
43 | [super applyLayoutAttributes:layoutAttributes];
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMCollectionCustomDecoration.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionCustomDecoration.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCollectionCustomDecoration : UICollectionReusableView
14 | @property(nonatomic, weak)UILabel *textLabel;
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMCollectionCustomDecoration.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionCustomDecoration.m
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import "FMCollectionCustomDecoration.h"
10 | #import
11 |
12 | @implementation FMCollectionCustomDecoration
13 |
14 | - (instancetype)initWithFrame:(CGRect)frame
15 | {
16 | self = [super initWithFrame:frame];
17 | if (self) {
18 | // NSInteger aRedValue =arc4random() %255;
19 | // NSInteger aGreenValue =arc4random() %255;
20 | // NSInteger aBlueValue =arc4random() %255;
21 | // UIColor*randColor = [UIColor colorWithRed:aRedValue /255.0f green:aGreenValue /255.0f blue:aBlueValue /255.0f alpha:1.0f];
22 | // self.backgroundColor = randColor;
23 |
24 | UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"timg"]];
25 | imageV.contentMode = UIViewContentModeScaleAspectFill;
26 | imageV.clipsToBounds = YES;
27 | [self addSubview:imageV];
28 | [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
29 | make.left.right.top.bottom.mas_equalTo(0);
30 | }];
31 |
32 | UILabel *text = [[UILabel alloc] init];
33 | text.numberOfLines = 0;
34 | text.textColor = [UIColor whiteColor];
35 | [self addSubview:text];
36 | [text mas_makeConstraints:^(MASConstraintMaker *make) {
37 | make.left.centerY.right.mas_equalTo(0);
38 | }];
39 | self.textLabel = text;
40 | }
41 | return self;
42 | }
43 |
44 | - (void)layoutSubviews{
45 | [super layoutSubviews];
46 |
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMCollectionNavTitleView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionNavTitleView.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/9.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCollectionNavTitleView : UICollectionReusableView
14 | @property(nonatomic, copy)NSArray *titles;
15 | @property(nonatomic, copy)void(^clickBlock)(NSInteger tag);
16 | - (void)selectWithIndex:(NSInteger)index;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMCollectionViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionViewCell.h
3 | // FMLayoutKit_Example
4 | //
5 | // Created by 周发明 on 2020/6/15.
6 | // Copyright © 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCollectionViewCell : UICollectionViewCell
14 | @property (weak, nonatomic) IBOutlet UILabel *label;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMCollectionViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionViewCell.m
3 | // FMLayoutKit_Example
4 | //
5 | // Created by 周发明 on 2020/6/15.
6 | // Copyright © 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | #import "FMCollectionViewCell.h"
10 |
11 | @implementation FMCollectionViewCell
12 |
13 | - (void)awakeFromNib {
14 | [super awakeFromNib];
15 | self.contentView.backgroundColor = [UIColor cyanColor];
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMCombineViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCombineViewController.h
3 | // FMLayoutKit_Example
4 | //
5 | // Created by 郑桂华 on 2020/7/12.
6 | // Copyright © 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCombineViewController : UIViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMExcuteTimeTool.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMExcuteTimeTool.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/6/6.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMExcuteTimeTool : NSObject
14 |
15 | + (void)excuteTime:(void(^)(void))excute;
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMExcuteTimeTool.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMExcuteTimeTool.m
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/6/6.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import "FMExcuteTimeTool.h"
10 |
11 | @implementation FMExcuteTimeTool
12 |
13 | + (void)excuteTime:(void(^)(void))excute{
14 | CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
15 | !excute?:excute();
16 | CFAbsoluteTime end = CFAbsoluteTimeGetCurrent() - start;
17 | NSLog(@"该block执行耗时 %f ms", end *1000.0);
18 | }
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMFPSLabel.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMFPSLabel.h
3 | // FMLayoutKit_Example
4 | //
5 | // Created by 郑桂华 on 2020/7/1.
6 | // Copyright © 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMFPSLabel : UILabel
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMFPSLabel.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMFPSLabel.m
3 | // FMLayoutKit_Example
4 | //
5 | // Created by 郑桂华 on 2020/7/1.
6 | // Copyright © 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | #import "FMFPSLabel.h"
10 |
11 | @interface FMFPSLabel ()
12 |
13 | @property(nonatomic, strong)CADisplayLink *link;
14 |
15 | @property(nonatomic, assign)CFTimeInterval timestamp;
16 | @property(nonatomic, assign)NSInteger count;
17 |
18 | @end
19 |
20 | @implementation FMFPSLabel
21 |
22 | - (instancetype)initWithFrame:(CGRect)frame
23 | {
24 | self = [super initWithFrame:frame];
25 | if (self) {
26 | CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateLink:)];
27 | [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
28 | self.link = link;
29 | }
30 | return self;
31 | }
32 |
33 | - (void)updateLink:(CADisplayLink *)link{
34 | if (self.timestamp == 0) {
35 | self.timestamp = link.timestamp;
36 | return;
37 | }
38 |
39 | self.count ++;
40 |
41 | // 两帧间隔时间
42 | NSTimeInterval delta = link.timestamp - self.timestamp;
43 | // 过滤刷新次数
44 | if (delta < 1) return;
45 | // 计算FPS
46 | self.timestamp = link.timestamp;
47 | float fps = self.count / delta;
48 | self.count = 0;
49 |
50 | self.text = [NSString stringWithFormat:@"%d FPS", (int)round(fps)];
51 | }
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMHorizontalLayoutController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMHorizontalLayoutController.h
3 | // FMLayoutKit_Example
4 | //
5 | // Created by 周发明 on 2020/6/15.
6 | // Copyright © 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMHorizontalLayoutController : UIViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMLayoutKit-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | $(PRODUCT_NAME)
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMLayoutKit-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | @import UIKit;
15 | @import Foundation;
16 | #endif
17 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMLayoutLabel.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutLabel.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/23.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMLayoutLabel : UILabel
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMLayoutLabel.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutLabel.m
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/23.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutLabel.h"
10 |
11 | @interface FMLayoutLabel ()
12 |
13 | @property(nonatomic, assign)BOOL isLayoutSubviews;
14 | @property(nonatomic, assign)BOOL isAttributeText;
15 | @end
16 |
17 | @implementation FMLayoutLabel
18 |
19 | - (void)setText:(NSString *)text{
20 | [super setText:text];
21 | self.isAttributeText = NO;
22 | if (self.isLayoutSubviews) {
23 | [self updateFillSize];
24 | }
25 | }
26 |
27 | - (void)setAttributedText:(NSAttributedString *)attributedText{
28 | [super setAttributedText:attributedText];
29 | self.isAttributeText = YES;
30 | if (self.isLayoutSubviews) {
31 | [self updateFillSize];
32 | }
33 | }
34 |
35 | - (void)setFont:(UIFont *)font{
36 | [super setFont:font];
37 | if (self.isLayoutSubviews) {
38 | [self updateFillSize];
39 | }
40 | }
41 |
42 | - (void)layoutSubviews{
43 | [super layoutSubviews];
44 | self.isLayoutSubviews = YES;
45 | [self updateFillSize];
46 | }
47 |
48 | - (void)updateFillSize{
49 | CGSize size = CGSizeZero;
50 | if (self.isAttributeText && self.attributedText != nil) {
51 | CGFloat height = [self.attributedText boundingRectWithSize:CGSizeMake(self.bounds.size.width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:nil].size.height;
52 | size = [self sizeThatFits:CGSizeMake(self.bounds.size.width, height)];
53 | }
54 | if (!self.isAttributeText && self.text != nil) {
55 | CGFloat height = [self.text boundingRectWithSize:CGSizeMake(self.bounds.size.width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:self.font} context:nil].size.height;
56 | size = [self sizeThatFits:CGSizeMake(self.bounds.size.width, height)];
57 | }
58 | NSLog(@"updateFillSize %@", [NSValue valueWithCGSize:size]);
59 | }
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/FMViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMViewController.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 04/01/2020.
6 | // Copyright (c) 2020 周发明. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface FMViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/FMLayoutKit/Images.xcassets/timg.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "timg.jpeg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/FMLayoutKit/Images.xcassets/timg.imageset/timg.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Example/FMLayoutKit/Images.xcassets/timg.imageset/timg.jpeg
--------------------------------------------------------------------------------
/Example/FMLayoutKit/LS_HomeActivityCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // LS_HomeActivityCell.h
3 | // LiangShanApp
4 | //
5 | // Created by 周发明 on 2020/4/9.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface LS_HomeActivityCell : UICollectionViewCell
14 | @property(nonatomic, weak)UIImageView *leftImageView;
15 | @property(nonatomic, weak)UILabel *introLabel;
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/LS_HomeActivityCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // LS_HomeActivityCell.m
3 | // LiangShanApp
4 | //
5 | // Created by 周发明 on 2020/4/9.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "LS_HomeActivityCell.h"
10 | #import
11 | #import "FMLayoutLabel.h"
12 |
13 | @implementation LS_HomeActivityCell
14 |
15 | - (void)dealloc{
16 |
17 | }
18 |
19 | - (instancetype)initWithFrame:(CGRect)frame
20 | {
21 | self = [super initWithFrame:frame];
22 | if (self) {
23 | self.contentView.backgroundColor = [UIColor cyanColor];
24 |
25 | UILabel *title = [[UILabel alloc] init];
26 | title.text = @"大标题";
27 | title.font = [UIFont systemFontOfSize:18];
28 | [self.contentView addSubview:title];
29 | [title mas_makeConstraints:^(MASConstraintMaker *make) {
30 | make.left.right.mas_equalTo(0);
31 | make.top.mas_equalTo(15);
32 | }];
33 |
34 | UILabel *detail = [[UILabel alloc] init];
35 | detail.text = @"小标题";
36 | detail.font = [UIFont systemFontOfSize:14];
37 | [self.contentView addSubview:detail];
38 | [detail mas_makeConstraints:^(MASConstraintMaker *make) {
39 | make.left.right.mas_equalTo(0);
40 | make.top.mas_equalTo(title.mas_bottom).offset(5);
41 | }];
42 |
43 | UIImageView *left = [[UIImageView alloc] init];
44 | left.backgroundColor = [UIColor redColor];
45 | [self.contentView addSubview:left];
46 | [left mas_makeConstraints:^(MASConstraintMaker *make) {
47 | make.left.mas_equalTo(0);
48 | make.top.mas_equalTo(detail.mas_bottom).offset(9);
49 | make.width.height.mas_equalTo(81);
50 | }];
51 | self.leftImageView = left;
52 |
53 | UIImageView *right = [[UIImageView alloc] init];
54 | right.backgroundColor = [UIColor blueColor];
55 | [self.contentView addSubview:right];
56 | [right mas_makeConstraints:^(MASConstraintMaker *make) {
57 | make.left.mas_equalTo(left.mas_right).offset(5);
58 | make.top.mas_equalTo(left);
59 | make.width.height.mas_equalTo(81);
60 | }];
61 |
62 | UILabel *intro = [[UILabel alloc] init];
63 | intro.preferredMaxLayoutWidth = 166;
64 | intro.numberOfLines = 0;
65 | // intro.text = @"一些描述\n爱神的箭埃里克森基多拉\n离开时尽量少肯德基分离式的\n";
66 | intro.text = @"一些描述";
67 | [self.contentView addSubview:intro];
68 | [intro mas_makeConstraints:^(MASConstraintMaker *make) {
69 | make.left.mas_equalTo(0);
70 | make.right.mas_equalTo(0);
71 | make.top.mas_equalTo(left.mas_bottom);
72 | make.bottom.mas_equalTo(-10);
73 | }];
74 | self.introLabel = intro;
75 | }
76 | return self;
77 | }
78 |
79 | @end
80 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/FMLayoutKit/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // FMLayoutKit
4 | //
5 | // Created by zhoufaming251@163.com on 06/09/2020.
6 | // Copyright (c) 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 | #import "FMAppDelegate.h"
11 |
12 | int main(int argc, char * argv[])
13 | {
14 | @autoreleasepool {
15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([FMAppDelegate class]));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/FMLayoutKit:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Example/FMLayoutKitFramework/FMLayoutKit.framework/FMLayoutKit
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMCollectionLayoutAttributes.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionLayoutAttributes.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/25.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FMLayoutBaseSection.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCollectionLayoutAttributes : UICollectionViewLayoutAttributes
14 |
15 | @property(nonatomic, assign)FMLayoutDirection direction;
16 |
17 | + (instancetype)headerAttributesWithSection:(FMLayoutBaseSection *)section;
18 | - (instancetype)updateHeaderAttributesWithSection:(FMLayoutBaseSection *)section;
19 |
20 | + (instancetype)suspensionShowHeaderAttributes:(FMLayoutBaseSection *)section;
21 |
22 | + (instancetype)footerAttributesWithSection:(FMLayoutBaseSection *)section;
23 | - (instancetype)updateFooterAttributesWithSection:(FMLayoutBaseSection *)section;
24 |
25 | + (instancetype)bgAttributesWithSection:(FMLayoutBaseSection *)section;
26 | - (instancetype)updateBgAttributesWithSection:(FMLayoutBaseSection *)section;
27 |
28 | - (void)_onlyUpdateOffsetWith:(FMLayoutBaseSection *)section;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMCollectionViewDelegateDataSourceProvider.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionViewDelegateDataSourceProvider.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2021/3/27.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @class FMLayoutBaseSection;
13 | @interface FMCollectionViewDelegateDataSourceProvider : NSObject
14 |
15 | ///重写了set get 目标指向->layout.sections
16 | @property(nonatomic, strong)NSMutableArray *sections;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMKVOArrayObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMKVOArrayObject.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/5.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface FMKVOArrayObject : NSObject
13 |
14 | @property (strong,nonatomic)NSMutableArray *targetArray;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayout.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutHeader.h"
11 | #import "FMLayoutFooter.h"
12 | #import "FMLayoutBackground.h"
13 | #import "FMCollectionLayoutAttributes.h"
14 |
15 | NS_ASSUME_NONNULL_BEGIN
16 |
17 | @interface FMLayout : UICollectionViewLayout
18 |
19 | @property(nonatomic, assign)FMLayoutDirection direction;
20 | @property(nonatomic, strong)NSMutableArray *sections;
21 | ///最后固定边距 跟section的inset无关 contentSize会自动加上去
22 | @property(nonatomic, assign)CGFloat fixedLastMargin;
23 | ///是否只计算改变的布局 NO为每一次 都是重新计算所有布局
24 | @property(nonatomic, assign)BOOL reLayoutOlnyChanged;
25 | ///最小可滑动的大小 横向-高度 纵向-宽度
26 | @property(nonatomic, assign)CGFloat minContentSize;
27 | ///第一个Section的偏移量
28 | @property(nonatomic, assign)CGFloat firstSectionOffset;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutAbsoluteSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutAbsoluteSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/9.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | typedef CGRect(^FMLayoutBaseSectionItemFrameBlock)(id section, NSInteger item);
13 | ///支持纵向插横向
14 | @interface FMLayoutAbsoluteSection : FMLayoutDynamicSection
15 |
16 | @property(nonatomic, copy)FMLayoutBaseSectionItemFrameBlock frameBlock;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutBackground.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutBackground.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/27.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | static NSString *const UICollectionElementKindSectionBackground = @"UICollectionElementKindSectionBackground";
14 |
15 | @interface FMLayoutBackground : FMSupplementary
16 |
17 | + (instancetype)bgWithViewClass:(Class)viewClass;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutCombineSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCombineSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/12.
6 | //
7 |
8 | #import "FMLayoutBaseSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | ///可以将不同Cell, 不同的布局方式, 放到同一个分组去合并,只合并cell, 如果子分组有头部和底部讲被忽略,合并分组的头部与底部不影响配置, cell的点击事件已经在init方法中配置block分发到子分组上 合并分组不支持拖拽排序 想要支持 可以继承自该类重写canLongPressExchange的get方法 并实现- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
12 | @interface FMLayoutCombineSection : FMLayoutBaseSection
13 | @property(nonatomic, readonly)NSArray *subSections;
14 | + (instancetype)combineSections:(NSArray *)sections;
15 | - (void)appendSection:(FMLayoutBaseSection *)section;
16 | - (void)insetSection:(FMLayoutBaseSection *)section atIndex:(NSInteger)index;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutCrossSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import "FMLayoutBaseSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | @interface FMLayoutCrossSection : FMLayoutBaseSection
12 | @property(nonatomic, assign, readonly)FMLayoutDirection crossDirection;
13 | /// 所有section计算获取最大的高度
14 | @property(nonatomic, assign)BOOL autoMaxSize;
15 | /// 所有section计算获取最大的高度
16 | @property(nonatomic, assign)CGFloat size;
17 | @property(nonatomic, assign)BOOL canReuseCell;
18 | @property(nonatomic, assign, readonly)CGFloat maxContentWidth;
19 |
20 | @property(nonatomic, strong)NSMutableArray *sections;
21 |
22 | @property(nonatomic, copy)void(^scrollDidScroll)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
23 | @property(nonatomic, copy)void(^configureCollectionView)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
24 |
25 | + (instancetype)sectionAutoWithSection:(FMLayoutBaseSection *)section;
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutCrossTransformSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossTransformSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/15.
6 | //
7 |
8 | #import "FMLayoutCrossSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | typedef NS_ENUM(NSUInteger, FMLayoutCrossTransformType) {
13 | ///什么都不做
14 | FMLayoutCrossTransformNone,
15 | ///缩小0.9 + 0.1*进度
16 | FMLayoutCrossTransformScale,
17 | ///简拼App首页样式 M_PI_4 * 0.5 * 进度
18 | FMLayoutCrossTransformCrooked,
19 | ///折叠效果
20 | FMLayoutCrossTransformFold,
21 |
22 | };
23 | ///Cell是需要做处理的cell, progress是指cell中心点到屏幕边缘移动的进度 -1 ~ 1 0为在最中间 -1在左边 1在右边
24 | typedef void(^FMLayoutCrossTransformBlock)(UICollectionViewCell *cell, CGFloat progress);
25 |
26 | ///当前仅针对横向做适配 更多的动画
27 | @interface FMLayoutCrossTransformSection : FMLayoutCrossSection
28 | ///形变类型
29 | @property(nonatomic, assign)FMLayoutCrossTransformType transformType;
30 | ///如果有该Block 则优先执行此block
31 | @property(nonatomic, copy)FMLayoutCrossTransformBlock __nullable transformBlock;
32 |
33 | @end
34 |
35 | NS_ASSUME_NONNULL_END
36 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutDebugLog.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutDebugLog.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/17.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | extern void FMLayoutLog(NSString *format);
13 | extern void FMLayoutOpenLog(void);
14 | extern void FMLayoutCloseLog(void);
15 | extern NSInteger FMLayoutRandomValue(NSInteger start, NSInteger end);
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutDynamicSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutDynamicSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutElement.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | ///返回cell大小的block 横向-返回宽度 纵向-返回高度
14 | typedef CGFloat(^FMLayoutItemOtherBlock)(id section, NSInteger item);
15 | typedef CGFloat(^FMLayoutAutoHeightLaterBlock)(id section, NSInteger item, CGFloat autoHeight);
16 |
17 | ///动态 可以注册多种cell 宽度固定 高度可以自适应 但需要用block填充数据 需要设置deqCellReturnReuseId该block值以获取cell 高度亦可以通过手动计算heightBlock返回 手动计算优先级要高
18 | @interface FMLayoutDynamicSection : FMLayoutBaseSection
19 | /// yes时 布局耗时比较长 是否自动计算高度 需设置configurationCell方法填充数据 仅支持纵向布局时使用
20 | @property(nonatomic, assign)BOOL autoHeightFixedWidth;
21 | @property(nonatomic, copy)FMLayoutAutoHeightLaterBlock autoHeightLaterHander;
22 | ///cell固定一个方向的大小 纵向-宽度 横向-高度
23 | @property(nonatomic, assign)CGFloat cellFixedSize;
24 | ///需要注册的cell元素
25 | @property(nonatomic, strong)NSArray *cellElements;
26 | ///固定单一分组 当固定单一分组时 可以不用手动配置deqCellReturnReuseId
27 | @property(nonatomic, strong)FMLayoutElement *cellElement;
28 | ///获取cell的复用FMLayoutElement
29 | @property(nonatomic, copy)FMLayoutElement *(^deqCellReturnElement)(FMLayoutDynamicSection *section, NSInteger item);
30 | ///填充数据 仅当autoHeightFixedWidth为Yes时有用
31 | @property(nonatomic, copy)void(^configurationCell)(FMLayoutDynamicSection *section, UICollectionViewCell *cell, NSInteger item);
32 | ///block返回手动计算的高度 优先级比自动的高
33 | @property(nonatomic, copy)FMLayoutItemOtherBlock otherBlock;
34 |
35 | - (CGFloat)autoHeightVerticalWithWidth:(CGFloat)fixedWidth index:(NSInteger)index;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutElement.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutElement.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FMLayoutElement : NSObject
15 |
16 | @property(nonatomic, copy)NSString *reuseIdentifier;
17 | @property(nonatomic, assign)BOOL isNib;
18 | @property(nonatomic, weak)Class viewClass;///视图的类
19 |
20 | + (instancetype)elementWithViewClass:(Class)vCalss;
21 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib;
22 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
23 |
24 | - (void)registerElementWithCollection:(UICollectionView *)collectionView;
25 |
26 | @end
27 |
28 | NS_ASSUME_NONNULL_END
29 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutFillSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFillSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/4/11.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | ///返回cell大小的block
13 | typedef CGSize(^FMLayoutItemSizeBlock)(id section, NSInteger item);
14 | ///支持纵向插横向 只可以上对齐以及左对齐
15 | @interface FMLayoutFillSection : FMLayoutDynamicSection
16 |
17 | @property(nonatomic, copy)FMLayoutItemSizeBlock sizeBlock;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutFixedSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFixedSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutElement.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | ///固定cell的大小 单一一种cell样式 支持同样cell是否可以横向滚动 内嵌collectionView 支持纵向插横向
14 | @interface FMLayoutFixedSection : FMLayoutBaseSection
15 |
16 | @property(nonatomic, assign)CGSize itemSize;///分组cell大小
17 |
18 | @property(nonatomic, strong)FMLayoutElement *cellElement;///固定分组
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFooter.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMLayoutFooter : FMSupplementary
14 | /// 距离最后Item的距离 纵向-上方 横向-左边
15 | @property(nonatomic, assign)CGFloat topMargin;
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutHeader.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 | /// 悬浮方式
12 | typedef NS_ENUM(NSInteger, FMLayoutHeaderType) {
13 | ///跟着滚动
14 | FMLayoutHeaderTypeFixed,
15 | ///悬浮在顶部 跟着section动
16 | FMLayoutHeaderTypeSuspension,
17 | ///悬浮在顶部 不跟随section动 如果出现多个可能会被覆盖
18 | FMLayoutHeaderTypeSuspensionAlways,
19 | ///仅支持在第一个头部 下拉放大效果
20 | FMLayoutHeaderTypeSuspensionBigger
21 | };
22 |
23 | @interface FMLayoutHeader : FMSupplementary
24 | /// 显示方式 是悬浮 还是跟着滚动 默认跟着滚动
25 | @property(nonatomic, assign)FMLayoutHeaderType type;
26 | /// 悬浮模式时距离顶部的高度 可以来设置两个悬浮的方式 多个顶部悬浮时 可以通过这个来达到层叠悬浮的模式
27 | @property(nonatomic, assign)CGFloat suspensionTopMargin;
28 | /// 距离第一个Item的距离 纵向-下方 横向-右边
29 | @property(nonatomic, assign)CGFloat lastMargin;
30 | ///是否黏在顶部 目前仅支持FMLayoutHeaderTypeSuspensionAlways, FMLayoutHeaderTypeSuspensionBigger悬浮模式 不同的type效果不同 FMLayoutHeaderTypeSuspensionAlways是下拉黏在当前位置 上拉黏在顶部 而FMLayoutHeaderTypeSuspensionBiggers是上拉黏在顶部 下拉时放大效果
31 | @property(nonatomic, assign)BOOL isStickTop;
32 | /// 缩放模式(SuspensionBigger)下最小值 横向-宽度 纵向-高度 该值请务必小于size 默认是0
33 | @property(nonatomic, assign)CGFloat minSize;
34 | /// 缩放模式(SuspensionBigger)下最大值 横向-宽度 纵向-高度 该值请务必大于size 默认是CGFLOAT_MAX
35 | @property(nonatomic, assign)CGFloat maxSize;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutKit-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "FMLayoutBackground.h"
14 | #import "FMLayoutElement.h"
15 | #import "FMLayoutFooter.h"
16 | #import "FMLayoutHeader.h"
17 | #import "FMSupplementary.h"
18 | #import "FMCollectionLayoutAttributes.h"
19 | #import "FMKVOArrayObject.h"
20 | #import "FMLayout.h"
21 | #import "FMLayoutView.h"
22 | #import "FMTeslaLayoutView.h"
23 | #import "FMTeslaSuspensionHeightChangeDelegate.h"
24 |
25 | #import "FMLayoutCrossSection.h"
26 | #import "FMLayoutAbsoluteSection.h"
27 | #import "FMLayoutBaseSection.h"
28 | #import "FMLayoutDynamicSection.h"
29 | #import "FMLayoutFillSection.h"
30 | #import "FMLayoutFixedSection.h"
31 | #import "FMLayoutLabelSection.h"
32 |
33 | FOUNDATION_EXPORT double FMLayoutKitVersionNumber;
34 | FOUNDATION_EXPORT const unsigned char FMLayoutKitVersionString[];
35 |
36 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutKit.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutKit.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/9.
6 | //
7 |
8 | #ifndef FMLayoutKit_h
9 | #define FMLayoutKit_h
10 |
11 | #import "FMTeslaLayoutView.h"
12 | #import "FMLayoutView.h"
13 | #import "FMLayout.h"
14 | #import "FMCollectionLayoutAttributes.h"
15 |
16 | #import "FMTeslaSuspensionHeightChangeDelegate.h"
17 |
18 | #import "FMLayoutFixedSection.h"
19 | #import "FMLayoutDynamicSection.h"
20 | #import "FMLayoutLabelSection.h"
21 | #import "FMLayoutFillSection.h"
22 | #import "FMLayoutAbsoluteSection.h"
23 | #import "FMLayoutCrossSection.h"
24 | #import "FMLayoutCrossTransformSection.h"
25 | #import "FMLayoutCombineSection.h"
26 | #import "FMLayoutScaleSection.h"
27 |
28 |
29 | #import "FMSupplementary.h"
30 | #import "FMLayoutHeader.h"
31 | #import "FMLayoutFooter.h"
32 | #import "FMLayoutBackground.h"
33 |
34 | #endif /* FMLayoutKit_h */
35 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutLabelSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutLabelSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 | #import "FMLayoutElement.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | ///返回cell大小的block
13 | typedef CGFloat(^FMLayoutItemWidthBlock)(id section, NSInteger item);
14 |
15 | ///当到第多少个的时候超出最大行 可移除数据处理 itemDatas会清理 否则frame为zero
16 | typedef CGFloat(^FMLayoutOverItemBlock)(id section, NSInteger item);
17 |
18 | ///标签式布局 根据文本伸缩布局 宽度不够 换行 适用于历史搜索记录 sku选择等样式
19 | @interface FMLayoutLabelSection : FMLayoutDynamicSection
20 | ///最大行数 超出讲不显示 纵向布局时生效
21 | @property(nonatomic, assign)NSInteger maxLine;
22 | ///cell固定的高度
23 | @property(nonatomic, assign)CGFloat cellFixedHeight;
24 | ///cell最大宽度 不设置的话 就是collection的宽度减去左右分组内边距
25 | @property(nonatomic, assign)CGFloat cellMaxWidth;
26 | ///block返回手动计算的宽度
27 | @property(nonatomic, copy)FMLayoutItemWidthBlock widthBlock;
28 | ///block返回手动计算的宽度
29 | @property(nonatomic, copy)FMLayoutOverItemBlock overItemBlock;
30 |
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutScaleSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutScaleSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/20.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | ///支持两种设置固定大小的方式 一种直接给数组sizeNums 一种给比例字符串scales 后设置的生效
12 | @interface FMLayoutScaleSection : FMLayoutDynamicSection
13 | /// 纵向布局 则是宽度比例 横向布局 则是高度比例 例如纵向布局时该值为: 1:2:3 则就是3列 宽度比为剩下的值的比例 仅支持当前样式 可以是小数值 但不能为非数值类型
14 | @property(nonatomic, copy)NSString *scales;
15 | ///每一列的固定大小 如:@[@100, @200] 则表示两列 一个固定宽度为100 另外一列为200 共两列
16 | @property(nonatomic, strong)NSArray *sizeNums;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMLayoutView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutView.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FMLayout.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FMLayoutView : UICollectionView
15 | @property(nonatomic, weak)FMLayout *layout;
16 | ///重写了set get 目标指向->layout.sections
17 | @property(nonatomic)NSMutableArray *sections;
18 |
19 | @property(nonatomic, assign)BOOL reloadOlnyChanged;
20 | ///是否允许长按拖拽排序 不支持夸分组 分组需要开启canLongPressExchange才可以移动拖拽排序
21 | @property(nonatomic, assign)BOOL enableLongPressDrag;
22 | ///长按拖拽开始时配置cell显示的样式
23 | @property(nonatomic, copy)UIView *(^configureSourceView)(UICollectionViewCell *sourceCell);
24 | - (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout NS_UNAVAILABLE;
25 | - (instancetype)initHorizontal;
26 | - (instancetype)initHorizontalWithFrame:(CGRect)frame;
27 | /// 循环遍历出更改过的sections 如果有过增删分组 请使用原有的reloadData方法
28 | - (void)reloadChangedSectionsData;
29 | ///获取到滚动到indexPath位置偏移量 如果获取到的不准确 请先调用layoutIfNeeded方法
30 | - (CGPoint)contentOffsetScrollToIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition;
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMSupplementary.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMSupplementary.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutElement.h"
10 |
11 | typedef NS_ENUM(NSInteger, FMLayoutZIndex) {
12 | ///最底层 头部 底部 Item的下方
13 | FMLayoutZIndexBg = -9999,
14 | ///Item的下方
15 | FMLayoutZIndexBackOfItem = -1,
16 | /// 自动悬浮可能会被覆盖
17 | FMLayoutZIndexAuto = 0,
18 | /// Item的上方
19 | FMLayoutZIndexFrontOfItem = 1,
20 | /// 最最上方
21 | FMLayoutZIndexFrontAlways = 9999
22 | };
23 |
24 | NS_ASSUME_NONNULL_BEGIN
25 | /// 请使用子类Footer, Header, Background
26 | @interface FMSupplementary : FMLayoutElement
27 | ///该Element的大小 纵向-高度 横向-宽度
28 | @property(nonatomic, assign)CGFloat size;
29 | ///视图层级 最上方还是最下方等
30 | @property(nonatomic, assign)FMLayoutZIndex zIndex;
31 | ///内边距 HeaderFooter受sectionInset影响 Background不受sectionInset影响
32 | @property(nonatomic, assign)UIEdgeInsets inset;
33 | ///Element类型 Header Footer Background等
34 | @property(nonatomic, copy, readonly)NSString *elementKind;
35 | ///是否自适应高度 仅当垂直布局时可用
36 | @property(nonatomic, assign)BOOL autoHeight;
37 | @property(nonatomic, copy)void(^configureDataAutoHeight)(UICollectionReusableView *view);
38 |
39 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass;
40 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib;
41 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
42 |
43 | - (UICollectionReusableView *)dequeueReusableViewWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath;
44 |
45 | - (void)updateHeightWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath maxWidth:(CGFloat)maxWidth;
46 | @end
47 |
48 | NS_ASSUME_NONNULL_END
49 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMTeslaLayoutView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMTeslaLayoutView.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @class FMLayoutView, FMTeslaLayoutView, FMLayoutBaseSection;
13 | @protocol FMTeslaLayoutViewDelegate
14 | @optional
15 | ///滚动结束事件
16 | - (void)tesla:(FMTeslaLayoutView *)tesla didScrollEnd:(NSInteger)index currentScrollView:(UIScrollView *)scrollView;
17 | ///滚动事件
18 | - (void)tesla:(FMTeslaLayoutView *)tesla scrollViewDidScroll:(UIScrollView *)scrollView;
19 | /// 当前上下滚动的事件
20 | - (void)tesla:(FMTeslaLayoutView *)tesla currentScrollViewScrollDidScroll:(UIScrollView *)currentScrollView contentOffset:(CGPoint)contentOffset;
21 |
22 | /// 配置FMCollectionLayoutView
23 | ///2
24 | - (void)tesla:(FMTeslaLayoutView *)tesla currentShowScrollView:(UIScrollView *)scrollView index:(NSInteger)index;
25 |
26 | ///0 即将根据Index创建FMCollectionLayoutView
27 | - (void)tesla:(FMTeslaLayoutView *)tesla willCreateScrollViewWithIndex:(NSInteger)index;
28 |
29 | ///0.5 根据Index自己创建FMCollectionLayoutView shareHeight为共享头部的高度 请将shareHeight顶部空出来并且请保持不使用contentInset 如果返回nil会自动创建FMLayoutView
30 | - (UIScrollView *)tesla:(FMTeslaLayoutView *)tesla customCreateWithIndex:(NSInteger)index shareHeight:(CGFloat)shareHeight;
31 |
32 | ///1 根据Index创建完毕UIScrollView
33 | - (void)tesla:(FMTeslaLayoutView *)tesla didCreatedScrollViewWithIndex:(NSInteger)index scrollView:(UIScrollView *)scrollView;
34 |
35 | /// 悬停标签控制view的尺寸最小高度 可以留着做效果
36 | - (CGFloat)shareSuspensionMinHeightWithTesla:(FMTeslaLayoutView *)tesla;
37 | @end
38 |
39 | @protocol FMTeslaLayoutViewDataSource
40 | @required
41 | - (NSInteger)numberOfScreenInTesla:(FMTeslaLayoutView *)tesla;
42 | @optional
43 | - (NSArray *)shareSectionsInTesla:(FMTeslaLayoutView *)tesla;
44 | @end
45 |
46 | @class FMLayoutBaseSection;
47 | @interface FMTeslaLayoutView : UIView
48 | @property(nonatomic, weak)id delegate;
49 | @property(nonatomic, weak)id dataSource;
50 | @property(nonatomic, assign)BOOL horizontalCanScroll;
51 | @property(nonatomic, assign)BOOL allShareStickTop;
52 | @property(nonatomic, assign)NSInteger selectIndex;
53 |
54 | @property(nonatomic, assign)BOOL isLoadSubView;
55 | @property(nonatomic, assign)CGFloat shareHeight;
56 |
57 | @property(nonatomic, strong, readonly)FMLayoutView *shareLayoutView;
58 |
59 | - (void)reLoadSubViews;
60 | - (void)reloadData;
61 | - (void)reloadDataWithIndex:(NSInteger)index;
62 | - (void)scrollToIndex:(NSInteger)index animated:(BOOL)animated;
63 | @end
64 |
65 | NS_ASSUME_NONNULL_END
66 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Headers/FMTeslaSuspensionHeightChangeDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMTeslaSuspensionHeightChangeDelegate.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/5/13.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @protocol FMTeslaSuspensionHeightChangeDelegate
13 |
14 | - (void)teslaSuspensionHeaderShouldShowHeight:(CGFloat)showHeight;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Example/FMLayoutKitFramework/FMLayoutKit.framework/Info.plist
--------------------------------------------------------------------------------
/Example/FMLayoutKitFramework/FMLayoutKit.framework/Modules/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module FMLayoutKit {
2 | umbrella header "FMLayoutKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework.dSYM/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleIdentifier
8 | com.apple.xcode.dsym.org.cocoapods.FMLayoutKit
9 | CFBundleInfoDictionaryVersion
10 | 6.0
11 | CFBundlePackageType
12 | dSYM
13 | CFBundleSignature
14 | ????
15 | CFBundleShortVersionString
16 | 1.0.0
17 | CFBundleVersion
18 | 1
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework.dSYM/Contents/Resources/DWARF/FMLayoutKit:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework.dSYM/Contents/Resources/DWARF/FMLayoutKit
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/FMLayoutKit:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/FMLayoutKit
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMCollectionLayoutAttributes.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionLayoutAttributes.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/25.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FMLayoutBaseSection.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCollectionLayoutAttributes : UICollectionViewLayoutAttributes
14 |
15 | @property(nonatomic, assign)FMLayoutDirection direction;
16 |
17 | + (instancetype)headerAttributesWithSection:(FMLayoutBaseSection *)section;
18 | - (instancetype)updateHeaderAttributesWithSection:(FMLayoutBaseSection *)section;
19 |
20 | + (instancetype)suspensionShowHeaderAttributes:(FMLayoutBaseSection *)section;
21 |
22 | + (instancetype)footerAttributesWithSection:(FMLayoutBaseSection *)section;
23 | - (instancetype)updateFooterAttributesWithSection:(FMLayoutBaseSection *)section;
24 |
25 | + (instancetype)bgAttributesWithSection:(FMLayoutBaseSection *)section;
26 | - (instancetype)updateBgAttributesWithSection:(FMLayoutBaseSection *)section;
27 |
28 | - (void)_onlyUpdateOffsetWith:(FMLayoutBaseSection *)section;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMCollectionViewDelegateDataSourceProvider.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionViewDelegateDataSourceProvider.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2021/3/27.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @class FMLayoutBaseSection;
13 | @interface FMCollectionViewDelegateDataSourceProvider : NSObject
14 |
15 | ///重写了set get 目标指向->layout.sections
16 | @property(nonatomic, strong)NSMutableArray *sections;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMKVOArrayObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMKVOArrayObject.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/5.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface FMKVOArrayObject : NSObject
13 |
14 | @property (strong,nonatomic)NSMutableArray *targetArray;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayout.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutHeader.h"
11 | #import "FMLayoutFooter.h"
12 | #import "FMLayoutBackground.h"
13 | #import "FMCollectionLayoutAttributes.h"
14 |
15 | NS_ASSUME_NONNULL_BEGIN
16 |
17 | @interface FMLayout : UICollectionViewLayout
18 |
19 | @property(nonatomic, assign)FMLayoutDirection direction;
20 | @property(nonatomic, strong)NSMutableArray *sections;
21 | ///最后固定边距 跟section的inset无关 contentSize会自动加上去
22 | @property(nonatomic, assign)CGFloat fixedLastMargin;
23 | ///是否只计算改变的布局 NO为每一次 都是重新计算所有布局
24 | @property(nonatomic, assign)BOOL reLayoutOlnyChanged;
25 | ///最小可滑动的大小 横向-高度 纵向-宽度
26 | @property(nonatomic, assign)CGFloat minContentSize;
27 | ///第一个Section的偏移量
28 | @property(nonatomic, assign)CGFloat firstSectionOffset;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutAbsoluteSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutAbsoluteSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/9.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | typedef CGRect(^FMLayoutBaseSectionItemFrameBlock)(id section, NSInteger item);
13 | ///支持纵向插横向
14 | @interface FMLayoutAbsoluteSection : FMLayoutDynamicSection
15 |
16 | @property(nonatomic, copy)FMLayoutBaseSectionItemFrameBlock frameBlock;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutBackground.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutBackground.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/27.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | static NSString *const UICollectionElementKindSectionBackground = @"UICollectionElementKindSectionBackground";
14 |
15 | @interface FMLayoutBackground : FMSupplementary
16 |
17 | + (instancetype)bgWithViewClass:(Class)viewClass;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCombineSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCombineSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/12.
6 | //
7 |
8 | #import "FMLayoutBaseSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | ///可以将不同Cell, 不同的布局方式, 放到同一个分组去合并,只合并cell, 如果子分组有头部和底部讲被忽略,合并分组的头部与底部不影响配置, cell的点击事件已经在init方法中配置block分发到子分组上 合并分组不支持拖拽排序 想要支持 可以继承自该类重写canLongPressExchange的get方法 并实现- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
12 | @interface FMLayoutCombineSection : FMLayoutBaseSection
13 | @property(nonatomic, readonly)NSArray *subSections;
14 | + (instancetype)combineSections:(NSArray *)sections;
15 | - (void)appendSection:(FMLayoutBaseSection *)section;
16 | - (void)insetSection:(FMLayoutBaseSection *)section atIndex:(NSInteger)index;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCrossSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import "FMLayoutBaseSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | @interface FMLayoutCrossSection : FMLayoutBaseSection
12 | @property(nonatomic, assign, readonly)FMLayoutDirection crossDirection;
13 | /// 所有section计算获取最大的高度
14 | @property(nonatomic, assign)BOOL autoMaxSize;
15 | /// 所有section计算获取最大的高度
16 | @property(nonatomic, assign)CGFloat size;
17 | @property(nonatomic, assign)BOOL canReuseCell;
18 | @property(nonatomic, assign, readonly)CGFloat maxContentWidth;
19 |
20 | @property(nonatomic, strong)NSMutableArray *sections;
21 |
22 | @property(nonatomic, copy)void(^scrollDidScroll)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
23 | @property(nonatomic, copy)void(^configureCollectionView)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
24 |
25 | + (instancetype)sectionAutoWithSection:(FMLayoutBaseSection *)section;
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCrossTransformSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossTransformSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/15.
6 | //
7 |
8 | #import "FMLayoutCrossSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | typedef NS_ENUM(NSUInteger, FMLayoutCrossTransformType) {
13 | ///什么都不做
14 | FMLayoutCrossTransformNone,
15 | ///缩小0.9 + 0.1*进度
16 | FMLayoutCrossTransformScale,
17 | ///简拼App首页样式 M_PI_4 * 0.5 * 进度
18 | FMLayoutCrossTransformCrooked,
19 | ///折叠效果
20 | FMLayoutCrossTransformFold,
21 |
22 | };
23 | ///Cell是需要做处理的cell, progress是指cell中心点到屏幕边缘移动的进度 -1 ~ 1 0为在最中间 -1在左边 1在右边
24 | typedef void(^FMLayoutCrossTransformBlock)(UICollectionViewCell *cell, CGFloat progress);
25 |
26 | ///当前仅针对横向做适配 更多的动画
27 | @interface FMLayoutCrossTransformSection : FMLayoutCrossSection
28 | ///形变类型
29 | @property(nonatomic, assign)FMLayoutCrossTransformType transformType;
30 | ///如果有该Block 则优先执行此block
31 | @property(nonatomic, copy)FMLayoutCrossTransformBlock __nullable transformBlock;
32 |
33 | @end
34 |
35 | NS_ASSUME_NONNULL_END
36 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutDebugLog.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutDebugLog.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/17.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | extern void FMLayoutLog(NSString *format);
13 | extern void FMLayoutOpenLog(void);
14 | extern void FMLayoutCloseLog(void);
15 | extern NSInteger FMLayoutRandomValue(NSInteger start, NSInteger end);
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutDynamicSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutDynamicSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutElement.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | ///返回cell大小的block 横向-返回宽度 纵向-返回高度
14 | typedef CGFloat(^FMLayoutItemOtherBlock)(id section, NSInteger item);
15 | typedef CGFloat(^FMLayoutAutoHeightLaterBlock)(id section, NSInteger item, CGFloat autoHeight);
16 |
17 | ///动态 可以注册多种cell 宽度固定 高度可以自适应 但需要用block填充数据 需要设置deqCellReturnReuseId该block值以获取cell 高度亦可以通过手动计算heightBlock返回 手动计算优先级要高
18 | @interface FMLayoutDynamicSection : FMLayoutBaseSection
19 | /// yes时 布局耗时比较长 是否自动计算高度 需设置configurationCell方法填充数据 仅支持纵向布局时使用
20 | @property(nonatomic, assign)BOOL autoHeightFixedWidth;
21 | @property(nonatomic, copy)FMLayoutAutoHeightLaterBlock autoHeightLaterHander;
22 | ///cell固定一个方向的大小 纵向-宽度 横向-高度
23 | @property(nonatomic, assign)CGFloat cellFixedSize;
24 | ///需要注册的cell元素
25 | @property(nonatomic, strong)NSArray *cellElements;
26 | ///固定单一分组 当固定单一分组时 可以不用手动配置deqCellReturnReuseId
27 | @property(nonatomic, strong)FMLayoutElement *cellElement;
28 | ///获取cell的复用FMLayoutElement
29 | @property(nonatomic, copy)FMLayoutElement *(^deqCellReturnElement)(FMLayoutDynamicSection *section, NSInteger item);
30 | ///填充数据 仅当autoHeightFixedWidth为Yes时有用
31 | @property(nonatomic, copy)void(^configurationCell)(FMLayoutDynamicSection *section, UICollectionViewCell *cell, NSInteger item);
32 | ///block返回手动计算的高度 优先级比自动的高
33 | @property(nonatomic, copy)FMLayoutItemOtherBlock otherBlock;
34 |
35 | - (CGFloat)autoHeightVerticalWithWidth:(CGFloat)fixedWidth index:(NSInteger)index;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutElement.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutElement.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FMLayoutElement : NSObject
15 |
16 | @property(nonatomic, copy)NSString *reuseIdentifier;
17 | @property(nonatomic, assign)BOOL isNib;
18 | @property(nonatomic, weak)Class viewClass;///视图的类
19 |
20 | + (instancetype)elementWithViewClass:(Class)vCalss;
21 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib;
22 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
23 |
24 | - (void)registerElementWithCollection:(UICollectionView *)collectionView;
25 |
26 | @end
27 |
28 | NS_ASSUME_NONNULL_END
29 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFillSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFillSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/4/11.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | ///返回cell大小的block
13 | typedef CGSize(^FMLayoutItemSizeBlock)(id section, NSInteger item);
14 | ///支持纵向插横向 只可以上对齐以及左对齐
15 | @interface FMLayoutFillSection : FMLayoutDynamicSection
16 |
17 | @property(nonatomic, copy)FMLayoutItemSizeBlock sizeBlock;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFixedSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFixedSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutElement.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | ///固定cell的大小 单一一种cell样式 支持同样cell是否可以横向滚动 内嵌collectionView 支持纵向插横向
14 | @interface FMLayoutFixedSection : FMLayoutBaseSection
15 |
16 | @property(nonatomic, assign)CGSize itemSize;///分组cell大小
17 |
18 | @property(nonatomic, strong)FMLayoutElement *cellElement;///固定分组
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFooter.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMLayoutFooter : FMSupplementary
14 | /// 距离最后Item的距离 纵向-上方 横向-左边
15 | @property(nonatomic, assign)CGFloat topMargin;
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutHeader.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 | /// 悬浮方式
12 | typedef NS_ENUM(NSInteger, FMLayoutHeaderType) {
13 | ///跟着滚动
14 | FMLayoutHeaderTypeFixed,
15 | ///悬浮在顶部 跟着section动
16 | FMLayoutHeaderTypeSuspension,
17 | ///悬浮在顶部 不跟随section动 如果出现多个可能会被覆盖
18 | FMLayoutHeaderTypeSuspensionAlways,
19 | ///仅支持在第一个头部 下拉放大效果
20 | FMLayoutHeaderTypeSuspensionBigger
21 | };
22 |
23 | @interface FMLayoutHeader : FMSupplementary
24 | /// 显示方式 是悬浮 还是跟着滚动 默认跟着滚动
25 | @property(nonatomic, assign)FMLayoutHeaderType type;
26 | /// 悬浮模式时距离顶部的高度 可以来设置两个悬浮的方式 多个顶部悬浮时 可以通过这个来达到层叠悬浮的模式
27 | @property(nonatomic, assign)CGFloat suspensionTopMargin;
28 | /// 距离第一个Item的距离 纵向-下方 横向-右边
29 | @property(nonatomic, assign)CGFloat lastMargin;
30 | ///是否黏在顶部 目前仅支持FMLayoutHeaderTypeSuspensionAlways, FMLayoutHeaderTypeSuspensionBigger悬浮模式 不同的type效果不同 FMLayoutHeaderTypeSuspensionAlways是下拉黏在当前位置 上拉黏在顶部 而FMLayoutHeaderTypeSuspensionBiggers是上拉黏在顶部 下拉时放大效果
31 | @property(nonatomic, assign)BOOL isStickTop;
32 | /// 缩放模式(SuspensionBigger)下最小值 横向-宽度 纵向-高度 该值请务必小于size 默认是0
33 | @property(nonatomic, assign)CGFloat minSize;
34 | /// 缩放模式(SuspensionBigger)下最大值 横向-宽度 纵向-高度 该值请务必大于size 默认是CGFLOAT_MAX
35 | @property(nonatomic, assign)CGFloat maxSize;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutKit-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "FMLayoutBackground.h"
14 | #import "FMLayoutElement.h"
15 | #import "FMLayoutFooter.h"
16 | #import "FMLayoutHeader.h"
17 | #import "FMSupplementary.h"
18 | #import "FMCollectionLayoutAttributes.h"
19 | #import "FMKVOArrayObject.h"
20 | #import "FMLayout.h"
21 | #import "FMLayoutView.h"
22 | #import "FMTeslaLayoutView.h"
23 | #import "FMTeslaSuspensionHeightChangeDelegate.h"
24 |
25 | #import "FMLayoutCrossSection.h"
26 | #import "FMLayoutAbsoluteSection.h"
27 | #import "FMLayoutBaseSection.h"
28 | #import "FMLayoutDynamicSection.h"
29 | #import "FMLayoutFillSection.h"
30 | #import "FMLayoutFixedSection.h"
31 | #import "FMLayoutLabelSection.h"
32 |
33 | FOUNDATION_EXPORT double FMLayoutKitVersionNumber;
34 | FOUNDATION_EXPORT const unsigned char FMLayoutKitVersionString[];
35 |
36 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutKit.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutKit.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/9.
6 | //
7 |
8 | #ifndef FMLayoutKit_h
9 | #define FMLayoutKit_h
10 |
11 | #import "FMTeslaLayoutView.h"
12 | #import "FMLayoutView.h"
13 | #import "FMLayout.h"
14 | #import "FMCollectionLayoutAttributes.h"
15 |
16 | #import "FMTeslaSuspensionHeightChangeDelegate.h"
17 |
18 | #import "FMLayoutFixedSection.h"
19 | #import "FMLayoutDynamicSection.h"
20 | #import "FMLayoutLabelSection.h"
21 | #import "FMLayoutFillSection.h"
22 | #import "FMLayoutAbsoluteSection.h"
23 | #import "FMLayoutCrossSection.h"
24 | #import "FMLayoutCrossTransformSection.h"
25 | #import "FMLayoutCombineSection.h"
26 | #import "FMLayoutScaleSection.h"
27 |
28 |
29 | #import "FMSupplementary.h"
30 | #import "FMLayoutHeader.h"
31 | #import "FMLayoutFooter.h"
32 | #import "FMLayoutBackground.h"
33 |
34 | #endif /* FMLayoutKit_h */
35 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutLabelSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutLabelSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 | #import "FMLayoutElement.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | ///返回cell大小的block
13 | typedef CGFloat(^FMLayoutItemWidthBlock)(id section, NSInteger item);
14 |
15 | ///当到第多少个的时候超出最大行 可移除数据处理 itemDatas会清理 否则frame为zero
16 | typedef CGFloat(^FMLayoutOverItemBlock)(id section, NSInteger item);
17 |
18 | ///标签式布局 根据文本伸缩布局 宽度不够 换行 适用于历史搜索记录 sku选择等样式
19 | @interface FMLayoutLabelSection : FMLayoutDynamicSection
20 | ///最大行数 超出讲不显示 纵向布局时生效
21 | @property(nonatomic, assign)NSInteger maxLine;
22 | ///cell固定的高度
23 | @property(nonatomic, assign)CGFloat cellFixedHeight;
24 | ///cell最大宽度 不设置的话 就是collection的宽度减去左右分组内边距
25 | @property(nonatomic, assign)CGFloat cellMaxWidth;
26 | ///block返回手动计算的宽度
27 | @property(nonatomic, copy)FMLayoutItemWidthBlock widthBlock;
28 | ///block返回手动计算的宽度
29 | @property(nonatomic, copy)FMLayoutOverItemBlock overItemBlock;
30 |
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutScaleSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutScaleSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/20.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | ///支持两种设置固定大小的方式 一种直接给数组sizeNums 一种给比例字符串scales 后设置的生效
12 | @interface FMLayoutScaleSection : FMLayoutDynamicSection
13 | /// 纵向布局 则是宽度比例 横向布局 则是高度比例 例如纵向布局时该值为: 1:2:3 则就是3列 宽度比为剩下的值的比例 仅支持当前样式 可以是小数值 但不能为非数值类型
14 | @property(nonatomic, copy)NSString *scales;
15 | ///每一列的固定大小 如:@[@100, @200] 则表示两列 一个固定宽度为100 另外一列为200 共两列
16 | @property(nonatomic, strong)NSArray *sizeNums;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutView.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FMLayout.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FMLayoutView : UICollectionView
15 | @property(nonatomic, weak)FMLayout *layout;
16 | ///重写了set get 目标指向->layout.sections
17 | @property(nonatomic)NSMutableArray *sections;
18 |
19 | @property(nonatomic, assign)BOOL reloadOlnyChanged;
20 | ///是否允许长按拖拽排序 不支持夸分组 分组需要开启canLongPressExchange才可以移动拖拽排序
21 | @property(nonatomic, assign)BOOL enableLongPressDrag;
22 | ///长按拖拽开始时配置cell显示的样式
23 | @property(nonatomic, copy)UIView *(^configureSourceView)(UICollectionViewCell *sourceCell);
24 | - (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout NS_UNAVAILABLE;
25 | - (instancetype)initHorizontal;
26 | - (instancetype)initHorizontalWithFrame:(CGRect)frame;
27 | /// 循环遍历出更改过的sections 如果有过增删分组 请使用原有的reloadData方法
28 | - (void)reloadChangedSectionsData;
29 | ///获取到滚动到indexPath位置偏移量 如果获取到的不准确 请先调用layoutIfNeeded方法
30 | - (CGPoint)contentOffsetScrollToIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition;
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMSupplementary.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMSupplementary.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutElement.h"
10 |
11 | typedef NS_ENUM(NSInteger, FMLayoutZIndex) {
12 | ///最底层 头部 底部 Item的下方
13 | FMLayoutZIndexBg = -9999,
14 | ///Item的下方
15 | FMLayoutZIndexBackOfItem = -1,
16 | /// 自动悬浮可能会被覆盖
17 | FMLayoutZIndexAuto = 0,
18 | /// Item的上方
19 | FMLayoutZIndexFrontOfItem = 1,
20 | /// 最最上方
21 | FMLayoutZIndexFrontAlways = 9999
22 | };
23 |
24 | NS_ASSUME_NONNULL_BEGIN
25 | /// 请使用子类Footer, Header, Background
26 | @interface FMSupplementary : FMLayoutElement
27 | ///该Element的大小 纵向-高度 横向-宽度
28 | @property(nonatomic, assign)CGFloat size;
29 | ///视图层级 最上方还是最下方等
30 | @property(nonatomic, assign)FMLayoutZIndex zIndex;
31 | ///内边距 HeaderFooter受sectionInset影响 Background不受sectionInset影响
32 | @property(nonatomic, assign)UIEdgeInsets inset;
33 | ///Element类型 Header Footer Background等
34 | @property(nonatomic, copy, readonly)NSString *elementKind;
35 | ///是否自适应高度 仅当垂直布局时可用
36 | @property(nonatomic, assign)BOOL autoHeight;
37 | @property(nonatomic, copy)void(^configureDataAutoHeight)(UICollectionReusableView *view);
38 |
39 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass;
40 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib;
41 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
42 |
43 | - (UICollectionReusableView *)dequeueReusableViewWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath;
44 |
45 | - (void)updateHeightWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath maxWidth:(CGFloat)maxWidth;
46 | @end
47 |
48 | NS_ASSUME_NONNULL_END
49 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMTeslaLayoutView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMTeslaLayoutView.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @class FMLayoutView, FMTeslaLayoutView, FMLayoutBaseSection;
13 | @protocol FMTeslaLayoutViewDelegate
14 | @optional
15 | ///滚动结束事件
16 | - (void)tesla:(FMTeslaLayoutView *)tesla didScrollEnd:(NSInteger)index currentScrollView:(UIScrollView *)scrollView;
17 | ///滚动事件
18 | - (void)tesla:(FMTeslaLayoutView *)tesla scrollViewDidScroll:(UIScrollView *)scrollView;
19 | /// 当前上下滚动的事件
20 | - (void)tesla:(FMTeslaLayoutView *)tesla currentScrollViewScrollDidScroll:(UIScrollView *)currentScrollView contentOffset:(CGPoint)contentOffset;
21 |
22 | /// 配置FMCollectionLayoutView
23 | ///2
24 | - (void)tesla:(FMTeslaLayoutView *)tesla currentShowScrollView:(UIScrollView *)scrollView index:(NSInteger)index;
25 |
26 | ///0 即将根据Index创建FMCollectionLayoutView
27 | - (void)tesla:(FMTeslaLayoutView *)tesla willCreateScrollViewWithIndex:(NSInteger)index;
28 |
29 | ///0.5 根据Index自己创建FMCollectionLayoutView shareHeight为共享头部的高度 请将shareHeight顶部空出来并且请保持不使用contentInset 如果返回nil会自动创建FMLayoutView
30 | - (UIScrollView *)tesla:(FMTeslaLayoutView *)tesla customCreateWithIndex:(NSInteger)index shareHeight:(CGFloat)shareHeight;
31 |
32 | ///1 根据Index创建完毕UIScrollView
33 | - (void)tesla:(FMTeslaLayoutView *)tesla didCreatedScrollViewWithIndex:(NSInteger)index scrollView:(UIScrollView *)scrollView;
34 |
35 | /// 悬停标签控制view的尺寸最小高度 可以留着做效果
36 | - (CGFloat)shareSuspensionMinHeightWithTesla:(FMTeslaLayoutView *)tesla;
37 | @end
38 |
39 | @protocol FMTeslaLayoutViewDataSource
40 | @required
41 | - (NSInteger)numberOfScreenInTesla:(FMTeslaLayoutView *)tesla;
42 | @optional
43 | - (NSArray *)shareSectionsInTesla:(FMTeslaLayoutView *)tesla;
44 | @end
45 |
46 | @class FMLayoutBaseSection;
47 | @interface FMTeslaLayoutView : UIView
48 | @property(nonatomic, weak)id delegate;
49 | @property(nonatomic, weak)id dataSource;
50 | @property(nonatomic, assign)BOOL horizontalCanScroll;
51 | @property(nonatomic, assign)BOOL allShareStickTop;
52 | @property(nonatomic, assign)NSInteger selectIndex;
53 |
54 | @property(nonatomic, assign)BOOL isLoadSubView;
55 | @property(nonatomic, assign)CGFloat shareHeight;
56 |
57 | @property(nonatomic, strong, readonly)FMLayoutView *shareLayoutView;
58 |
59 | - (void)reLoadSubViews;
60 | - (void)reloadData;
61 | - (void)reloadDataWithIndex:(NSInteger)index;
62 | - (void)scrollToIndex:(NSInteger)index animated:(BOOL)animated;
63 | @end
64 |
65 | NS_ASSUME_NONNULL_END
66 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Headers/FMTeslaSuspensionHeightChangeDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMTeslaSuspensionHeightChangeDelegate.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/5/13.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @protocol FMTeslaSuspensionHeightChangeDelegate
13 |
14 | - (void)teslaSuspensionHeaderShouldShowHeight:(CGFloat)showHeight;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Info.plist
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphoneos/FMLayoutKit/FMLayoutKit.framework/Modules/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module FMLayoutKit {
2 | umbrella header "FMLayoutKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework.dSYM/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleIdentifier
8 | com.apple.xcode.dsym.org.cocoapods.FMLayoutKit
9 | CFBundleInfoDictionaryVersion
10 | 6.0
11 | CFBundlePackageType
12 | dSYM
13 | CFBundleSignature
14 | ????
15 | CFBundleShortVersionString
16 | 1.0.0
17 | CFBundleVersion
18 | 1
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework.dSYM/Contents/Resources/DWARF/FMLayoutKit:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework.dSYM/Contents/Resources/DWARF/FMLayoutKit
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/FMLayoutKit:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/FMLayoutKit
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMCollectionLayoutAttributes.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionLayoutAttributes.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/25.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FMLayoutBaseSection.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCollectionLayoutAttributes : UICollectionViewLayoutAttributes
14 |
15 | @property(nonatomic, assign)FMLayoutDirection direction;
16 |
17 | + (instancetype)headerAttributesWithSection:(FMLayoutBaseSection *)section;
18 | - (instancetype)updateHeaderAttributesWithSection:(FMLayoutBaseSection *)section;
19 |
20 | + (instancetype)suspensionShowHeaderAttributes:(FMLayoutBaseSection *)section;
21 |
22 | + (instancetype)footerAttributesWithSection:(FMLayoutBaseSection *)section;
23 | - (instancetype)updateFooterAttributesWithSection:(FMLayoutBaseSection *)section;
24 |
25 | + (instancetype)bgAttributesWithSection:(FMLayoutBaseSection *)section;
26 | - (instancetype)updateBgAttributesWithSection:(FMLayoutBaseSection *)section;
27 |
28 | - (void)_onlyUpdateOffsetWith:(FMLayoutBaseSection *)section;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMCollectionViewDelegateDataSourceProvider.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionViewDelegateDataSourceProvider.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2021/3/27.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @class FMLayoutBaseSection;
13 | @interface FMCollectionViewDelegateDataSourceProvider : NSObject
14 |
15 | ///重写了set get 目标指向->layout.sections
16 | @property(nonatomic, strong)NSMutableArray *sections;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMKVOArrayObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMKVOArrayObject.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/5.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface FMKVOArrayObject : NSObject
13 |
14 | @property (strong,nonatomic)NSMutableArray *targetArray;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayout.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutHeader.h"
11 | #import "FMLayoutFooter.h"
12 | #import "FMLayoutBackground.h"
13 | #import "FMCollectionLayoutAttributes.h"
14 |
15 | NS_ASSUME_NONNULL_BEGIN
16 |
17 | @interface FMLayout : UICollectionViewLayout
18 |
19 | @property(nonatomic, assign)FMLayoutDirection direction;
20 | @property(nonatomic, strong)NSMutableArray *sections;
21 | ///最后固定边距 跟section的inset无关 contentSize会自动加上去
22 | @property(nonatomic, assign)CGFloat fixedLastMargin;
23 | ///是否只计算改变的布局 NO为每一次 都是重新计算所有布局
24 | @property(nonatomic, assign)BOOL reLayoutOlnyChanged;
25 | ///最小可滑动的大小 横向-高度 纵向-宽度
26 | @property(nonatomic, assign)CGFloat minContentSize;
27 | ///第一个Section的偏移量
28 | @property(nonatomic, assign)CGFloat firstSectionOffset;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutAbsoluteSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutAbsoluteSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/9.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | typedef CGRect(^FMLayoutBaseSectionItemFrameBlock)(id section, NSInteger item);
13 | ///支持纵向插横向
14 | @interface FMLayoutAbsoluteSection : FMLayoutDynamicSection
15 |
16 | @property(nonatomic, copy)FMLayoutBaseSectionItemFrameBlock frameBlock;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutBackground.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutBackground.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/27.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | static NSString *const UICollectionElementKindSectionBackground = @"UICollectionElementKindSectionBackground";
14 |
15 | @interface FMLayoutBackground : FMSupplementary
16 |
17 | + (instancetype)bgWithViewClass:(Class)viewClass;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCombineSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCombineSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/12.
6 | //
7 |
8 | #import "FMLayoutBaseSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | ///可以将不同Cell, 不同的布局方式, 放到同一个分组去合并,只合并cell, 如果子分组有头部和底部讲被忽略,合并分组的头部与底部不影响配置, cell的点击事件已经在init方法中配置block分发到子分组上 合并分组不支持拖拽排序 想要支持 可以继承自该类重写canLongPressExchange的get方法 并实现- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
12 | @interface FMLayoutCombineSection : FMLayoutBaseSection
13 | @property(nonatomic, readonly)NSArray *subSections;
14 | + (instancetype)combineSections:(NSArray *)sections;
15 | - (void)appendSection:(FMLayoutBaseSection *)section;
16 | - (void)insetSection:(FMLayoutBaseSection *)section atIndex:(NSInteger)index;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCrossSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import "FMLayoutBaseSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | @interface FMLayoutCrossSection : FMLayoutBaseSection
12 | @property(nonatomic, assign, readonly)FMLayoutDirection crossDirection;
13 | /// 所有section计算获取最大的高度
14 | @property(nonatomic, assign)BOOL autoMaxSize;
15 | /// 所有section计算获取最大的高度
16 | @property(nonatomic, assign)CGFloat size;
17 | @property(nonatomic, assign)BOOL canReuseCell;
18 | @property(nonatomic, assign, readonly)CGFloat maxContentWidth;
19 |
20 | @property(nonatomic, strong)NSMutableArray *sections;
21 |
22 | @property(nonatomic, copy)void(^scrollDidScroll)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
23 | @property(nonatomic, copy)void(^configureCollectionView)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
24 |
25 | + (instancetype)sectionAutoWithSection:(FMLayoutBaseSection *)section;
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutCrossTransformSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossTransformSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/15.
6 | //
7 |
8 | #import "FMLayoutCrossSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | typedef NS_ENUM(NSUInteger, FMLayoutCrossTransformType) {
13 | ///什么都不做
14 | FMLayoutCrossTransformNone,
15 | ///缩小0.9 + 0.1*进度
16 | FMLayoutCrossTransformScale,
17 | ///简拼App首页样式 M_PI_4 * 0.5 * 进度
18 | FMLayoutCrossTransformCrooked,
19 | ///折叠效果
20 | FMLayoutCrossTransformFold,
21 |
22 | };
23 | ///Cell是需要做处理的cell, progress是指cell中心点到屏幕边缘移动的进度 -1 ~ 1 0为在最中间 -1在左边 1在右边
24 | typedef void(^FMLayoutCrossTransformBlock)(UICollectionViewCell *cell, CGFloat progress);
25 |
26 | ///当前仅针对横向做适配 更多的动画
27 | @interface FMLayoutCrossTransformSection : FMLayoutCrossSection
28 | ///形变类型
29 | @property(nonatomic, assign)FMLayoutCrossTransformType transformType;
30 | ///如果有该Block 则优先执行此block
31 | @property(nonatomic, copy)FMLayoutCrossTransformBlock __nullable transformBlock;
32 |
33 | @end
34 |
35 | NS_ASSUME_NONNULL_END
36 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutDebugLog.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutDebugLog.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/17.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | extern void FMLayoutLog(NSString *format);
13 | extern void FMLayoutOpenLog(void);
14 | extern void FMLayoutCloseLog(void);
15 | extern NSInteger FMLayoutRandomValue(NSInteger start, NSInteger end);
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutDynamicSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutDynamicSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutElement.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | ///返回cell大小的block 横向-返回宽度 纵向-返回高度
14 | typedef CGFloat(^FMLayoutItemOtherBlock)(id section, NSInteger item);
15 | typedef CGFloat(^FMLayoutAutoHeightLaterBlock)(id section, NSInteger item, CGFloat autoHeight);
16 |
17 | ///动态 可以注册多种cell 宽度固定 高度可以自适应 但需要用block填充数据 需要设置deqCellReturnReuseId该block值以获取cell 高度亦可以通过手动计算heightBlock返回 手动计算优先级要高
18 | @interface FMLayoutDynamicSection : FMLayoutBaseSection
19 | /// yes时 布局耗时比较长 是否自动计算高度 需设置configurationCell方法填充数据 仅支持纵向布局时使用
20 | @property(nonatomic, assign)BOOL autoHeightFixedWidth;
21 | @property(nonatomic, copy)FMLayoutAutoHeightLaterBlock autoHeightLaterHander;
22 | ///cell固定一个方向的大小 纵向-宽度 横向-高度
23 | @property(nonatomic, assign)CGFloat cellFixedSize;
24 | ///需要注册的cell元素
25 | @property(nonatomic, strong)NSArray *cellElements;
26 | ///固定单一分组 当固定单一分组时 可以不用手动配置deqCellReturnReuseId
27 | @property(nonatomic, strong)FMLayoutElement *cellElement;
28 | ///获取cell的复用FMLayoutElement
29 | @property(nonatomic, copy)FMLayoutElement *(^deqCellReturnElement)(FMLayoutDynamicSection *section, NSInteger item);
30 | ///填充数据 仅当autoHeightFixedWidth为Yes时有用
31 | @property(nonatomic, copy)void(^configurationCell)(FMLayoutDynamicSection *section, UICollectionViewCell *cell, NSInteger item);
32 | ///block返回手动计算的高度 优先级比自动的高
33 | @property(nonatomic, copy)FMLayoutItemOtherBlock otherBlock;
34 |
35 | - (CGFloat)autoHeightVerticalWithWidth:(CGFloat)fixedWidth index:(NSInteger)index;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutElement.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutElement.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FMLayoutElement : NSObject
15 |
16 | @property(nonatomic, copy)NSString *reuseIdentifier;
17 | @property(nonatomic, assign)BOOL isNib;
18 | @property(nonatomic, weak)Class viewClass;///视图的类
19 |
20 | + (instancetype)elementWithViewClass:(Class)vCalss;
21 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib;
22 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
23 |
24 | - (void)registerElementWithCollection:(UICollectionView *)collectionView;
25 |
26 | @end
27 |
28 | NS_ASSUME_NONNULL_END
29 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFillSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFillSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/4/11.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | ///返回cell大小的block
13 | typedef CGSize(^FMLayoutItemSizeBlock)(id section, NSInteger item);
14 | ///支持纵向插横向 只可以上对齐以及左对齐
15 | @interface FMLayoutFillSection : FMLayoutDynamicSection
16 |
17 | @property(nonatomic, copy)FMLayoutItemSizeBlock sizeBlock;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFixedSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFixedSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutElement.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | ///固定cell的大小 单一一种cell样式 支持同样cell是否可以横向滚动 内嵌collectionView 支持纵向插横向
14 | @interface FMLayoutFixedSection : FMLayoutBaseSection
15 |
16 | @property(nonatomic, assign)CGSize itemSize;///分组cell大小
17 |
18 | @property(nonatomic, strong)FMLayoutElement *cellElement;///固定分组
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFooter.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMLayoutFooter : FMSupplementary
14 | /// 距离最后Item的距离 纵向-上方 横向-左边
15 | @property(nonatomic, assign)CGFloat topMargin;
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutHeader.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 | /// 悬浮方式
12 | typedef NS_ENUM(NSInteger, FMLayoutHeaderType) {
13 | ///跟着滚动
14 | FMLayoutHeaderTypeFixed,
15 | ///悬浮在顶部 跟着section动
16 | FMLayoutHeaderTypeSuspension,
17 | ///悬浮在顶部 不跟随section动 如果出现多个可能会被覆盖
18 | FMLayoutHeaderTypeSuspensionAlways,
19 | ///仅支持在第一个头部 下拉放大效果
20 | FMLayoutHeaderTypeSuspensionBigger
21 | };
22 |
23 | @interface FMLayoutHeader : FMSupplementary
24 | /// 显示方式 是悬浮 还是跟着滚动 默认跟着滚动
25 | @property(nonatomic, assign)FMLayoutHeaderType type;
26 | /// 悬浮模式时距离顶部的高度 可以来设置两个悬浮的方式 多个顶部悬浮时 可以通过这个来达到层叠悬浮的模式
27 | @property(nonatomic, assign)CGFloat suspensionTopMargin;
28 | /// 距离第一个Item的距离 纵向-下方 横向-右边
29 | @property(nonatomic, assign)CGFloat lastMargin;
30 | ///是否黏在顶部 目前仅支持FMLayoutHeaderTypeSuspensionAlways, FMLayoutHeaderTypeSuspensionBigger悬浮模式 不同的type效果不同 FMLayoutHeaderTypeSuspensionAlways是下拉黏在当前位置 上拉黏在顶部 而FMLayoutHeaderTypeSuspensionBiggers是上拉黏在顶部 下拉时放大效果
31 | @property(nonatomic, assign)BOOL isStickTop;
32 | /// 缩放模式(SuspensionBigger)下最小值 横向-宽度 纵向-高度 该值请务必小于size 默认是0
33 | @property(nonatomic, assign)CGFloat minSize;
34 | /// 缩放模式(SuspensionBigger)下最大值 横向-宽度 纵向-高度 该值请务必大于size 默认是CGFLOAT_MAX
35 | @property(nonatomic, assign)CGFloat maxSize;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutKit-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "FMLayoutBackground.h"
14 | #import "FMLayoutElement.h"
15 | #import "FMLayoutFooter.h"
16 | #import "FMLayoutHeader.h"
17 | #import "FMSupplementary.h"
18 | #import "FMCollectionLayoutAttributes.h"
19 | #import "FMKVOArrayObject.h"
20 | #import "FMLayout.h"
21 | #import "FMLayoutView.h"
22 | #import "FMTeslaLayoutView.h"
23 | #import "FMTeslaSuspensionHeightChangeDelegate.h"
24 |
25 | #import "FMLayoutCrossSection.h"
26 | #import "FMLayoutAbsoluteSection.h"
27 | #import "FMLayoutBaseSection.h"
28 | #import "FMLayoutDynamicSection.h"
29 | #import "FMLayoutFillSection.h"
30 | #import "FMLayoutFixedSection.h"
31 | #import "FMLayoutLabelSection.h"
32 |
33 | FOUNDATION_EXPORT double FMLayoutKitVersionNumber;
34 | FOUNDATION_EXPORT const unsigned char FMLayoutKitVersionString[];
35 |
36 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutKit.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutKit.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/9.
6 | //
7 |
8 | #ifndef FMLayoutKit_h
9 | #define FMLayoutKit_h
10 |
11 | #import "FMTeslaLayoutView.h"
12 | #import "FMLayoutView.h"
13 | #import "FMLayout.h"
14 | #import "FMCollectionLayoutAttributes.h"
15 |
16 | #import "FMTeslaSuspensionHeightChangeDelegate.h"
17 |
18 | #import "FMLayoutFixedSection.h"
19 | #import "FMLayoutDynamicSection.h"
20 | #import "FMLayoutLabelSection.h"
21 | #import "FMLayoutFillSection.h"
22 | #import "FMLayoutAbsoluteSection.h"
23 | #import "FMLayoutCrossSection.h"
24 | #import "FMLayoutCrossTransformSection.h"
25 | #import "FMLayoutCombineSection.h"
26 | #import "FMLayoutScaleSection.h"
27 |
28 |
29 | #import "FMSupplementary.h"
30 | #import "FMLayoutHeader.h"
31 | #import "FMLayoutFooter.h"
32 | #import "FMLayoutBackground.h"
33 |
34 | #endif /* FMLayoutKit_h */
35 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutLabelSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutLabelSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 | #import "FMLayoutElement.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | ///返回cell大小的block
13 | typedef CGFloat(^FMLayoutItemWidthBlock)(id section, NSInteger item);
14 |
15 | ///当到第多少个的时候超出最大行 可移除数据处理 itemDatas会清理 否则frame为zero
16 | typedef CGFloat(^FMLayoutOverItemBlock)(id section, NSInteger item);
17 |
18 | ///标签式布局 根据文本伸缩布局 宽度不够 换行 适用于历史搜索记录 sku选择等样式
19 | @interface FMLayoutLabelSection : FMLayoutDynamicSection
20 | ///最大行数 超出讲不显示 纵向布局时生效
21 | @property(nonatomic, assign)NSInteger maxLine;
22 | ///cell固定的高度
23 | @property(nonatomic, assign)CGFloat cellFixedHeight;
24 | ///cell最大宽度 不设置的话 就是collection的宽度减去左右分组内边距
25 | @property(nonatomic, assign)CGFloat cellMaxWidth;
26 | ///block返回手动计算的宽度
27 | @property(nonatomic, copy)FMLayoutItemWidthBlock widthBlock;
28 | ///block返回手动计算的宽度
29 | @property(nonatomic, copy)FMLayoutOverItemBlock overItemBlock;
30 |
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutScaleSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutScaleSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/20.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | ///支持两种设置固定大小的方式 一种直接给数组sizeNums 一种给比例字符串scales 后设置的生效
12 | @interface FMLayoutScaleSection : FMLayoutDynamicSection
13 | /// 纵向布局 则是宽度比例 横向布局 则是高度比例 例如纵向布局时该值为: 1:2:3 则就是3列 宽度比为剩下的值的比例 仅支持当前样式 可以是小数值 但不能为非数值类型
14 | @property(nonatomic, copy)NSString *scales;
15 | ///每一列的固定大小 如:@[@100, @200] 则表示两列 一个固定宽度为100 另外一列为200 共两列
16 | @property(nonatomic, strong)NSArray *sizeNums;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMLayoutView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutView.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FMLayout.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FMLayoutView : UICollectionView
15 | @property(nonatomic, weak)FMLayout *layout;
16 | ///重写了set get 目标指向->layout.sections
17 | @property(nonatomic)NSMutableArray *sections;
18 |
19 | @property(nonatomic, assign)BOOL reloadOlnyChanged;
20 | ///是否允许长按拖拽排序 不支持夸分组 分组需要开启canLongPressExchange才可以移动拖拽排序
21 | @property(nonatomic, assign)BOOL enableLongPressDrag;
22 | ///长按拖拽开始时配置cell显示的样式
23 | @property(nonatomic, copy)UIView *(^configureSourceView)(UICollectionViewCell *sourceCell);
24 | - (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout NS_UNAVAILABLE;
25 | - (instancetype)initHorizontal;
26 | - (instancetype)initHorizontalWithFrame:(CGRect)frame;
27 | /// 循环遍历出更改过的sections 如果有过增删分组 请使用原有的reloadData方法
28 | - (void)reloadChangedSectionsData;
29 | ///获取到滚动到indexPath位置偏移量 如果获取到的不准确 请先调用layoutIfNeeded方法
30 | - (CGPoint)contentOffsetScrollToIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition;
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMSupplementary.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMSupplementary.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutElement.h"
10 |
11 | typedef NS_ENUM(NSInteger, FMLayoutZIndex) {
12 | ///最底层 头部 底部 Item的下方
13 | FMLayoutZIndexBg = -9999,
14 | ///Item的下方
15 | FMLayoutZIndexBackOfItem = -1,
16 | /// 自动悬浮可能会被覆盖
17 | FMLayoutZIndexAuto = 0,
18 | /// Item的上方
19 | FMLayoutZIndexFrontOfItem = 1,
20 | /// 最最上方
21 | FMLayoutZIndexFrontAlways = 9999
22 | };
23 |
24 | NS_ASSUME_NONNULL_BEGIN
25 | /// 请使用子类Footer, Header, Background
26 | @interface FMSupplementary : FMLayoutElement
27 | ///该Element的大小 纵向-高度 横向-宽度
28 | @property(nonatomic, assign)CGFloat size;
29 | ///视图层级 最上方还是最下方等
30 | @property(nonatomic, assign)FMLayoutZIndex zIndex;
31 | ///内边距 HeaderFooter受sectionInset影响 Background不受sectionInset影响
32 | @property(nonatomic, assign)UIEdgeInsets inset;
33 | ///Element类型 Header Footer Background等
34 | @property(nonatomic, copy, readonly)NSString *elementKind;
35 | ///是否自适应高度 仅当垂直布局时可用
36 | @property(nonatomic, assign)BOOL autoHeight;
37 | @property(nonatomic, copy)void(^configureDataAutoHeight)(UICollectionReusableView *view);
38 |
39 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass;
40 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib;
41 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
42 |
43 | - (UICollectionReusableView *)dequeueReusableViewWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath;
44 |
45 | - (void)updateHeightWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath maxWidth:(CGFloat)maxWidth;
46 | @end
47 |
48 | NS_ASSUME_NONNULL_END
49 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMTeslaLayoutView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMTeslaLayoutView.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @class FMLayoutView, FMTeslaLayoutView, FMLayoutBaseSection;
13 | @protocol FMTeslaLayoutViewDelegate
14 | @optional
15 | ///滚动结束事件
16 | - (void)tesla:(FMTeslaLayoutView *)tesla didScrollEnd:(NSInteger)index currentScrollView:(UIScrollView *)scrollView;
17 | ///滚动事件
18 | - (void)tesla:(FMTeslaLayoutView *)tesla scrollViewDidScroll:(UIScrollView *)scrollView;
19 | /// 当前上下滚动的事件
20 | - (void)tesla:(FMTeslaLayoutView *)tesla currentScrollViewScrollDidScroll:(UIScrollView *)currentScrollView contentOffset:(CGPoint)contentOffset;
21 |
22 | /// 配置FMCollectionLayoutView
23 | ///2
24 | - (void)tesla:(FMTeslaLayoutView *)tesla currentShowScrollView:(UIScrollView *)scrollView index:(NSInteger)index;
25 |
26 | ///0 即将根据Index创建FMCollectionLayoutView
27 | - (void)tesla:(FMTeslaLayoutView *)tesla willCreateScrollViewWithIndex:(NSInteger)index;
28 |
29 | ///0.5 根据Index自己创建FMCollectionLayoutView shareHeight为共享头部的高度 请将shareHeight顶部空出来并且请保持不使用contentInset 如果返回nil会自动创建FMLayoutView
30 | - (UIScrollView *)tesla:(FMTeslaLayoutView *)tesla customCreateWithIndex:(NSInteger)index shareHeight:(CGFloat)shareHeight;
31 |
32 | ///1 根据Index创建完毕UIScrollView
33 | - (void)tesla:(FMTeslaLayoutView *)tesla didCreatedScrollViewWithIndex:(NSInteger)index scrollView:(UIScrollView *)scrollView;
34 |
35 | /// 悬停标签控制view的尺寸最小高度 可以留着做效果
36 | - (CGFloat)shareSuspensionMinHeightWithTesla:(FMTeslaLayoutView *)tesla;
37 | @end
38 |
39 | @protocol FMTeslaLayoutViewDataSource
40 | @required
41 | - (NSInteger)numberOfScreenInTesla:(FMTeslaLayoutView *)tesla;
42 | @optional
43 | - (NSArray *)shareSectionsInTesla:(FMTeslaLayoutView *)tesla;
44 | @end
45 |
46 | @class FMLayoutBaseSection;
47 | @interface FMTeslaLayoutView : UIView
48 | @property(nonatomic, weak)id delegate;
49 | @property(nonatomic, weak)id dataSource;
50 | @property(nonatomic, assign)BOOL horizontalCanScroll;
51 | @property(nonatomic, assign)BOOL allShareStickTop;
52 | @property(nonatomic, assign)NSInteger selectIndex;
53 |
54 | @property(nonatomic, assign)BOOL isLoadSubView;
55 | @property(nonatomic, assign)CGFloat shareHeight;
56 |
57 | @property(nonatomic, strong, readonly)FMLayoutView *shareLayoutView;
58 |
59 | - (void)reLoadSubViews;
60 | - (void)reloadData;
61 | - (void)reloadDataWithIndex:(NSInteger)index;
62 | - (void)scrollToIndex:(NSInteger)index animated:(BOOL)animated;
63 | @end
64 |
65 | NS_ASSUME_NONNULL_END
66 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Headers/FMTeslaSuspensionHeightChangeDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMTeslaSuspensionHeightChangeDelegate.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/5/13.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @protocol FMTeslaSuspensionHeightChangeDelegate
13 |
14 | - (void)teslaSuspensionHeaderShouldShowHeight:(CGFloat)showHeight;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Info.plist
--------------------------------------------------------------------------------
/Example/FrameworkTmp/Release-iphonesimulator/FMLayoutKit/FMLayoutKit.framework/Modules/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module FMLayoutKit {
2 | umbrella header "FMLayoutKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 |
3 | platform :ios, '8.0'
4 |
5 | target 'FMLayoutKit_Example' do
6 | pod 'FMLayoutKit', :path => '../'
7 | pod 'Masonry'
8 | # pod 'MJRefresh'
9 | target 'FMLayoutKit_Tests' do
10 | inherit! :search_paths
11 |
12 |
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - FMLayoutKit (1.0.0)
3 | - Masonry (1.1.0)
4 |
5 | DEPENDENCIES:
6 | - FMLayoutKit (from `../`)
7 | - Masonry
8 |
9 | SPEC REPOS:
10 | trunk:
11 | - Masonry
12 |
13 | EXTERNAL SOURCES:
14 | FMLayoutKit:
15 | :path: "../"
16 |
17 | SPEC CHECKSUMS:
18 | FMLayoutKit: a1a31da0553b5ba4495248f6d358f0bdef35fa42
19 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
20 |
21 | PODFILE CHECKSUM: 473644c3c9d50e7e58f390f6ac2779d3691a1772
22 |
23 | COCOAPODS: 1.9.2
24 |
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/FMLayoutKit.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "FMLayoutKit",
3 | "version": "1.0.0",
4 | "summary": "A short description of FMLayoutKit.",
5 | "description": "TODO: Add long description of the pod here.",
6 | "homepage": "https://github.com/Coder_FM/FMLayoutKit",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "Coder_FM": "zhoufaming251@163.com"
13 | },
14 | "source": {
15 | "git": "https://github.com/Coder_FM/FMLayoutKit.git",
16 | "tag": "1.0.0"
17 | },
18 | "platforms": {
19 | "ios": "8.0"
20 | },
21 | "source_files": "FMLayoutKit/Classes/**/*"
22 | }
23 |
--------------------------------------------------------------------------------
/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - FMLayoutKit (1.0.0)
3 | - Masonry (1.1.0)
4 |
5 | DEPENDENCIES:
6 | - FMLayoutKit (from `../`)
7 | - Masonry
8 |
9 | SPEC REPOS:
10 | trunk:
11 | - Masonry
12 |
13 | EXTERNAL SOURCES:
14 | FMLayoutKit:
15 | :path: "../"
16 |
17 | SPEC CHECKSUMS:
18 | FMLayoutKit: a1a31da0553b5ba4495248f6d358f0bdef35fa42
19 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
20 |
21 | PODFILE CHECKSUM: 473644c3c9d50e7e58f390f6ac2779d3691a1772
22 |
23 | COCOAPODS: 1.9.2
24 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASCompositeConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASCompositeConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 | #import "MASUtilities.h"
11 |
12 | /**
13 | * A group of MASConstraint objects
14 | */
15 | @interface MASCompositeConstraint : MASConstraint
16 |
17 | /**
18 | * Creates a composite with a predefined array of children
19 | *
20 | * @param children child MASConstraints
21 | *
22 | * @return a composite constraint
23 | */
24 | - (id)initWithChildren:(NSArray *)children;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASConstraint+Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraint+Private.h
3 | // Masonry
4 | //
5 | // Created by Nick Tymchenko on 29/04/14.
6 | // Copyright (c) 2014 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 |
11 | @protocol MASConstraintDelegate;
12 |
13 |
14 | @interface MASConstraint ()
15 |
16 | /**
17 | * Whether or not to check for an existing constraint instead of adding constraint
18 | */
19 | @property (nonatomic, assign) BOOL updateExisting;
20 |
21 | /**
22 | * Usually MASConstraintMaker but could be a parent MASConstraint
23 | */
24 | @property (nonatomic, weak) id delegate;
25 |
26 | /**
27 | * Based on a provided value type, is equal to calling:
28 | * NSNumber - setOffset:
29 | * NSValue with CGPoint - setPointOffset:
30 | * NSValue with CGSize - setSizeOffset:
31 | * NSValue with MASEdgeInsets - setInsets:
32 | */
33 | - (void)setLayoutConstantWithValue:(NSValue *)value;
34 |
35 | @end
36 |
37 |
38 | @interface MASConstraint (Abstract)
39 |
40 | /**
41 | * Sets the constraint relation to given NSLayoutRelation
42 | * returns a block which accepts one of the following:
43 | * MASViewAttribute, UIView, NSValue, NSArray
44 | * see readme for more details.
45 | */
46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation;
47 |
48 | /**
49 | * Override to set a custom chaining behaviour
50 | */
51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
52 |
53 | @end
54 |
55 |
56 | @protocol MASConstraintDelegate
57 |
58 | /**
59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example
60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks
61 | */
62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint;
63 |
64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASLayoutConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASLayoutConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * When you are debugging or printing the constraints attached to a view this subclass
13 | * makes it easier to identify which constraints have been created via Masonry
14 | */
15 | @interface MASLayoutConstraint : NSLayoutConstraint
16 |
17 | /**
18 | * a key to associate with this constraint
19 | */
20 | @property (nonatomic, strong) id mas_key;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASLayoutConstraint.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASLayoutConstraint.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASLayoutConstraint.h"
10 |
11 | @implementation MASLayoutConstraint
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASViewAttribute.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASViewAttribute.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * An immutable tuple which stores the view and the related NSLayoutAttribute.
13 | * Describes part of either the left or right hand side of a constraint equation
14 | */
15 | @interface MASViewAttribute : NSObject
16 |
17 | /**
18 | * The view which the reciever relates to. Can be nil if item is not a view.
19 | */
20 | @property (nonatomic, weak, readonly) MAS_VIEW *view;
21 |
22 | /**
23 | * The item which the reciever relates to.
24 | */
25 | @property (nonatomic, weak, readonly) id item;
26 |
27 | /**
28 | * The attribute which the reciever relates to
29 | */
30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute;
31 |
32 | /**
33 | * Convenience initializer.
34 | */
35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute;
36 |
37 | /**
38 | * The designated initializer.
39 | */
40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute;
41 |
42 | /**
43 | * Determine whether the layoutAttribute is a size attribute
44 | *
45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight
46 | */
47 | - (BOOL)isSizeAttribute;
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASViewAttribute.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASViewAttribute.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASViewAttribute.h"
10 |
11 | @implementation MASViewAttribute
12 |
13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute {
14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute];
15 | return self;
16 | }
17 |
18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute {
19 | self = [super init];
20 | if (!self) return nil;
21 |
22 | _view = view;
23 | _item = item;
24 | _layoutAttribute = layoutAttribute;
25 |
26 | return self;
27 | }
28 |
29 | - (BOOL)isSizeAttribute {
30 | return self.layoutAttribute == NSLayoutAttributeWidth
31 | || self.layoutAttribute == NSLayoutAttributeHeight;
32 | }
33 |
34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute {
35 | if ([viewAttribute isKindOfClass:self.class]) {
36 | return self.view == viewAttribute.view
37 | && self.layoutAttribute == viewAttribute.layoutAttribute;
38 | }
39 | return [super isEqual:viewAttribute];
40 | }
41 |
42 | - (NSUInteger)hash {
43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute;
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASViewConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASViewConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASViewAttribute.h"
10 | #import "MASConstraint.h"
11 | #import "MASLayoutConstraint.h"
12 | #import "MASUtilities.h"
13 |
14 | /**
15 | * A single constraint.
16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view
17 | */
18 | @interface MASViewConstraint : MASConstraint
19 |
20 | /**
21 | * First item/view and first attribute of the NSLayoutConstraint
22 | */
23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute;
24 |
25 | /**
26 | * Second item/view and second attribute of the NSLayoutConstraint
27 | */
28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute;
29 |
30 | /**
31 | * initialises the MASViewConstraint with the first part of the equation
32 | *
33 | * @param firstViewAttribute view.mas_left, view.mas_width etc.
34 | *
35 | * @return a new view constraint
36 | */
37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute;
38 |
39 | /**
40 | * Returns all MASViewConstraints installed with this view as a first item.
41 | *
42 | * @param view A view to retrieve constraints for.
43 | *
44 | * @return An array of MASViewConstraints.
45 | */
46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view;
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/Masonry.h:
--------------------------------------------------------------------------------
1 | //
2 | // Masonry.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for Masonry.
12 | FOUNDATION_EXPORT double MasonryVersionNumber;
13 |
14 | //! Project version string for Masonry.
15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
16 |
17 | #import "MASUtilities.h"
18 | #import "View+MASAdditions.h"
19 | #import "View+MASShorthandAdditions.h"
20 | #import "ViewController+MASAdditions.h"
21 | #import "NSArray+MASAdditions.h"
22 | #import "NSArray+MASShorthandAdditions.h"
23 | #import "MASConstraint.h"
24 | #import "MASCompositeConstraint.h"
25 | #import "MASViewAttribute.h"
26 | #import "MASViewConstraint.h"
27 | #import "MASConstraintMaker.h"
28 | #import "MASLayoutConstraint.h"
29 | #import "NSLayoutConstraint+MASDebugAdditions.h"
30 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/NSArray+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASAdditions.h
3 | //
4 | //
5 | // Created by Daniel Hammond on 11/26/13.
6 | //
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | typedef NS_ENUM(NSUInteger, MASAxisType) {
14 | MASAxisTypeHorizontal,
15 | MASAxisTypeVertical
16 | };
17 |
18 | @interface NSArray (MASAdditions)
19 |
20 | /**
21 | * Creates a MASConstraintMaker with each view in the callee.
22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view
23 | *
24 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
25 | *
26 | * @return Array of created MASConstraints
27 | */
28 | - (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block;
29 |
30 | /**
31 | * Creates a MASConstraintMaker with each view in the callee.
32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
33 | * If an existing constraint exists then it will be updated instead.
34 | *
35 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
36 | *
37 | * @return Array of created/updated MASConstraints
38 | */
39 | - (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block;
40 |
41 | /**
42 | * Creates a MASConstraintMaker with each view in the callee.
43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
44 | * All constraints previously installed for the views will be removed.
45 | *
46 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
47 | *
48 | * @return Array of created/updated MASConstraints
49 | */
50 | - (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block;
51 |
52 | /**
53 | * distribute with fixed spacing
54 | *
55 | * @param axisType which axis to distribute items along
56 | * @param fixedSpacing the spacing between each item
57 | * @param leadSpacing the spacing before the first item and the container
58 | * @param tailSpacing the spacing after the last item and the container
59 | */
60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing;
61 |
62 | /**
63 | * distribute with fixed item size
64 | *
65 | * @param axisType which axis to distribute items along
66 | * @param fixedItemLength the fixed length of each item
67 | * @param leadSpacing the spacing before the first item and the container
68 | * @param tailSpacing the spacing after the last item and the container
69 | */
70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing;
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASShorthandAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 22/07/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "NSArray+MASAdditions.h"
10 |
11 | #ifdef MAS_SHORTHAND
12 |
13 | /**
14 | * Shorthand array additions without the 'mas_' prefixes,
15 | * only enabled if MAS_SHORTHAND is defined
16 | */
17 | @interface NSArray (MASShorthandAdditions)
18 |
19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block;
20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block;
21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block;
22 |
23 | @end
24 |
25 | @implementation NSArray (MASShorthandAdditions)
26 |
27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block {
28 | return [self mas_makeConstraints:block];
29 | }
30 |
31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block {
32 | return [self mas_updateConstraints:block];
33 | }
34 |
35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block {
36 | return [self mas_remakeConstraints:block];
37 | }
38 |
39 | @end
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSLayoutConstraint+MASDebugAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * makes debug and log output of NSLayoutConstraints more readable
13 | */
14 | @interface NSLayoutConstraint (MASDebugAdditions)
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+MASAdditions.h
3 | // Masonry
4 | //
5 | // Created by Craig Siemens on 2015-06-23.
6 | //
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | #ifdef MAS_VIEW_CONTROLLER
14 |
15 | @interface MAS_VIEW_CONTROLLER (MASAdditions)
16 |
17 | /**
18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute
19 | */
20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide;
21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide;
22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom;
26 |
27 |
28 | @end
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+MASAdditions.m
3 | // Masonry
4 | //
5 | // Created by Craig Siemens on 2015-06-23.
6 | //
7 | //
8 |
9 | #import "ViewController+MASAdditions.h"
10 |
11 | #ifdef MAS_VIEW_CONTROLLER
12 |
13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions)
14 |
15 | - (MASViewAttribute *)mas_topLayoutGuide {
16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
17 | }
18 | - (MASViewAttribute *)mas_topLayoutGuideTop {
19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop];
20 | }
21 | - (MASViewAttribute *)mas_topLayoutGuideBottom {
22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
23 | }
24 |
25 | - (MASViewAttribute *)mas_bottomLayoutGuide {
26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
27 | }
28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop {
29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
30 | }
31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom {
32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
33 | }
34 |
35 |
36 |
37 | @end
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/FMLayoutKit/FMLayoutKit-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/FMLayoutKit/FMLayoutKit-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_FMLayoutKit : NSObject
3 | @end
4 | @implementation PodsDummy_FMLayoutKit
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/FMLayoutKit/FMLayoutKit-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/FMLayoutKit/FMLayoutKit-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "FMLayoutBackground.h"
14 | #import "FMLayoutElement.h"
15 | #import "FMLayoutFooter.h"
16 | #import "FMLayoutHeader.h"
17 | #import "FMSupplementary.h"
18 | #import "FMCollectionLayoutAttributes.h"
19 | #import "FMKVOArrayObject.h"
20 | #import "FMLayout.h"
21 | #import "FMLayoutView.h"
22 | #import "FMTeslaLayoutView.h"
23 | #import "FMTeslaSuspensionHeightChangeDelegate.h"
24 |
25 | #import "FMLayoutCrossSection.h"
26 | #import "FMLayoutAbsoluteSection.h"
27 | #import "FMLayoutBaseSection.h"
28 | #import "FMLayoutDynamicSection.h"
29 | #import "FMLayoutFillSection.h"
30 | #import "FMLayoutFixedSection.h"
31 | #import "FMLayoutLabelSection.h"
32 |
33 | FOUNDATION_EXPORT double FMLayoutKitVersionNumber;
34 | FOUNDATION_EXPORT const unsigned char FMLayoutKitVersionString[];
35 |
36 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/FMLayoutKit/FMLayoutKit.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | PODS_BUILD_DIR = ${BUILD_DIR}
4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
5 | PODS_ROOT = ${SRCROOT}
6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
8 | SKIP_INSTALL = YES
9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/FMLayoutKit/FMLayoutKit.modulemap:
--------------------------------------------------------------------------------
1 | framework module FMLayoutKit {
2 | umbrella header "FMLayoutKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/FMLayoutKit/FMLayoutKit.release.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | PODS_BUILD_DIR = ${BUILD_DIR}
4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
5 | PODS_ROOT = ${SRCROOT}
6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
8 | SKIP_INSTALL = YES
9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Masonry : NSObject
3 | @end
4 | @implementation PodsDummy_Masonry
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "MASCompositeConstraint.h"
14 | #import "MASConstraint+Private.h"
15 | #import "MASConstraint.h"
16 | #import "MASConstraintMaker.h"
17 | #import "MASLayoutConstraint.h"
18 | #import "Masonry.h"
19 | #import "MASUtilities.h"
20 | #import "MASViewAttribute.h"
21 | #import "MASViewConstraint.h"
22 | #import "NSArray+MASAdditions.h"
23 | #import "NSArray+MASShorthandAdditions.h"
24 | #import "NSLayoutConstraint+MASDebugAdditions.h"
25 | #import "View+MASAdditions.h"
26 | #import "View+MASShorthandAdditions.h"
27 | #import "ViewController+MASAdditions.h"
28 |
29 | FOUNDATION_EXPORT double MasonryVersionNumber;
30 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
31 |
32 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry.modulemap:
--------------------------------------------------------------------------------
1 | framework module Masonry {
2 | umbrella header "Masonry-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry.release.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## FMLayoutKit
5 |
6 | Copyright (c) 2020 zhoufaming251@163.com
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 |
26 |
27 | ## Masonry
28 |
29 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
30 |
31 | Permission is hereby granted, free of charge, to any person obtaining a copy
32 | of this software and associated documentation files (the "Software"), to deal
33 | in the Software without restriction, including without limitation the rights
34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35 | copies of the Software, and to permit persons to whom the Software is
36 | furnished to do so, subject to the following conditions:
37 |
38 | The above copyright notice and this permission notice shall be included in
39 | all copies or substantial portions of the Software.
40 |
41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
47 | THE SOFTWARE.
48 | Generated by CocoaPods - https://cocoapods.org
49 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_FMLayoutKit_Example : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_FMLayoutKit_Example
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_FMLayoutKit_ExampleVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_FMLayoutKit_ExampleVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit/FMLayoutKit.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -framework "FMLayoutKit" -framework "Foundation" -framework "Masonry" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_FMLayoutKit_Example {
2 | umbrella header "Pods-FMLayoutKit_Example-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Example/Pods-FMLayoutKit_Example.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit/FMLayoutKit.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -framework "FMLayoutKit" -framework "Foundation" -framework "Masonry" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_FMLayoutKit_Tests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_FMLayoutKit_Tests
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_FMLayoutKit_TestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_FMLayoutKit_TestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit/FMLayoutKit.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | OTHER_LDFLAGS = $(inherited) -framework "FMLayoutKit" -framework "Foundation" -framework "Masonry" -framework "UIKit"
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
8 | PODS_ROOT = ${SRCROOT}/Pods
9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_FMLayoutKit_Tests {
2 | umbrella header "Pods-FMLayoutKit_Tests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-FMLayoutKit_Tests/Pods-FMLayoutKit_Tests.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FMLayoutKit/FMLayoutKit.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | OTHER_LDFLAGS = $(inherited) -framework "FMLayoutKit" -framework "Foundation" -framework "Masonry" -framework "UIKit"
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
8 | PODS_ROOT = ${SRCROOT}/Pods
9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
10 |
--------------------------------------------------------------------------------
/Example/Tests/Tests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Example/Tests/Tests-Prefix.pch:
--------------------------------------------------------------------------------
1 | // The contents of this file are implicitly included at the beginning of every test case source file.
2 |
3 | #ifdef __OBJC__
4 |
5 |
6 |
7 | #endif
8 |
--------------------------------------------------------------------------------
/Example/Tests/Tests.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutKitTests.m
3 | // FMLayoutKitTests
4 | //
5 | // Created by zhoufaming251@163.com on 06/09/2020.
6 | // Copyright (c) 2020 zhoufaming251@163.com. All rights reserved.
7 | //
8 |
9 | @import XCTest;
10 |
11 | @interface Tests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation Tests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
36 |
--------------------------------------------------------------------------------
/Example/Tests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/makeFramework.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 |
3 | #当前项目所在路径
4 | current_path=`pwd`
5 |
6 | #项目
7 | project_name='FMLayoutKit'
8 | #
9 | workspace_name=$project_name
10 |
11 | target_name=$project_name
12 |
13 | framework_config=Release
14 |
15 | #framework输出路径
16 | FRAMEWORK_TARGET_DIR=$current_path/${workspace_name}"Framework"
17 |
18 | #临时文件夹路径
19 | BUILD_DIR_TMP=$current_path/'FrameworkTmp'
20 |
21 | echo "当前项目所在路径:$current_path"
22 | echo "临时文件夹:$BUILD_DIR_TMP"
23 | echo "framework输出路径:${FRAMEWORK_TARGET_DIR}"
24 |
25 | archiveWorkSpace(){
26 | #build之前清理文件
27 | xcodebuild clean -workspace ${workspace_name}.xcworkspace -scheme ${target_name}
28 | #模拟器build
29 | xcodebuild build -workspace ${workspace_name}.xcworkspace -scheme ${target_name} -configuration framework_config -sdk iphonesimulator SYMROOT=${BUILD_DIR_TMP}
30 | #真机build
31 | xcodebuild build -workspace ${workspace_name}.xcworkspace -scheme ${target_name} -configuration framework_config -sdk iphoneos SYMROOT=${BUILD_DIR_TMP}
32 | #OBJROOT=${BUILD_DIR_TMP} SYMROOT=${BUILD_DIR_TMP}
33 |
34 | #将模拟器中的framework复制出来
35 | cp -R ${BUILD_DIR_TMP}/${framework_config}-iphonesimulator/${workspace_name}/${workspace_name}.framework ${FRAMEWORK_TARGET_DIR}
36 |
37 | #从模拟器中移除arm64架构
38 | lipo ${BUILD_DIR_TMP}/${framework_config}-iphonesimulator/${workspace_name}/${workspace_name}.framework/${workspace_name} -remove arm64 -output ${BUILD_DIR_TMP}/${framework_config}-iphonesimulator/${workspace_name}/${workspace_name}.framework/${workspace_name}
39 | #合并真机和模拟器文件并输出到构建的framework中
40 | lipo -create ${BUILD_DIR_TMP}/${framework_config}-iphonesimulator/${workspace_name}/${workspace_name}.framework/${workspace_name} ${BUILD_DIR_TMP}/${framework_config}-iphoneos/${workspace_name}/${workspace_name}.framework/${workspace_name} -output ${FRAMEWORK_TARGET_DIR}/${workspace_name}.framework/${workspace_name}
41 |
42 | #删除无用的三方bundle
43 | find ${FRAMEWORK_TARGET_DIR}/${workspace_name}.framework -maxdepth 1 -name '*.bundle' -not -name "${workspace_name}*.bundle" | xargs rm -rf
44 | #自动打开文件夹
45 | open $FRAMEWORK_TARGET_DIR
46 | }
47 |
48 | makeFramework(){
49 | #判断临时文件夹是否存在,存在的话先删除
50 | if [ -d $BUILD_DIR_TMP ];then
51 | rm -rf $BUILD_DIR_TMP
52 | fi
53 | # 判断输出文件夹是否存在,存在的话先删除
54 | if [ -d ${FRAMEWORK_TARGET_DIR} ];then
55 | rm -rf ${FRAMEWORK_TARGET_DIR}
56 | fi
57 |
58 | #创建临时文件夹
59 | mkdir -p ${BUILD_DIR_TMP}
60 | #创建输出文件夹
61 | mkdir -p ${FRAMEWORK_TARGET_DIR}
62 |
63 | archiveWorkSpace
64 |
65 | rm -rf $BUILD_DIR_TMP
66 | }
67 |
68 | makeFramework
69 |
70 |
--------------------------------------------------------------------------------
/FMLayoutKit.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint FMLayoutKit.podspec' to ensure this is a
3 | # valid spec before submitting.
4 | #
5 | # Any lines starting with a # are optional, but their use is encouraged
6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
7 | #
8 |
9 | Pod::Spec.new do |s|
10 | s.name = 'FMLayoutKit'
11 | s.version = '1.2.0'
12 | s.summary = 'A short description of FMLayoutKit.'
13 |
14 | # This description is used to generate tags and improve search results.
15 | # * Think: What does it do? Why did you write it? What is the focus?
16 | # * Try to keep it short, snappy and to the point.
17 | # * Write the description between the DESC delimiters below.
18 | # * Finally, don't worry about the indent, CocoaPods strips it!
19 |
20 | s.description = <<-DESC
21 | TODO: Add long description of the pod here.
22 | DESC
23 |
24 | s.homepage = 'https://github.com/CoderFM/FMLayoutKit'
25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
26 | s.license = { :type => 'MIT', :file => 'LICENSE' }
27 | s.author = { 'CoderFM' => 'zhoufaming251@163.com' }
28 | s.source = { :git => 'https://github.com/CoderFM/FMLayoutKit.git', :tag => s.version.to_s }
29 | # s.social_media_url = 'https://twitter.com/'
30 |
31 | s.ios.deployment_target = '8.0'
32 |
33 | s.source_files = 'FMLayoutKit/Classes/**/*'
34 |
35 | # s.resource_bundles = {
36 | # 'FMLayoutKit' => ['FMLayoutKit/Assets/*.png']
37 | # }
38 |
39 | # s.public_header_files = 'Pod/Classes/**/*.h'
40 | # s.frameworks = 'UIKit', 'MapKit'
41 | # s.dependency 'AFNetworking', '~> 2.3'
42 | end
43 |
--------------------------------------------------------------------------------
/FMLayoutKit/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/FMLayoutKit/Assets/.gitkeep
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/FMLayoutKit/Classes/.gitkeep
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Cross/FMLayoutCrossCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossCell.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | @class FMLayoutCrossSection;
12 | @interface FMLayoutCrossCell : UICollectionViewCell
13 | @property(nonatomic, strong)FMLayoutCrossSection *crossSection;
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Cross/FMLayoutCrossCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossCell.m
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import "FMLayoutCrossCell.h"
9 | #import "FMLayoutView.h"
10 | #import "FMLayoutCrossSection.h"
11 |
12 | @interface FMLayoutCrossCell()
13 | @property(nonatomic, weak)FMLayoutView *layoutView;
14 | @end
15 |
16 | @implementation FMLayoutCrossCell
17 |
18 | - (void)dealloc{
19 | FMLayoutLog(@"FMHorizontalCell dealloc");
20 | }
21 |
22 | - (FMLayoutView *)layoutView{
23 | if (_layoutView == nil) {
24 | FMLayoutView *view = [[FMLayoutView alloc] init];
25 | view.backgroundColor = [UIColor clearColor];
26 | [self.contentView addSubview:view];
27 | _layoutView = view;
28 | }
29 | return _layoutView;
30 | }
31 |
32 | - (instancetype)initWithFrame:(CGRect)frame
33 | {
34 | self = [super initWithFrame:frame];
35 | if (self) {
36 | self.layoutView.translatesAutoresizingMaskIntoConstraints = NO;
37 | NSLayoutConstraint *left = [NSLayoutConstraint constraintWithItem:self.layoutView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1 constant:0];
38 | NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:self.layoutView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1 constant:0];
39 | NSLayoutConstraint *top = [NSLayoutConstraint constraintWithItem:self.layoutView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1 constant:0];
40 | NSLayoutConstraint *bottom = [NSLayoutConstraint constraintWithItem:self.layoutView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1 constant:0];
41 | [self.contentView addConstraints:@[left,right,top,bottom]];
42 | }
43 | return self;
44 | }
45 |
46 | - (void)setCrossSection:(FMLayoutCrossSection *)crossSection{
47 | _crossSection = crossSection;
48 | self.layoutView.layout.direction = crossSection.crossDirection;
49 | self.layoutView.layout.sections = crossSection.sections;
50 | self.layoutView.delegate = crossSection;
51 | [self.layoutView reloadData];
52 | if (crossSection.configureCollectionView) {
53 | crossSection.configureCollectionView(self.layoutView, crossSection);
54 | }
55 | }
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Cross/FMLayoutCrossSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import "FMLayoutBaseSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | @interface FMLayoutCrossSection : FMLayoutBaseSection
12 | @property(nonatomic, assign, readonly)FMLayoutDirection crossDirection;
13 | /// 所有section计算获取最大的高度
14 | @property(nonatomic, assign)BOOL autoMaxSize;
15 | /// 所有section计算获取最大的高度
16 | @property(nonatomic, assign)CGFloat size;
17 | @property(nonatomic, assign)BOOL canReuseCell;
18 | @property(nonatomic, assign, readonly)CGFloat maxContentWidth;
19 |
20 | @property(nonatomic, strong)NSMutableArray *sections;
21 |
22 | @property(nonatomic, copy)void(^scrollDidScroll)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
23 | @property(nonatomic, copy)void(^configureCollectionView)(UICollectionView *collectionView, FMLayoutCrossSection *hSection);
24 |
25 | + (instancetype)sectionAutoWithSection:(FMLayoutBaseSection *)section;
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Cross/FMLayoutCrossTransformSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCrossTransformSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/15.
6 | //
7 |
8 | #import "FMLayoutCrossSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | typedef NS_ENUM(NSUInteger, FMLayoutCrossTransformType) {
13 | ///什么都不做
14 | FMLayoutCrossTransformNone,
15 | ///缩小0.9 + 0.1*进度
16 | FMLayoutCrossTransformScale,
17 | ///简拼App首页样式 M_PI_4 * 0.5 * 进度
18 | FMLayoutCrossTransformCrooked,
19 | ///折叠效果
20 | FMLayoutCrossTransformFold,
21 |
22 | };
23 | ///Cell是需要做处理的cell, progress是指cell中心点到屏幕边缘移动的进度 -1 ~ 1 0为在最中间 -1在左边 1在右边
24 | typedef void(^FMLayoutCrossTransformBlock)(UICollectionViewCell *cell, CGFloat progress);
25 |
26 | ///当前仅针对横向做适配 更多的动画
27 | @interface FMLayoutCrossTransformSection : FMLayoutCrossSection
28 | ///形变类型
29 | @property(nonatomic, assign)FMLayoutCrossTransformType transformType;
30 | ///如果有该Block 则优先执行此block
31 | @property(nonatomic, copy)FMLayoutCrossTransformBlock __nullable transformBlock;
32 |
33 | @end
34 |
35 | NS_ASSUME_NONNULL_END
36 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMLayoutBackground.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutBackground.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/27.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | static NSString *const UICollectionElementKindSectionBackground = @"UICollectionElementKindSectionBackground";
14 |
15 | @interface FMLayoutBackground : FMSupplementary
16 |
17 | + (instancetype)bgWithViewClass:(Class)viewClass;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMLayoutBackground.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutBackground.m
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/27.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutBackground.h"
10 |
11 | @implementation FMLayoutBackground
12 |
13 | - (NSString *)elementKind{
14 | return UICollectionElementKindSectionBackground;
15 | }
16 |
17 | + (instancetype)bgWithViewClass:(Class)viewClass{
18 | FMLayoutBackground *bg = [super elementWithViewClass:viewClass];
19 | bg.zIndex = FMLayoutZIndexBg;
20 | return bg;
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMLayoutElement.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutElement.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FMLayoutElement : NSObject
15 |
16 | @property(nonatomic, copy)NSString *reuseIdentifier;
17 | @property(nonatomic, assign)BOOL isNib;
18 | @property(nonatomic, weak)Class viewClass;///视图的类
19 |
20 | + (instancetype)elementWithViewClass:(Class)vCalss;
21 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib;
22 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
23 |
24 | - (void)registerElementWithCollection:(UICollectionView *)collectionView;
25 |
26 | @end
27 |
28 | NS_ASSUME_NONNULL_END
29 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMLayoutElement.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutElement.m
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutElement.h"
10 |
11 | @interface FMLayoutElement ()
12 |
13 | @end
14 |
15 | @implementation FMLayoutElement
16 |
17 | - (id)copyWithZone:(NSZone *)zone{
18 | FMLayoutElement *element = [[[self class] allocWithZone:zone] init];
19 | element.reuseIdentifier = self.reuseIdentifier;
20 | element.isNib = self.isNib;
21 | element.viewClass = self.viewClass;
22 | return element;
23 | }
24 |
25 | + (instancetype)elementWithViewClass:(Class)vCalss{
26 | return [self elementWithViewClass:vCalss isNib:NO];
27 | }
28 |
29 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib{
30 | return [self elementWithViewClass:vCalss isNib:isNib reuseIdentifier:NSStringFromClass(vCalss)];
31 | }
32 |
33 | + (instancetype)elementWithViewClass:(Class)vCalss isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier{
34 | FMLayoutElement *element = [[self alloc] init];
35 | element.viewClass = vCalss;
36 | element.isNib = isNib;
37 | element.reuseIdentifier = reuseIdentifier;
38 | return element;
39 | }
40 |
41 | - (void)registerElementWithCollection:(UICollectionView *)collectionView{
42 | if (self.isNib) {
43 | [collectionView registerNib:[UINib nibWithNibName:NSStringFromClass(self.viewClass) bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:self.reuseIdentifier];
44 | } else {
45 | [collectionView registerClass:self.viewClass forCellWithReuseIdentifier:self.reuseIdentifier];
46 | }
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMLayoutFooter.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFooter.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMLayoutFooter : FMSupplementary
14 | /// 距离最后Item的距离 纵向-上方 横向-左边
15 | @property(nonatomic, assign)CGFloat topMargin;
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMLayoutFooter.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFooter.m
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutFooter.h"
10 |
11 | @implementation FMLayoutFooter
12 |
13 | - (NSString *)elementKind{
14 | return UICollectionElementKindSectionFooter;
15 | }
16 |
17 | - (id)copyWithZone:(NSZone *)zone{
18 | FMLayoutFooter *footer = [super copyWithZone:zone];
19 | footer.topMargin = self.topMargin;
20 | return footer;
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMLayoutHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutHeader.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 | /// 悬浮方式
12 | typedef NS_ENUM(NSInteger, FMLayoutHeaderType) {
13 | ///跟着滚动
14 | FMLayoutHeaderTypeFixed,
15 | ///悬浮在顶部 跟着section动
16 | FMLayoutHeaderTypeSuspension,
17 | ///悬浮在顶部 不跟随section动 如果出现多个可能会被覆盖
18 | FMLayoutHeaderTypeSuspensionAlways,
19 | ///仅支持在第一个头部 下拉放大效果
20 | FMLayoutHeaderTypeSuspensionBigger
21 | };
22 |
23 | @interface FMLayoutHeader : FMSupplementary
24 | /// 显示方式 是悬浮 还是跟着滚动 默认跟着滚动
25 | @property(nonatomic, assign)FMLayoutHeaderType type;
26 | /// 悬浮模式时距离顶部的高度 可以来设置两个悬浮的方式 多个顶部悬浮时 可以通过这个来达到层叠悬浮的模式
27 | @property(nonatomic, assign)CGFloat suspensionTopMargin;
28 | /// 距离第一个Item的距离 纵向-下方 横向-右边
29 | @property(nonatomic, assign)CGFloat lastMargin;
30 | ///是否黏在顶部 目前仅支持FMLayoutHeaderTypeSuspensionAlways, FMLayoutHeaderTypeSuspensionBigger悬浮模式 不同的type效果不同 FMLayoutHeaderTypeSuspensionAlways是下拉黏在当前位置 上拉黏在顶部 而FMLayoutHeaderTypeSuspensionBiggers是上拉黏在顶部 下拉时放大效果
31 | @property(nonatomic, assign)BOOL isStickTop;
32 | /// 缩放模式(SuspensionBigger)下最小值 横向-宽度 纵向-高度 该值请务必小于size 默认是0
33 | @property(nonatomic, assign)CGFloat minSize;
34 | /// 缩放模式(SuspensionBigger)下最大值 横向-宽度 纵向-高度 该值请务必大于size 默认是CGFLOAT_MAX
35 | @property(nonatomic, assign)CGFloat maxSize;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMLayoutHeader.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutHeader.m
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutHeader.h"
10 |
11 | @implementation FMLayoutHeader
12 |
13 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier{
14 | FMLayoutHeader *header = [super elementSize:size viewClass:vClass isNib:isNib reuseIdentifier:reuseIdentifier];
15 | return header;
16 | }
17 |
18 | - (NSString *)elementKind{
19 | return UICollectionElementKindSectionHeader;
20 | }
21 |
22 | - (instancetype)init
23 | {
24 | self = [super init];
25 | if (self) {
26 | self.maxSize = CGFLOAT_MAX;
27 | }
28 | return self;
29 | }
30 |
31 | - (id)copyWithZone:(NSZone *)zone{
32 | FMLayoutHeader *header = [super copyWithZone:zone];
33 | header.lastMargin = self.lastMargin;
34 | header.type = self.type;
35 | header.suspensionTopMargin = self.suspensionTopMargin;
36 | header.isStickTop = self.isStickTop;
37 | header.minSize = self.minSize;
38 | header.maxSize = self.maxSize;
39 | return header;
40 | }
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMSupplementary.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMSupplementary.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutElement.h"
10 |
11 | typedef NS_ENUM(NSInteger, FMLayoutZIndex) {
12 | ///最底层 头部 底部 Item的下方
13 | FMLayoutZIndexBg = -9999,
14 | ///Item的下方
15 | FMLayoutZIndexBackOfItem = -1,
16 | /// 自动悬浮可能会被覆盖
17 | FMLayoutZIndexAuto = 0,
18 | /// Item的上方
19 | FMLayoutZIndexFrontOfItem = 1,
20 | /// 最最上方
21 | FMLayoutZIndexFrontAlways = 9999
22 | };
23 |
24 | NS_ASSUME_NONNULL_BEGIN
25 | /// 请使用子类Footer, Header, Background
26 | @interface FMSupplementary : FMLayoutElement
27 | ///该Element的大小 纵向-高度 横向-宽度
28 | @property(nonatomic, assign)CGFloat size;
29 | ///视图层级 最上方还是最下方等
30 | @property(nonatomic, assign)FMLayoutZIndex zIndex;
31 | ///内边距 HeaderFooter受sectionInset影响 Background不受sectionInset影响
32 | @property(nonatomic, assign)UIEdgeInsets inset;
33 | ///Element类型 Header Footer Background等
34 | @property(nonatomic, copy, readonly)NSString *elementKind;
35 | ///是否自适应高度 仅当垂直布局时可用
36 | @property(nonatomic, assign)BOOL autoHeight;
37 | @property(nonatomic, copy)void(^configureDataAutoHeight)(UICollectionReusableView *view);
38 |
39 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass;
40 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib;
41 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier;
42 |
43 | - (UICollectionReusableView *)dequeueReusableViewWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath;
44 |
45 | - (void)updateHeightWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath maxWidth:(CGFloat)maxWidth;
46 | @end
47 |
48 | NS_ASSUME_NONNULL_END
49 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Element/FMSupplementary.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMSupplementary.m
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/20.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMSupplementary.h"
10 |
11 | @interface FMSupplementary ()
12 |
13 | @end
14 |
15 | @implementation FMSupplementary
16 |
17 | - (id)copyWithZone:(NSZone *)zone{
18 | FMSupplementary *supp = [super copyWithZone:zone];
19 | supp.size = self.size;
20 | supp.zIndex = self.zIndex;
21 | supp.autoHeight = self.autoHeight;
22 | supp.configureDataAutoHeight = [self.configureDataAutoHeight copy];
23 | return supp;
24 | }
25 |
26 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass{
27 | return [self elementSize:size viewClass:vClass isNib:NO];
28 | }
29 |
30 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib{
31 | return [self elementSize:size viewClass:vClass isNib:isNib reuseIdentifier:NSStringFromClass(vClass)];
32 | }
33 |
34 | + (instancetype)elementSize:(CGFloat)size viewClass:(Class)vClass isNib:(BOOL)isNib reuseIdentifier:(NSString *)reuseIdentifier{
35 | FMSupplementary *dec = [super elementWithViewClass:vClass isNib:isNib reuseIdentifier:reuseIdentifier];
36 | dec.size = size;
37 | dec.zIndex = FMLayoutZIndexFrontOfItem;
38 | return dec;
39 | }
40 |
41 | - (void)registerElementWithCollection:(UICollectionView *)collectionView{
42 | if (self.isNib) {
43 | [collectionView registerNib:[UINib nibWithNibName:NSStringFromClass(self.viewClass) bundle:[NSBundle mainBundle]] forSupplementaryViewOfKind:self.elementKind withReuseIdentifier:self.reuseIdentifier];
44 | } else {
45 | [collectionView registerClass:self.viewClass forSupplementaryViewOfKind:self.elementKind withReuseIdentifier:self.reuseIdentifier];
46 | }
47 | }
48 |
49 | - (UICollectionReusableView *)dequeueReusableViewWithCollection:(UICollectionView *)collectionView indexPath:(nonnull NSIndexPath *)indexPath{
50 | return [collectionView dequeueReusableSupplementaryViewOfKind:self.elementKind withReuseIdentifier:self.reuseIdentifier forIndexPath:indexPath];
51 | }
52 |
53 | - (void)updateHeightWithCollection:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath maxWidth:(CGFloat)maxWidth{
54 | if (self.autoHeight) {
55 | UICollectionReusableView *view;
56 | if (self.isNib) {
57 | view = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.viewClass) owner:nil options:nil] lastObject];
58 | } else {
59 | view = [[self.viewClass alloc] init];
60 | }
61 | if (self.configureDataAutoHeight) {
62 | self.configureDataAutoHeight(view);
63 | }
64 | CGSize size = [view systemLayoutSizeFittingSize:CGSizeMake(maxWidth, MAXFLOAT)];
65 | self.size = size.height;
66 | }
67 | }
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMCollectionLayoutAttributes.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionLayoutAttributes.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/3/25.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FMLayoutBaseSection.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface FMCollectionLayoutAttributes : UICollectionViewLayoutAttributes
14 |
15 | @property(nonatomic, assign)FMLayoutDirection direction;
16 |
17 | + (instancetype)headerAttributesWithSection:(FMLayoutBaseSection *)section;
18 | - (instancetype)updateHeaderAttributesWithSection:(FMLayoutBaseSection *)section;
19 |
20 | + (instancetype)suspensionShowHeaderAttributes:(FMLayoutBaseSection *)section;
21 |
22 | + (instancetype)footerAttributesWithSection:(FMLayoutBaseSection *)section;
23 | - (instancetype)updateFooterAttributesWithSection:(FMLayoutBaseSection *)section;
24 |
25 | + (instancetype)bgAttributesWithSection:(FMLayoutBaseSection *)section;
26 | - (instancetype)updateBgAttributesWithSection:(FMLayoutBaseSection *)section;
27 |
28 | - (void)_onlyUpdateOffsetWith:(FMLayoutBaseSection *)section;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMCollectionViewDelegateDataSourceProvider.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMCollectionViewDelegateDataSourceProvider.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2021/3/27.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @class FMLayoutBaseSection;
13 | @interface FMCollectionViewDelegateDataSourceProvider : NSObject
14 |
15 | ///重写了set get 目标指向->layout.sections
16 | @property(nonatomic, strong)NSMutableArray *sections;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMKVOArrayObject.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMKVOArrayObject.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/5.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface FMKVOArrayObject : NSObject
13 |
14 | @property (strong,nonatomic)NSMutableArray *targetArray;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMKVOArrayObject.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMKVOArrayObject.m
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/5.
6 | //
7 |
8 | #import "FMKVOArrayObject.h"
9 | #import "FMLayoutDebugLog.h"
10 |
11 | @implementation FMKVOArrayObject
12 |
13 | - (void)dealloc{
14 | FMLayoutLog(@"FMKVOArrayObject dealloc");
15 | }
16 |
17 | - (instancetype)init
18 | {
19 | self = [super init];
20 | if (self) {
21 | self.targetArray = [NSMutableArray array];
22 | }
23 | return self;
24 | }
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayout.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/16.
6 | //
7 |
8 | #import
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutHeader.h"
11 | #import "FMLayoutFooter.h"
12 | #import "FMLayoutBackground.h"
13 | #import "FMCollectionLayoutAttributes.h"
14 |
15 | NS_ASSUME_NONNULL_BEGIN
16 |
17 | @interface FMLayout : UICollectionViewLayout
18 |
19 | @property(nonatomic, assign)FMLayoutDirection direction;
20 | @property(nonatomic, strong)NSMutableArray *sections;
21 | ///最后固定边距 跟section的inset无关 contentSize会自动加上去
22 | @property(nonatomic, assign)CGFloat fixedLastMargin;
23 | ///是否只计算改变的布局 NO为每一次 都是重新计算所有布局
24 | @property(nonatomic, assign)BOOL reLayoutOlnyChanged;
25 | ///最小可滑动的大小 横向-高度 纵向-宽度
26 | @property(nonatomic, assign)CGFloat minContentSize;
27 | ///第一个Section的偏移量
28 | @property(nonatomic, assign)CGFloat firstSectionOffset;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMLayoutDebugLog.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutDebugLog.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/17.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | extern void FMLayoutLog(NSString *format);
13 | extern void FMLayoutOpenLog(void);
14 | extern void FMLayoutCloseLog(void);
15 | extern NSInteger FMLayoutRandomValue(NSInteger start, NSInteger end);
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMLayoutDebugLog.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutDebugLog.m
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/17.
6 | //
7 |
8 | #import "FMLayoutDebugLog.h"
9 |
10 | BOOL FMLayoutDebugLogOpen = NO;
11 |
12 | void FMLayoutLog(NSString *format){
13 | #if DEBUG
14 | if (FMLayoutDebugLogOpen) {
15 | NSLog(@"%@", format);
16 | }
17 | #endif
18 | }
19 |
20 | void FMLayoutOpenLog(){
21 | FMLayoutDebugLogOpen = YES;
22 | }
23 |
24 | void FMLayoutCloseLog(){
25 | FMLayoutDebugLogOpen = NO;
26 | }
27 |
28 | NSInteger FMLayoutRandomValue(NSInteger start, NSInteger end){
29 | NSInteger value = (arc4random() % (end - start + 1)) + start;
30 | return value;
31 | }
32 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMLayoutKit.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutKit.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/6/9.
6 | //
7 |
8 | #ifndef FMLayoutKit_h
9 | #define FMLayoutKit_h
10 |
11 | #import "FMTeslaLayoutView.h"
12 | #import "FMLayoutView.h"
13 | #import "FMLayout.h"
14 | #import "FMCollectionLayoutAttributes.h"
15 |
16 | #import "FMTeslaSuspensionHeightChangeDelegate.h"
17 |
18 | #import "FMLayoutFixedSection.h"
19 | #import "FMLayoutDynamicSection.h"
20 | #import "FMLayoutLabelSection.h"
21 | #import "FMLayoutFillSection.h"
22 | #import "FMLayoutAbsoluteSection.h"
23 | #import "FMLayoutCrossSection.h"
24 | #import "FMLayoutCrossTransformSection.h"
25 | #import "FMLayoutCombineSection.h"
26 | #import "FMLayoutScaleSection.h"
27 |
28 |
29 | #import "FMSupplementary.h"
30 | #import "FMLayoutHeader.h"
31 | #import "FMLayoutFooter.h"
32 | #import "FMLayoutBackground.h"
33 |
34 | #endif /* FMLayoutKit_h */
35 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMLayoutView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutView.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FMLayout.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface FMLayoutView : UICollectionView
15 | @property(nonatomic, weak)FMLayout *layout;
16 | ///重写了set get 目标指向->layout.sections
17 | @property(nonatomic)NSMutableArray *sections;
18 |
19 | @property(nonatomic, assign)BOOL reloadOlnyChanged;
20 | ///是否允许长按拖拽排序 不支持夸分组 分组需要开启canLongPressExchange才可以移动拖拽排序
21 | @property(nonatomic, assign)BOOL enableLongPressDrag;
22 | ///长按拖拽开始时配置cell显示的样式
23 | @property(nonatomic, copy)UIView *(^configureSourceView)(UICollectionViewCell *sourceCell);
24 | - (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout NS_UNAVAILABLE;
25 | - (instancetype)initHorizontal;
26 | - (instancetype)initHorizontalWithFrame:(CGRect)frame;
27 | /// 循环遍历出更改过的sections 如果有过增删分组 请使用原有的reloadData方法
28 | - (void)reloadChangedSectionsData;
29 | ///获取到滚动到indexPath位置偏移量 如果获取到的不准确 请先调用layoutIfNeeded方法
30 | - (CGPoint)contentOffsetScrollToIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition;
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMTeslaLayoutView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMTeslaLayoutView.h
3 | // FMCollectionLayout_Example
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | // Copyright © 2020 周发明. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @class FMLayoutView, FMTeslaLayoutView, FMLayoutBaseSection;
13 | @protocol FMTeslaLayoutViewDelegate
14 | @optional
15 | ///滚动结束事件
16 | - (void)tesla:(FMTeslaLayoutView *)tesla didScrollEnd:(NSInteger)index currentScrollView:(UIScrollView *)scrollView;
17 | ///滚动事件
18 | - (void)tesla:(FMTeslaLayoutView *)tesla scrollViewDidScroll:(UIScrollView *)scrollView;
19 | /// 当前上下滚动的事件
20 | - (void)tesla:(FMTeslaLayoutView *)tesla currentScrollViewScrollDidScroll:(UIScrollView *)currentScrollView contentOffset:(CGPoint)contentOffset;
21 |
22 | /// 配置FMCollectionLayoutView
23 | ///2
24 | - (void)tesla:(FMTeslaLayoutView *)tesla currentShowScrollView:(UIScrollView *)scrollView index:(NSInteger)index;
25 |
26 | ///0 即将根据Index创建FMCollectionLayoutView
27 | - (void)tesla:(FMTeslaLayoutView *)tesla willCreateScrollViewWithIndex:(NSInteger)index;
28 |
29 | ///0.5 根据Index自己创建FMCollectionLayoutView shareHeight为共享头部的高度 请将shareHeight顶部空出来并且请保持不使用contentInset 如果返回nil会自动创建FMLayoutView
30 | - (UIScrollView *)tesla:(FMTeslaLayoutView *)tesla customCreateWithIndex:(NSInteger)index shareHeight:(CGFloat)shareHeight;
31 |
32 | ///1 根据Index创建完毕UIScrollView
33 | - (void)tesla:(FMTeslaLayoutView *)tesla didCreatedScrollViewWithIndex:(NSInteger)index scrollView:(UIScrollView *)scrollView;
34 |
35 | /// 悬停标签控制view的尺寸最小高度 可以留着做效果
36 | - (CGFloat)shareSuspensionMinHeightWithTesla:(FMTeslaLayoutView *)tesla;
37 | @end
38 |
39 | @protocol FMTeslaLayoutViewDataSource
40 | @required
41 | - (NSInteger)numberOfScreenInTesla:(FMTeslaLayoutView *)tesla;
42 | @optional
43 | - (NSArray *)shareSectionsInTesla:(FMTeslaLayoutView *)tesla;
44 | @end
45 |
46 | @class FMLayoutBaseSection;
47 | @interface FMTeslaLayoutView : UIView
48 | @property(nonatomic, weak)id delegate;
49 | @property(nonatomic, weak)id dataSource;
50 | @property(nonatomic, assign)BOOL horizontalCanScroll;
51 | @property(nonatomic, assign)BOOL allShareStickTop;
52 | @property(nonatomic, assign)NSInteger selectIndex;
53 |
54 | @property(nonatomic, assign)BOOL isLoadSubView;
55 | @property(nonatomic, assign)CGFloat shareHeight;
56 |
57 | @property(nonatomic, strong, readonly)FMLayoutView *shareLayoutView;
58 |
59 | - (void)reLoadSubViews;
60 | - (void)reloadData;
61 | - (void)reloadDataWithIndex:(NSInteger)index;
62 | - (void)scrollToIndex:(NSInteger)index animated:(BOOL)animated;
63 | @end
64 |
65 | NS_ASSUME_NONNULL_END
66 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/FMTeslaSuspensionHeightChangeDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMTeslaSuspensionHeightChangeDelegate.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/5/13.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 | @protocol FMTeslaSuspensionHeightChangeDelegate
13 |
14 | - (void)teslaSuspensionHeaderShouldShowHeight:(CGFloat)showHeight;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Sections/FMLayoutAbsoluteSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutAbsoluteSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/9.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | typedef CGRect(^FMLayoutBaseSectionItemFrameBlock)(id section, NSInteger item);
13 | ///支持纵向插横向
14 | @interface FMLayoutAbsoluteSection : FMLayoutDynamicSection
15 |
16 | @property(nonatomic, copy)FMLayoutBaseSectionItemFrameBlock frameBlock;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Sections/FMLayoutAbsoluteSection.m:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutAbsoluteSection.m
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/6/9.
6 | //
7 |
8 | #import "FMLayoutAbsoluteSection.h"
9 | #import "FMCollectionLayoutAttributes.h"
10 |
11 | @interface FMLayoutAbsoluteSection ()
12 |
13 | @property(nonatomic, assign)CGFloat maxSize;
14 |
15 | @end
16 |
17 | @implementation FMLayoutAbsoluteSection
18 |
19 | - (id)copyWithZone:(NSZone *)zone{
20 | FMLayoutAbsoluteSection *section = [super copyWithZone:zone];
21 | section.frameBlock = [self.frameBlock copy];
22 | return section;
23 | }
24 |
25 | - (void)prepareItems{
26 | self.maxSize = self.handleType == FMLayoutHandleTypeOlnyChangeOffset ? [self.columnSizes[@0] floatValue]:0;
27 | [super prepareItems];
28 | self.columnSizes[@0] = @(self.maxSize);
29 | }
30 |
31 | - (FMCollectionLayoutAttributes *)getItemAttributesWithIndex:(NSInteger)j{
32 | FMCollectionLayoutAttributes *itemAttr = [FMCollectionLayoutAttributes layoutAttributesForCellWithIndexPath:[NSIndexPath indexPathForItem:j inSection:self.indexPath.section]];
33 | CGRect frame = self.frameBlock?self.frameBlock(self, j): CGRectZero;
34 | frame.origin.y += self.firstItemStartY;
35 | frame.origin.x += self.firstItemStartX;
36 | itemAttr.frame = frame;
37 |
38 | if (self.direction == FMLayoutDirectionVertical) {
39 | if (self.maxSize < frame.origin.y + frame.size.height) {
40 | self.maxSize = frame.origin.y + frame.size.height;
41 | self.maxSize -= self.firstItemStartY;
42 | }
43 | } else {
44 | if (self.maxSize < frame.origin.x + frame.size.width) {
45 | self.maxSize = frame.origin.x + frame.size.width;
46 | self.maxSize -= self.firstItemStartX;
47 | }
48 | }
49 | return itemAttr;
50 | }
51 |
52 | - (CGFloat)crossSingleSectionSize{
53 | if (self.direction == FMLayoutDirectionHorizontal) {
54 | CGFloat maxSize = 0;
55 | for (int j = 0; j < self.itemCount; j++) {
56 | CGRect frame = self.frameBlock?self.frameBlock(self, j): CGRectZero;
57 | if (maxSize < frame.origin.y + frame.size.height) {
58 | maxSize = frame.origin.y + frame.size.height;
59 | }
60 | }
61 | return maxSize + self.sectionInset.top + self.sectionInset.bottom;
62 | } else {
63 | CGFloat maxSize = 0;
64 | for (int j = 0; j < self.itemCount; j++) {
65 | CGRect frame = self.frameBlock?self.frameBlock(self, j): CGRectZero;
66 | if (maxSize < frame.origin.x + frame.size.width) {
67 | maxSize = frame.origin.x + frame.size.width;
68 | }
69 | }
70 | return maxSize + self.sectionInset.left + self.sectionInset.right;
71 | }
72 | }
73 |
74 | @end
75 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Sections/FMLayoutCombineSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutCombineSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/12.
6 | //
7 |
8 | #import "FMLayoutBaseSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | ///可以将不同Cell, 不同的布局方式, 放到同一个分组去合并,只合并cell, 如果子分组有头部和底部讲被忽略,合并分组的头部与底部不影响配置, cell的点击事件已经在init方法中配置block分发到子分组上 合并分组不支持拖拽排序 想要支持 可以继承自该类重写canLongPressExchange的get方法 并实现- (void)exchangeObjectAtIndex:(NSInteger)index toIndex:(NSInteger)toIndex;
12 | @interface FMLayoutCombineSection : FMLayoutBaseSection
13 | @property(nonatomic, readonly)NSArray *subSections;
14 | + (instancetype)combineSections:(NSArray *)sections;
15 | - (void)appendSection:(FMLayoutBaseSection *)section;
16 | - (void)insetSection:(FMLayoutBaseSection *)section atIndex:(NSInteger)index;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Sections/FMLayoutDynamicSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutDynamicSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutElement.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | ///返回cell大小的block 横向-返回宽度 纵向-返回高度
14 | typedef CGFloat(^FMLayoutItemOtherBlock)(id section, NSInteger item);
15 | typedef CGFloat(^FMLayoutAutoHeightLaterBlock)(id section, NSInteger item, CGFloat autoHeight);
16 |
17 | ///动态 可以注册多种cell 宽度固定 高度可以自适应 但需要用block填充数据 需要设置deqCellReturnReuseId该block值以获取cell 高度亦可以通过手动计算heightBlock返回 手动计算优先级要高
18 | @interface FMLayoutDynamicSection : FMLayoutBaseSection
19 | /// yes时 布局耗时比较长 是否自动计算高度 需设置configurationCell方法填充数据 仅支持纵向布局时使用
20 | @property(nonatomic, assign)BOOL autoHeightFixedWidth;
21 | @property(nonatomic, copy)FMLayoutAutoHeightLaterBlock autoHeightLaterHander;
22 | ///cell固定一个方向的大小 纵向-宽度 横向-高度
23 | @property(nonatomic, assign)CGFloat cellFixedSize;
24 | ///需要注册的cell元素
25 | @property(nonatomic, strong)NSArray *cellElements;
26 | ///固定单一分组 当固定单一分组时 可以不用手动配置deqCellReturnReuseId
27 | @property(nonatomic, strong)FMLayoutElement *cellElement;
28 | ///获取cell的复用FMLayoutElement
29 | @property(nonatomic, copy)FMLayoutElement *(^deqCellReturnElement)(FMLayoutDynamicSection *section, NSInteger item);
30 | ///填充数据 仅当autoHeightFixedWidth为Yes时有用
31 | @property(nonatomic, copy)void(^configurationCell)(FMLayoutDynamicSection *section, UICollectionViewCell *cell, NSInteger item);
32 | ///block返回手动计算的高度 优先级比自动的高
33 | @property(nonatomic, copy)FMLayoutItemOtherBlock otherBlock;
34 |
35 | - (CGFloat)autoHeightVerticalWithWidth:(CGFloat)fixedWidth index:(NSInteger)index;
36 |
37 | @end
38 |
39 | NS_ASSUME_NONNULL_END
40 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Sections/FMLayoutFillSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFillSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/4/11.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | ///返回cell大小的block
13 | typedef CGSize(^FMLayoutItemSizeBlock)(id section, NSInteger item);
14 | ///支持纵向插横向 只可以上对齐以及左对齐
15 | @interface FMLayoutFillSection : FMLayoutDynamicSection
16 |
17 | @property(nonatomic, copy)FMLayoutItemSizeBlock sizeBlock;
18 |
19 | @end
20 |
21 | NS_ASSUME_NONNULL_END
22 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Sections/FMLayoutFixedSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutFixedSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 周发明 on 2020/4/1.
6 | // Copyright © 2020 ZhouFaMing. All rights reserved.
7 | //
8 |
9 | #import "FMLayoutBaseSection.h"
10 | #import "FMLayoutElement.h"
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | ///固定cell的大小 单一一种cell样式 支持同样cell是否可以横向滚动 内嵌collectionView 支持纵向插横向
14 | @interface FMLayoutFixedSection : FMLayoutBaseSection
15 |
16 | @property(nonatomic, assign)CGSize itemSize;///分组cell大小
17 |
18 | @property(nonatomic, strong)FMLayoutElement *cellElement;///固定分组
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Sections/FMLayoutLabelSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutLabelSection.h
3 | // FMCollectionLayout
4 | //
5 | // Created by 周发明 on 2020/4/8.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 | #import "FMLayoutElement.h"
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | ///返回cell大小的block
13 | typedef CGFloat(^FMLayoutItemWidthBlock)(id section, NSInteger item);
14 |
15 | ///当到第多少个的时候超出最大行 可移除数据处理 itemDatas会清理 否则frame为zero
16 | typedef CGFloat(^FMLayoutOverItemBlock)(id section, NSInteger item);
17 |
18 | ///标签式布局 根据文本伸缩布局 宽度不够 换行 适用于历史搜索记录 sku选择等样式
19 | @interface FMLayoutLabelSection : FMLayoutDynamicSection
20 | ///最大行数 超出讲不显示 纵向布局时生效
21 | @property(nonatomic, assign)NSInteger maxLine;
22 | ///cell固定的高度
23 | @property(nonatomic, assign)CGFloat cellFixedHeight;
24 | ///cell最大宽度 不设置的话 就是collection的宽度减去左右分组内边距
25 | @property(nonatomic, assign)CGFloat cellMaxWidth;
26 | ///block返回手动计算的宽度
27 | @property(nonatomic, copy)FMLayoutItemWidthBlock widthBlock;
28 | ///block返回手动计算的宽度
29 | @property(nonatomic, copy)FMLayoutOverItemBlock overItemBlock;
30 |
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/Sections/FMLayoutScaleSection.h:
--------------------------------------------------------------------------------
1 | //
2 | // FMLayoutScaleSection.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2020/7/20.
6 | //
7 |
8 | #import "FMLayoutDynamicSection.h"
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 | ///支持两种设置固定大小的方式 一种直接给数组sizeNums 一种给比例字符串scales 后设置的生效
12 | @interface FMLayoutScaleSection : FMLayoutDynamicSection
13 | /// 纵向布局 则是宽度比例 横向布局 则是高度比例 例如纵向布局时该值为: 1:2:3 则就是3列 宽度比为剩下的值的比例 仅支持当前样式 可以是小数值 但不能为非数值类型
14 | @property(nonatomic, copy)NSString *scales;
15 | ///每一列的固定大小 如:@[@100, @200] 则表示两列 一个固定宽度为100 另外一列为200 共两列
16 | @property(nonatomic, strong)NSArray *sizeNums;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/UIView+FMLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+FMLayout.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2021/3/27.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface UIView (FMLayout)
13 |
14 | - (UIView *)snapshotView;
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/UIView+FMLayout.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+FMLayout.m
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2021/3/27.
6 | //
7 |
8 | #import "UIView+FMLayout.h"
9 |
10 | @implementation UIView (FMLayout)
11 |
12 | - (UIView *)snapshotView{
13 | UIGraphicsBeginImageContextWithOptions(self.frame.size, NO, [UIScreen mainScreen].scale);
14 | CGContextRef context = UIGraphicsGetCurrentContext();
15 | [self.layer renderInContext:context];
16 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
17 | UIGraphicsEndImageContext();
18 | UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
19 |
20 | UIView *sourceView = [[UIView alloc] initWithFrame:self.frame];
21 | sourceView.layer.shadowColor = [UIColor darkGrayColor].CGColor;
22 | sourceView.layer.shadowOffset = CGSizeMake(0, 0);
23 | sourceView.layer.shadowOpacity = 0.7;
24 | [sourceView addSubview:imageView];
25 |
26 | imageView.translatesAutoresizingMaskIntoConstraints = NO;
27 | NSLayoutConstraint *left = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sourceView attribute:NSLayoutAttributeLeft multiplier:1 constant:0];
28 | NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:sourceView attribute:NSLayoutAttributeRight multiplier:1 constant:0];
29 | NSLayoutConstraint *top = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sourceView attribute:NSLayoutAttributeTop multiplier:1 constant:0];
30 | NSLayoutConstraint *bottom = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sourceView attribute:NSLayoutAttributeBottom multiplier:1 constant:0];
31 | [sourceView addConstraints:@[left,right,top,bottom]];
32 | return sourceView;
33 | }
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/_FMLayoutSussEmptyView.h:
--------------------------------------------------------------------------------
1 | //
2 | // _FMLayoutSussEmptyView.h
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2021/4/8.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface _FMLayoutSussEmptyView : UICollectionReusableView
13 |
14 | @end
15 |
16 | NS_ASSUME_NONNULL_END
17 |
--------------------------------------------------------------------------------
/FMLayoutKit/Classes/_FMLayoutSussEmptyView.m:
--------------------------------------------------------------------------------
1 | //
2 | // _FMLayoutSussEmptyView.m
3 | // FMLayoutKit
4 | //
5 | // Created by 郑桂华 on 2021/4/8.
6 | //
7 |
8 | #import "_FMLayoutSussEmptyView.h"
9 |
10 | @implementation _FMLayoutSussEmptyView
11 |
12 | - (instancetype)initWithFrame:(CGRect)frame
13 | {
14 | self = [super initWithFrame:frame];
15 | if (self) {
16 | self.hidden = YES;
17 | }
18 | return self;
19 | }
20 |
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/Jietu20200430-154528@2x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Jietu20200430-154528@2x.jpg
--------------------------------------------------------------------------------
/Jietu20200430-154538@2x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Jietu20200430-154538@2x.jpg
--------------------------------------------------------------------------------
/Jietu20200430-154610@2x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Jietu20200430-154610@2x.jpg
--------------------------------------------------------------------------------
/Jietu20200430-154705@2x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Jietu20200430-154705@2x.jpg
--------------------------------------------------------------------------------
/Jietu20200430-154718@2x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Jietu20200430-154718@2x.jpg
--------------------------------------------------------------------------------
/Jietu20200430-154732@2x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Jietu20200430-154732@2x.jpg
--------------------------------------------------------------------------------
/Jietu20200430-154739@2x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoderFM/FMLayoutKit/312f97d176cc092fb972f97c3022f5c0b69d201f/Jietu20200430-154739@2x.jpg
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2020 周发明
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------
/submitNewVersion.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | basePath=$(cd "$(dirname "$0")";pwd)
3 | cd $basePath
4 | pod repo push FMPodSpec FMLayoutKit.podspec --allow-warnings &&
5 | pod trunk push FMLayoutKit.podspec --allow-warnings
6 |
7 |
--------------------------------------------------------------------------------