Skip to content

Commit 36da7ca

Browse files
committed
优化部分代码
优化部分代码
1 parent 313beca commit 36da7ca

16 files changed

+360
-177
lines changed

collectionView.xcodeproj/project.pbxproj

+46-24
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
316638D11F945965008137BD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 316638D01F945965008137BD /* main.m */; };
2121
316638DB1F945966008137BD /* collectionViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 316638DA1F945966008137BD /* collectionViewTests.m */; };
2222
316638E61F945966008137BD /* collectionViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 316638E51F945966008137BD /* collectionViewUITests.m */; };
23-
316638F91F948478008137BD /* waterCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 316638F71F948478008137BD /* waterCollectionViewCell.m */; };
24-
316638FA1F948478008137BD /* waterCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 316638F81F948478008137BD /* waterCollectionViewCell.xib */; };
2523
316638FF1F948EEE008137BD /* WSLWaterFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 316638FE1F948EEE008137BD /* WSLWaterFlowLayout.m */; };
2624
317C217A21200400007EBF96 /* WSLWaterFlowHorizontalGrid.plist in Resources */ = {isa = PBXBuildFile; fileRef = 317C217921200400007EBF96 /* WSLWaterFlowHorizontalGrid.plist */; };
2725
31B6F2691FB0066C000D6A30 /* UIButton+WSLTitleImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 31B6F2681FB0066C000D6A30 /* UIButton+WSLTitleImage.m */; };
28-
31CFF0CF1F9749000078C991 /* CollectionHeaderAndFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 31CFF0CD1F9749000078C991 /* CollectionHeaderAndFooterView.m */; };
29-
31CFF0D01F9749000078C991 /* CollectionHeaderAndFooterView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 31CFF0CE1F9749000078C991 /* CollectionHeaderAndFooterView.xib */; };
26+
31EE0E4C215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 31EE0E47215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.m */; };
27+
31EE0E4D215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 31EE0E48215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.xib */; };
28+
31EE0E4E215E0EF1003DF8B7 /* waterCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 31EE0E4A215E0EF1003DF8B7 /* waterCollectionViewCell.m */; };
29+
31EE0E4F215E0EF1003DF8B7 /* waterCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 31EE0E4B215E0EF1003DF8B7 /* waterCollectionViewCell.xib */; };
30+
31EE0E53215E0F89003DF8B7 /* WSLFlowLayoutStyleOne.m in Sources */ = {isa = PBXBuildFile; fileRef = 31EE0E52215E0F89003DF8B7 /* WSLFlowLayoutStyleOne.m */; };
3031
/* End PBXBuildFile section */
3132

