Skip to content

Commit d475775

Browse files
committed
Adding collection view example.
1 parent 2e8f72e commit d475775

File tree

7 files changed

+164
-18
lines changed

7 files changed

+164
-18
lines changed

ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
F63613701CDD9CCD00AA9AF7 /* MTRefreshHeaderAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F636136F1CDD9CCD00AA9AF7 /* MTRefreshHeaderAnimator.swift */; };
1111
F63613721CDD9CD900AA9AF7 /* MTRefreshFooterAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F63613711CDD9CD900AA9AF7 /* MTRefreshFooterAnimator.swift */; };
1212
F64456001D65A2F10094D58E /* ESRefreshTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F64455FF1D65A2F10094D58E /* ESRefreshTableViewController.swift */; };
13+
F66B80331D86BE36006DDD16 /* ListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F66B80311D86BE36006DDD16 /* ListTableViewCell.swift */; };
14+
F66B80341D86BE36006DDD16 /* ListTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F66B80321D86BE36006DDD16 /* ListTableViewCell.xib */; };
15+
F66B80371D86BE44006DDD16 /* ListCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F66B80351D86BE44006DDD16 /* ListCollectionViewCell.swift */; };
16+
F66B80381D86BE44006DDD16 /* ListCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F66B80361D86BE44006DDD16 /* ListCollectionViewCell.xib */; };
1317
F690770B1D0D0A7F00BE91FE /* ESRefreshFooterAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69077011D0D0A7F00BE91FE /* ESRefreshFooterAnimator.swift */; };
1418
F690770E1D0D0A7F00BE91FE /* ESRefreshHeaderAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69077021D0D0A7F00BE91FE /* ESRefreshHeaderAnimator.swift */; };
1519
F69077111D0D0A7F00BE91FE /* icon_pull_to_refresh_arrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F69077031D0D0A7F00BE91FE /* icon_pull_to_refresh_arrow@2x.png */; };
@@ -62,6 +66,10 @@
6266
F636136F1CDD9CCD00AA9AF7 /* MTRefreshHeaderAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MTRefreshHeaderAnimator.swift; sourceTree = "<group>"; };
6367
F63613711CDD9CD900AA9AF7 /* MTRefreshFooterAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MTRefreshFooterAnimator.swift; sourceTree = "<group>"; };
6468
F64455FF1D65A2F10094D58E /* ESRefreshTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ESRefreshTableViewController.swift; sourceTree = "<group>"; };
69+
F66B80311D86BE36006DDD16 /* ListTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListTableViewCell.swift; sourceTree = "<group>"; };
70+
F66B80321D86BE36006DDD16 /* ListTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ListTableViewCell.xib; sourceTree = "<group>"; };
71+
F66B80351D86BE44006DDD16 /* ListCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListCollectionViewCell.swift; sourceTree = "<group>"; };
72+
F66B80361D86BE44006DDD16 /* ListCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ListCollectionViewCell.xib; sourceTree = "<group>"; };
6573
F690763F1D0D065300BE91FE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
6674
F69077011D0D0A7F00BE91FE /* ESRefreshFooterAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ESRefreshFooterAnimator.swift; sourceTree = "<group>"; };
6775
F69077021D0D0A7F00BE91FE /* ESRefreshHeaderAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ESRefreshHeaderAnimator.swift; sourceTree = "<group>"; };
@@ -205,6 +213,10 @@
205213
children = (
206214
F692000F1CDB9A530029EF47 /* AppDelegate.swift */,
207215
F69200111CDB9A530029EF47 /* ViewController.swift */,
216+
F66B80311D86BE36006DDD16 /* ListTableViewCell.swift */,
217+
F66B80321D86BE36006DDD16 /* ListTableViewCell.xib */,
218+
F66B80351D86BE44006DDD16 /* ListCollectionViewCell.swift */,
219+
F66B80361D86BE44006DDD16 /* ListCollectionViewCell.xib */,
208220
F6AA6C3E1CDC80DD00723622 /* WebViewController.swift */,
209221
F6AA6C3F1CDC80DD00723622 /* WebViewController.xib */,
210222
F636136D1CDD9C9100AA9AF7 /* Custom */,
@@ -348,6 +360,8 @@
348360
F69200171CDB9A530029EF47 /* Assets.xcassets in Resources */,
349361
F69FF82C1D753A1300C4A4B6 /* ESRefreshCollectionViewCell.xib in Resources */,
350362
F69200151CDB9A530029EF47 /* Main.storyboard in Resources */,
363+
F66B80381D86BE44006DDD16 /* ListCollectionViewCell.xib in Resources */,
364+
F66B80341D86BE36006DDD16 /* ListTableViewCell.xib in Resources */,
351365
F6AA6C411CDC80DD00723622 /* WebViewController.xib in Resources */,
352366
F69077111D0D0A7F00BE91FE /* icon_pull_to_refresh_arrow@2x.png in Resources */,
353367
);
@@ -375,6 +389,7 @@
375389
isa = PBXSourcesBuildPhase;
376390
buildActionMask = 2147483647;
377391
files = (
392+
F66B80371D86BE44006DDD16 /* ListCollectionViewCell.swift in Sources */,
378393
F690771B1D0D0A7F00BE91FE /* ESRefreshAnimator.swift in Sources */,
379394
F63613721CDD9CD900AA9AF7 /* MTRefreshFooterAnimator.swift in Sources */,
380395
F69077211D0D0A7F00BE91FE /* ESRefreshProtocol.swift in Sources */,
@@ -389,6 +404,7 @@
389404
F6AE47331CE062F00006C017 /* WCRefreshHeaderAnimator.swift in Sources */,
390405
F69077141D0D0A7F00BE91FE /* ESPullToRefresh+Manager.swift in Sources */,
391406
F690771E1D0D0A7F00BE91FE /* ESRefreshComponent.swift in Sources */,
407+
F66B80331D86BE36006DDD16 /* ListTableViewCell.swift in Sources */,
392408
F69200121CDB9A530029EF47 /* ViewController.swift in Sources */,
393409
F63613701CDD9CCD00AA9AF7 /* MTRefreshHeaderAnimator.swift in Sources */,
394410
F69077181D0D0A7F00BE91FE /* ESPullToRefresh.swift in Sources */,

ESPullToRefreshExample/ESPullToRefreshExample/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
3636
<subviews>
3737
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="TKI-sd-Bud">
38-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
38+
<color key="backgroundColor" red="0.88235294117647056" green="0.88235294117647056" blue="0.88235294117647056" alpha="1" colorSpace="calibratedRGB"/>
3939
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="Dkl-qC-7px">
4040
<size key="itemSize" width="120" height="120"/>
4141
<size key="headerReferenceSize" width="0.0" height="0.0"/>
@@ -105,7 +105,7 @@
105105
<outlet property="delegate" destination="L1M-GO-x81" id="zX4-Dt-gW4"/>
106106
</connections>
107107
</collectionView>
108-
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="46" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="NUa-6J-eEW">
108+
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="46" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="NUa-6J-eEW">
109109
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
110110
<connections>
111111
<outlet property="dataSource" destination="L1M-GO-x81" id="Uhn-hm-yYe"/>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// ListCollectionViewCell.swift
3+
// ESPullToRefreshExample
4+
//
5+
// Created by lihao on 16/9/12.
6+
// Copyright © 2016年 egg swift. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class ListCollectionViewCell: UICollectionViewCell {
12+
13+
@IBOutlet weak var titleLabel: UILabel!
14+
15+
override func awakeFromNib() {
16+
super.awakeFromNib()
17+
// Initialization code
18+
}
19+
20+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3+
<dependencies>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+
</dependencies>
8+
<objects>
9+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
10+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
11+
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="ListCollectionViewCell" id="gTV-IL-0wX" customClass="ListCollectionViewCell" customModule="ESRefresh" customModuleProvider="target">
12+
<rect key="frame" x="0.0" y="0.0" width="189" height="139"/>
13+
<autoresizingMask key="autoresizingMask"/>
14+
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
15+
<rect key="frame" x="0.0" y="0.0" width="189" height="139"/>
16+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
17+
<subviews>
18+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nu4-HF-kIs">
19+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
20+
<color key="textColor" red="0.14901960780000001" green="0.14901960780000001" blue="0.14901960780000001" alpha="1" colorSpace="calibratedRGB"/>
21+
<nil key="highlightedColor"/>
22+
</label>
23+
</subviews>
24+
</view>
25+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
26+
<constraints>
27+
<constraint firstItem="nu4-HF-kIs" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="DAR-te-qrg"/>
28+
<constraint firstItem="nu4-HF-kIs" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="ZVb-c7-Vw8"/>
29+
<constraint firstAttribute="bottom" secondItem="nu4-HF-kIs" secondAttribute="bottom" id="qeF-eT-ESF"/>
30+
<constraint firstAttribute="trailing" secondItem="nu4-HF-kIs" secondAttribute="trailing" id="s3b-Jy-Hc7"/>
31+
</constraints>
32+
<size key="customSize" width="189" height="139"/>
33+
<connections>
34+
<outlet property="titleLabel" destination="nu4-HF-kIs" id="j2r-GP-Vah"/>
35+
</connections>
36+
<point key="canvasLocation" x="104.5" y="140.5"/>
37+
</collectionViewCell>
38+
</objects>
39+
</document>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// ListTableViewCell.swift
3+
// ESPullToRefreshExample
4+
//
5+
// Created by lihao on 16/9/12.
6+
// Copyright © 2016年 egg swift. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class ListTableViewCell: UITableViewCell {
12+
13+
@IBOutlet weak var titleLabel: UILabel!
14+
15+
override func awakeFromNib() {
16+
super.awakeFromNib()
17+
// Initialization code
18+
}
19+
20+
override func setSelected(_ selected: Bool, animated: Bool) {
21+
super.setSelected(selected, animated: animated)
22+
23+
// Configure the view for the selected state
24+
}
25+
26+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
3+
<dependencies>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
6+
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8+
</dependencies>
9+
<objects>
10+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
11+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
12+
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="ListTableViewCell" rowHeight="136" id="KGk-i7-Jjw" customClass="ListTableViewCell" customModule="ESRefresh" customModuleProvider="target">
13+
<rect key="frame" x="0.0" y="0.0" width="320" height="136"/>
14+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
15+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
16+
<frame key="frameInset" width="287" height="135"/>
17+
<autoresizingMask key="autoresizingMask"/>
18+
<subviews>
19+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oyd-3n-hUb">
20+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
21+
<nil key="textColor"/>
22+
<nil key="highlightedColor"/>
23+
</label>
24+
</subviews>
25+
<constraints>
26+
<constraint firstItem="oyd-3n-hUb" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="8" id="Z4d-Xn-az9"/>
27+
<constraint firstAttribute="trailingMargin" relation="greaterThanOrEqual" secondItem="oyd-3n-hUb" secondAttribute="trailing" constant="15" id="jsr-Tq-SV1"/>
28+
<constraint firstItem="oyd-3n-hUb" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="t4z-TF-knt"/>
29+
</constraints>
30+
</tableViewCellContentView>
31+
<connections>
32+
<outlet property="titleLabel" destination="oyd-3n-hUb" id="apm-OG-mZ1"/>
33+
</connections>
34+
<point key="canvasLocation" x="35" y="142"/>
35+
</tableViewCell>
36+
</objects>
37+
</document>

0 commit comments

Comments
 (0)