3233
/* Begin PBXContainerItemProxy section */
@@ -68,17 +69,19 @@
6869
316638E11F945966008137BD /* collectionViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = collectionViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6970
316638E51F945966008137BD /* collectionViewUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = collectionViewUITests.m; sourceTree = "<group>"; };
7071
316638E71F945966008137BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
71-
316638F61F948478008137BD /* waterCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = waterCollectionViewCell.h; sourceTree = "<group>"; };
72-
316638F71F948478008137BD /* waterCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = waterCollectionViewCell.m; sourceTree = "<group>"; };
73-
316638F81F948478008137BD /* waterCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = waterCollectionViewCell.xib; sourceTree = "<group>"; };
7472
316638FD1F948EEE008137BD /* WSLWaterFlowLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WSLWaterFlowLayout.h; sourceTree = "<group>"; };
7573
316638FE1F948EEE008137BD /* WSLWaterFlowLayout.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WSLWaterFlowLayout.m; sourceTree = "<group>"; };
7674
317C217921200400007EBF96 /* WSLWaterFlowHorizontalGrid.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = WSLWaterFlowHorizontalGrid.plist; sourceTree = "<group>"; };
7775
31B6F2671FB0066C000D6A30 /* UIButton+WSLTitleImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIButton+WSLTitleImage.h"; sourceTree = "<group>"; };
7876
31B6F2681FB0066C000D6A30 /* UIButton+WSLTitleImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIButton+WSLTitleImage.m"; sourceTree = "<group>"; };
79-
31CFF0CC1F9749000078C991 /* CollectionHeaderAndFooterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CollectionHeaderAndFooterView.h; sourceTree = "<group>"; };
80-
31CFF0CD1F9749000078C991 /* CollectionHeaderAndFooterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CollectionHeaderAndFooterView.m; sourceTree = "<group>"; };
81-
31CFF0CE1F9749000078C991 /* CollectionHeaderAndFooterView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CollectionHeaderAndFooterView.xib; sourceTree = "<group>"; };
77+
31EE0E46215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionHeaderAndFooterView.h; sourceTree = "<group>"; };
78+
31EE0E47215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CollectionHeaderAndFooterView.m; sourceTree = "<group>"; };
79+
31EE0E48215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CollectionHeaderAndFooterView.xib; sourceTree = "<group>"; };
80+
31EE0E49215E0EF1003DF8B7 /* waterCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = waterCollectionViewCell.h; sourceTree = "<group>"; };
81+
31EE0E4A215E0EF1003DF8B7 /* waterCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = waterCollectionViewCell.m; sourceTree = "<group>"; };
82+
31EE0E4B215E0EF1003DF8B7 /* waterCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = waterCollectionViewCell.xib; sourceTree = "<group>"; };
83+
31EE0E51215E0F89003DF8B7 /* WSLFlowLayoutStyleOne.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WSLFlowLayoutStyleOne.h; sourceTree = "<group>"; };
84+
31EE0E52215E0F89003DF8B7 /* WSLFlowLayoutStyleOne.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WSLFlowLayoutStyleOne.m; sourceTree = "<group>"; };
8285
/* End PBXFileReference section */
8386

8487
/* Begin PBXFrameworksBuildPhase section */
@@ -139,21 +142,15 @@
139142
316638C21F945965008137BD /* AppDelegate.m */,
140143
316638C41F945965008137BD /* ViewController.h */,
141144
316638C51F945965008137BD /* ViewController.m */,
145+
316638FD1F948EEE008137BD /* WSLWaterFlowLayout.h */,
146+
316638FE1F948EEE008137BD /* WSLWaterFlowLayout.m */,
147+
31EE0E50215E0F09003DF8B7 /* VC */,
148+
31EE0E45215E0EF1003DF8B7 /* view */,
142149
316638C71F945965008137BD /* Main.storyboard */,
143150
316638CA1F945965008137BD /* Assets.xcassets */,
144151
316638CC1F945965008137BD /* LaunchScreen.storyboard */,
145152
316638CF1F945965008137BD /* Info.plist */,
146153
316638D01F945965008137BD /* main.m */,
147-
316638F61F948478008137BD /* waterCollectionViewCell.h */,
148-
316638F71F948478008137BD /* waterCollectionViewCell.m */,
149-
316638F81F948478008137BD /* waterCollectionViewCell.xib */,
150-
316638FD1F948EEE008137BD /* WSLWaterFlowLayout.h */,
151-
316638FE1F948EEE008137BD /* WSLWaterFlowLayout.m */,
152-
31CFF0CC1F9749000078C991 /* CollectionHeaderAndFooterView.h */,
153-
31CFF0CD1F9749000078C991 /* CollectionHeaderAndFooterView.m */,
154-
31CFF0CE1F9749000078C991 /* CollectionHeaderAndFooterView.xib */,
155-
31B6F2671FB0066C000D6A30 /* UIButton+WSLTitleImage.h */,
156-
31B6F2681FB0066C000D6A30 /* UIButton+WSLTitleImage.m */,
157154
);
158155
path = collectionView;
159156
sourceTree = "<group>";
@@ -176,6 +173,30 @@
176173
path = collectionViewUITests;
177174
sourceTree = "<group>";
178175
};
176+
31EE0E45215E0EF1003DF8B7 /* view */ = {
177+
isa = PBXGroup;
178+
children = (
179+
31B6F2671FB0066C000D6A30 /* UIButton+WSLTitleImage.h */,
180+
31B6F2681FB0066C000D6A30 /* UIButton+WSLTitleImage.m */,
181+
31EE0E46215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.h */,
182+
31EE0E47215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.m */,
183+
31EE0E48215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.xib */,
184+
31EE0E49215E0EF1003DF8B7 /* waterCollectionViewCell.h */,
185+
31EE0E4A215E0EF1003DF8B7 /* waterCollectionViewCell.m */,
186+
31EE0E4B215E0EF1003DF8B7 /* waterCollectionViewCell.xib */,
187+
);
188+
path = view;
189+
sourceTree = "<group>";
190+
};
191+
31EE0E50215E0F09003DF8B7 /* VC */ = {
192+
isa = PBXGroup;
193+
children = (
194+
31EE0E51215E0F89003DF8B7 /* WSLFlowLayoutStyleOne.h */,
195+
31EE0E52215E0F89003DF8B7 /* WSLFlowLayoutStyleOne.m */,
196+
);
197+
path = VC;
198+
sourceTree = "<group>";
199+
};
179200
/* End PBXGroup section */
180201

181202
/* Begin PBXNativeTarget section */
@@ -282,11 +303,11 @@
282303
isa = PBXResourcesBuildPhase;
283304
buildActionMask = 2147483647;
284305
files = (
285-
31CFF0D01F9749000078C991 /* CollectionHeaderAndFooterView.xib in Resources */,
286306
316638CE1F945965008137BD /* LaunchScreen.storyboard in Resources */,
287307
317C217A21200400007EBF96 /* WSLWaterFlowHorizontalGrid.plist in Resources */,
308+
31EE0E4D215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.xib in Resources */,
288309
316638CB1F945965008137BD /* Assets.xcassets in Resources */,
289-
316638FA1F948478008137BD /* waterCollectionViewCell.xib in Resources */,
310+
31EE0E4F215E0EF1003DF8B7 /* waterCollectionViewCell.xib in Resources */,
290311
316638C91F945965008137BD /* Main.storyboard in Resources */,
291312
);
292313
runOnlyForDeploymentPostprocessing = 0;
@@ -313,15 +334,16 @@
313334
buildActionMask = 2147483647;
314335
files = (
315336
311CF03D1FBE8BAA00341F10 /* [email protected] in Sources */,
337+
31EE0E53215E0F89003DF8B7 /* WSLFlowLayoutStyleOne.m in Sources */,
316338
311CF03E1FBE8BAA00341F10 /* [email protected] in Sources */,
317339
311CF03F1FBE8BAA00341F10 /* [email protected] in Sources */,
318340
311CF0401FBE8BAA00341F10 /* [email protected] in Sources */,
319341
3105466F1F95959E00E5E770 /* 11.png in Sources */,
342+
31EE0E4C215E0EF1003DF8B7 /* CollectionHeaderAndFooterView.m in Sources */,
320343
316638C61F945965008137BD /* ViewController.m in Sources */,
321344
316638D11F945965008137BD /* main.m in Sources */,
345+
31EE0E4E215E0EF1003DF8B7 /* waterCollectionViewCell.m in Sources */,
322346
31B6F2691FB0066C000D6A30 /* UIButton+WSLTitleImage.m in Sources */,
323-
31CFF0CF1F9749000078C991 /* CollectionHeaderAndFooterView.m in Sources */,
324-
316638F91F948478008137BD /* waterCollectionViewCell.m in Sources */,
325347
316638FF1F948EEE008137BD /* WSLWaterFlowLayout.m in Sources */,
326348
316638C31F945965008137BD /* AppDelegate.m in Sources */,
327349
);

collectionView.xcodeproj/xcuserdata/wangshuanglong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

+16
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,21 @@
1313
stopOnStyle = "0">
1414
</BreakpointContent>
1515
</BreakpointProxy>
16+
<BreakpointProxy
17+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
18+
<BreakpointContent
19+
shouldBeEnabled = "Yes"
20+
ignoreCount = "0"
21+
continueAfterRunningActions = "No"
22+
filePath = "collectionView/VC/WSLFlowLayoutStyleOne.m"
23+
timestampString = "559814094.298077"
24+
startingColumnNumber = "9223372036854775807"
25+
endingColumnNumber = "9223372036854775807"
26+
startingLineNumber = "13"
27+
endingLineNumber = "13"
28+
landmarkName = "unknown"
29+
landmarkType = "0">
30+
</BreakpointContent>
31+
</BreakpointProxy>
1632
</Breakpoints>
1733
</Bucket>

collectionView/Base.lproj/Main.storyboard

+45-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="ZOv-O0-qfS">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1010
</dependencies>
1111
<scenes>
@@ -20,11 +20,54 @@
2020
<view key="view" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="8bC-Xf-vdC">
2121
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
2222
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
23+
<subviews>
24+
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="XY1-Ro-wqW">
25+
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
26+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
27+
<constraints>
28+
<constraint firstAttribute="width" constant="375" id="mOA-Ui-Gaz"/>
29+
<constraint firstAttribute="height" constant="603" id="uc0-nt-83B"/>
30+
</constraints>
31+
<connections>
32+
<outlet property="dataSource" destination="BYZ-38-t0r" id="yY9-7M-piU"/>
33+
<outlet property="delegate" destination="BYZ-38-t0r" id="HzO-33-ru8"/>
34+
</connections>
35+
</tableView>
36+
</subviews>
2337
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
38+
<constraints>
39+
<constraint firstItem="Y9C-Zh-AOy" firstAttribute="top" secondItem="XY1-Ro-wqW" secondAttribute="bottom" id="6YJ-A2-Suu"/>
40+
<constraint firstItem="XY1-Ro-wqW" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="F23-nF-ovh"/>
41+
<constraint firstAttribute="trailing" secondItem="XY1-Ro-wqW" secondAttribute="trailing" id="KDM-C0-LSO"/>
42+
<constraint firstItem="XY1-Ro-wqW" firstAttribute="top" secondItem="pfe-EB-Heg" secondAttribute="bottom" id="vgA-hM-Jhl"/>
43+
</constraints>
2444
</view>
45+
<navigationItem key="navigationItem" id="Xru-fP-glD"/>
46+
<connections>
47+
<outlet property="tableView" destination="XY1-Ro-wqW" id="V8x-3x-gbd"/>
48+
</connections>
2549
</viewController>
2650
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
2751
</objects>
52+
<point key="canvasLocation" x="1065" y="-583"/>
53+
</scene>
54+
<!--Navigation Controller-->
55+
<scene sceneID="ltf-EM-nfn">
56+
<objects>
57+
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="ZOv-O0-qfS" sceneMemberID="viewController">
58+
<toolbarItems/>
59+
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="95l-3t-9uh">
60+
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
61+
<autoresizingMask key="autoresizingMask"/>
62+
</navigationBar>
63+
<nil name="viewControllers"/>
64+
<connections>
65+
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="ilE-Or-riM"/>
66+
</connections>
67+
</navigationController>
68+
<placeholder placeholderIdentifier="IBFirstResponder" id="7I2-ax-K9l" userLabel="First Responder" sceneMemberID="firstResponder"/>
69+
</objects>
70+
<point key="canvasLocation" x="116" y="-564.46776611694156"/>
2871
</scene>
2972
</scenes>
3073
</document>
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// WSLWaterFlowLayoutStyleOne.h
3+
// collectionView
4+
//
5+
// Created by 王双龙 on 2018/9/28.
6+
// Copyright © 2018年 王双龙. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
#import "WSLWaterFlowLayout.h"
11+
12+
NS_ASSUME_NONNULL_BEGIN
13+
14+
@interface WSLWaterFlowLayoutStyleOne : UIViewController
15+
16+
/** 瀑布流样式*/
17+
@property (nonatomic, assign) WSLWaterFlowLayoutStyle flowLayoutStyle;
18+
19+
@end
20+
21+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)