Skip to content

Commit 4e8dc7a

Browse files
committed
Small updated
1 parent 6a48f73 commit 4e8dc7a

11 files changed

Lines changed: 92 additions & 121 deletions

Example/Example.xcodeproj/project.pbxproj

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@
88

99
/* Begin PBXBuildFile section */
1010
49588A0F5E1A5829806CF162 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C685BA161AB98E8D668D2F26 /* Pods.framework */; };
11-
9349943A1C399D70006C4B97 /* IntroViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 934994391C399D70006C4B97 /* IntroViewController.swift */; };
12-
9349943C1C399D99006C4B97 /* Intro.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9349943B1C399D99006C4B97 /* Intro.storyboard */; };
13-
9349943F1C39A5B9006C4B97 /* IntroCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9349943D1C39A5B9006C4B97 /* IntroCollectionViewCell.swift */; };
14-
934994401C39A5B9006C4B97 /* IntroCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9349943E1C39A5B9006C4B97 /* IntroCollectionViewCell.xib */; };
15-
934994421C39B0F4006C4B97 /* SecoundViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 934994411C39B0F4006C4B97 /* SecoundViewController.swift */; };
16-
934994441C39B102006C4B97 /* Secound.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 934994431C39B102006C4B97 /* Secound.storyboard */; };
11+
9349943A1C399D70006C4B97 /* Pattern1ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 934994391C399D70006C4B97 /* Pattern1ViewController.swift */; };
12+
9349943C1C399D99006C4B97 /* Pattern1.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9349943B1C399D99006C4B97 /* Pattern1.storyboard */; };
13+
9349943F1C39A5B9006C4B97 /* ImageCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9349943D1C39A5B9006C4B97 /* ImageCollectionViewCell.swift */; };
14+
934994401C39A5B9006C4B97 /* ImageCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9349943E1C39A5B9006C4B97 /* ImageCollectionViewCell.xib */; };
15+
934994421C39B0F4006C4B97 /* Pattern2ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 934994411C39B0F4006C4B97 /* Pattern2ViewController.swift */; };
16+
934994441C39B102006C4B97 /* Pattern2.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 934994431C39B102006C4B97 /* Pattern2.storyboard */; };
1717
93DC8E391BD232CA004BCCBC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93DC8E381BD232CA004BCCBC /* AppDelegate.swift */; };
18-
93DC8E3B1BD232CA004BCCBC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93DC8E3A1BD232CA004BCCBC /* ViewController.swift */; };
18+
93DC8E3B1BD232CA004BCCBC /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93DC8E3A1BD232CA004BCCBC /* MainViewController.swift */; };
1919
93DC8E3E1BD232CA004BCCBC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 93DC8E3C1BD232CA004BCCBC /* Main.storyboard */; };
2020
93DC8E401BD232CA004BCCBC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 93DC8E3F1BD232CA004BCCBC /* Assets.xcassets */; };
2121
93DC8E431BD232CA004BCCBC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 93DC8E411BD232CA004BCCBC /* LaunchScreen.storyboard */; };
2222
/* End PBXBuildFile section */
2323

2424
/* Begin PBXFileReference section */
25-
934994391C399D70006C4B97 /* IntroViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntroViewController.swift; sourceTree = "<group>"; };
26-
9349943B1C399D99006C4B97 /* Intro.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Intro.storyboard; sourceTree = "<group>"; };
27-
9349943D1C39A5B9006C4B97 /* IntroCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntroCollectionViewCell.swift; sourceTree = "<group>"; };
28-
9349943E1C39A5B9006C4B97 /* IntroCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IntroCollectionViewCell.xib; sourceTree = "<group>"; };
29-
934994411C39B0F4006C4B97 /* SecoundViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecoundViewController.swift; sourceTree = "<group>"; };
30-
934994431C39B102006C4B97 /* Secound.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Secound.storyboard; sourceTree = "<group>"; };
25+
934994391C399D70006C4B97 /* Pattern1ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pattern1ViewController.swift; sourceTree = "<group>"; };
26+
9349943B1C399D99006C4B97 /* Pattern1.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Pattern1.storyboard; sourceTree = "<group>"; };
27+
9349943D1C39A5B9006C4B97 /* ImageCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCollectionViewCell.swift; sourceTree = "<group>"; };
28+
9349943E1C39A5B9006C4B97 /* ImageCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ImageCollectionViewCell.xib; sourceTree = "<group>"; };
29+
934994411C39B0F4006C4B97 /* Pattern2ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pattern2ViewController.swift; sourceTree = "<group>"; };
30+
934994431C39B102006C4B97 /* Pattern2.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Pattern2.storyboard; sourceTree = "<group>"; };
3131
93DC8E351BD232CA004BCCBC /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
3232
93DC8E381BD232CA004BCCBC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33-
93DC8E3A1BD232CA004BCCBC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
33+
93DC8E3A1BD232CA004BCCBC /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
3434
93DC8E3D1BD232CA004BCCBC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
3535
93DC8E3F1BD232CA004BCCBC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3636
93DC8E421BD232CA004BCCBC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -74,14 +74,14 @@
7474
isa = PBXGroup;
7575
children = (
7676
93DC8E381BD232CA004BCCBC /* AppDelegate.swift */,
77-
93DC8E3A1BD232CA004BCCBC /* ViewController.swift */,
78-
934994411C39B0F4006C4B97 /* SecoundViewController.swift */,
79-
934994431C39B102006C4B97 /* Secound.storyboard */,
80-
934994391C399D70006C4B97 /* IntroViewController.swift */,
81-
9349943D1C39A5B9006C4B97 /* IntroCollectionViewCell.swift */,
82-
9349943E1C39A5B9006C4B97 /* IntroCollectionViewCell.xib */,
77+
93DC8E3A1BD232CA004BCCBC /* MainViewController.swift */,
8378
93DC8E3C1BD232CA004BCCBC /* Main.storyboard */,
84-
9349943B1C399D99006C4B97 /* Intro.storyboard */,
79+
934994391C399D70006C4B97 /* Pattern1ViewController.swift */,
80+
9349943B1C399D99006C4B97 /* Pattern1.storyboard */,
81+
934994411C39B0F4006C4B97 /* Pattern2ViewController.swift */,
82+
934994431C39B102006C4B97 /* Pattern2.storyboard */,
83+
9349943D1C39A5B9006C4B97 /* ImageCollectionViewCell.swift */,
84+
9349943E1C39A5B9006C4B97 /* ImageCollectionViewCell.xib */,
8585
93DC8E3F1BD232CA004BCCBC /* Assets.xcassets */,
8686
93DC8E411BD232CA004BCCBC /* LaunchScreen.storyboard */,
8787
93DC8E441BD232CA004BCCBC /* Info.plist */,
@@ -168,10 +168,10 @@
168168
files = (
169169
93DC8E431BD232CA004BCCBC /* LaunchScreen.storyboard in Resources */,
170170
93DC8E401BD232CA004BCCBC /* Assets.xcassets in Resources */,
171-
934994441C39B102006C4B97 /* Secound.storyboard in Resources */,
172-
934994401C39A5B9006C4B97 /* IntroCollectionViewCell.xib in Resources */,
171+
934994441C39B102006C4B97 /* Pattern2.storyboard in Resources */,
172+
934994401C39A5B9006C4B97 /* ImageCollectionViewCell.xib in Resources */,
173173
93DC8E3E1BD232CA004BCCBC /* Main.storyboard in Resources */,
174-
9349943C1C399D99006C4B97 /* Intro.storyboard in Resources */,
174+
9349943C1C399D99006C4B97 /* Pattern1.storyboard in Resources */,
175175
);
176176
runOnlyForDeploymentPostprocessing = 0;
177177
};
@@ -230,11 +230,11 @@
230230
isa = PBXSourcesBuildPhase;
231231
buildActionMask = 2147483647;
232232
files = (
233-
9349943A1C399D70006C4B97 /* IntroViewController.swift in Sources */,
234-
93DC8E3B1BD232CA004BCCBC /* ViewController.swift in Sources */,
235-
934994421C39B0F4006C4B97 /* SecoundViewController.swift in Sources */,
233+
9349943A1C399D70006C4B97 /* Pattern1ViewController.swift in Sources */,
234+
93DC8E3B1BD232CA004BCCBC /* MainViewController.swift in Sources */,
235+
934994421C39B0F4006C4B97 /* Pattern2ViewController.swift in Sources */,
236236
93DC8E391BD232CA004BCCBC /* AppDelegate.swift in Sources */,
237-
9349943F1C39A5B9006C4B97 /* IntroCollectionViewCell.swift in Sources */,
237+
9349943F1C39A5B9006C4B97 /* ImageCollectionViewCell.swift in Sources */,
238238
);
239239
runOnlyForDeploymentPostprocessing = 0;
240240
};

Example/Example/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
</objects>
2222
<point key="canvasLocation" x="-460" y="511"/>
2323
</scene>
24-
<!--View Controller-->
24+
<!--Main View Controller-->
2525
<scene sceneID="1Kl-4d-wQ0">
2626
<objects>
27-
<viewController id="9lV-Re-kOd" customClass="ViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
27+
<viewController id="9lV-Re-kOd" customClass="MainViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
2828
<layoutGuides>
2929
<viewControllerLayoutGuide type="top" id="2b4-Bh-NFz"/>
3030
<viewControllerLayoutGuide type="bottom" id="WMJ-rH-CQa"/>

Example/Example/IntroCollectionViewCell.swift renamed to Example/Example/ImageCollectionViewCell.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// IntroCollectionViewCell.swift
2+
// ImageCollectionViewCell.swift
33
// Example
44
//
55
// Created by hiroyuki yoshida on 2016/01/04.
@@ -8,10 +8,10 @@
88

99
import UIKit
1010

11-
final class IntroCollectionViewCell: UICollectionViewCell {
11+
final class ImageCollectionViewCell: UICollectionViewCell {
1212
@IBOutlet weak var imageView: UIImageView!
13-
static let identifier = "IntroCollectionViewCell"
14-
static let nib = UINib(nibName: "IntroCollectionViewCell", bundle: nil)
13+
static let identifier = "ImageCollectionViewCell"
14+
static let nib = UINib(nibName: "ImageCollectionViewCell", bundle: nil)
1515
func configure(dequeueIndexPath dequeueIndexPath: NSIndexPath) {
1616
let image = UIImage(named: String(dequeueIndexPath.row))
1717
imageView.image = image

Example/Example/IntroCollectionViewCell.xib renamed to Example/Example/ImageCollectionViewCell.xib

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
33
<dependencies>
4-
<deployment identifier="iOS"/>
54
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
65
</dependencies>
76
<objects>
87
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
98
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
10-
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="IntroCollectionViewCell" id="gTV-IL-0wX" customClass="IntroCollectionViewCell" customModule="Example" customModuleProvider="target">
9+
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="ImageCollectionViewCell" id="gTV-IL-0wX" customClass="ImageCollectionViewCell" customModule="Example" customModuleProvider="target">
1110
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
1211
<autoresizingMask key="autoresizingMask"/>
1312
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// ViewController.swift
2+
// MainViewController.swift
33
// Example
44
//
55
// Created by hiroyuki yoshida on 2015/10/17.
@@ -9,7 +9,7 @@
99
import UIKit
1010
import InfiniteCollectionView
1111

12-
final class ViewController: UIViewController {
12+
final class MainViewController: UIViewController {
1313
var patterns = ["pattern1", "pattern2"]
1414
let identifier = "tableViewCell"
1515
@IBOutlet weak var tableView: UITableView! {
@@ -29,7 +29,7 @@ final class ViewController: UIViewController {
2929
}
3030
}
3131

32-
extension ViewController: UITableViewDelegate, UITableViewDataSource {
32+
extension MainViewController: UITableViewDelegate, UITableViewDataSource {
3333
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
3434
return patterns.count
3535
}
@@ -40,10 +40,10 @@ extension ViewController: UITableViewDelegate, UITableViewDataSource {
4040
}
4141
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
4242
if indexPath.row == 0 {
43-
let controller = IntroViewController.createFromStoryboard()
43+
let controller = Pattern1ViewController.createFromStoryboard()
4444
navigationController?.pushViewController(controller, animated: true)
4545
} else if indexPath.row == 1 {
46-
let controller = SecoundViewController.createFromStoryboard()
46+
let controller = Pattern2ViewController.createFromStoryboard()
4747
navigationController?.pushViewController(controller, animated: true)
4848
}
4949
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
66
</dependencies>
77
<scenes>
8-
<!--Intro View Controller-->
8+
<!--Pattern1 View Controller-->
99
<scene sceneID="w99-5n-3Mx">
1010
<objects>
11-
<viewController automaticallyAdjustsScrollViewInsets="NO" id="jtB-7l-rQl" customClass="IntroViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
11+
<viewController automaticallyAdjustsScrollViewInsets="NO" id="jtB-7l-rQl" customClass="Pattern1ViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
1212
<layoutGuides>
1313
<viewControllerLayoutGuide type="top" id="Vix-Nr-Wbb"/>
1414
<viewControllerLayoutGuide type="bottom" id="rTP-xN-QW3"/>
@@ -17,9 +17,10 @@
1717
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
1818
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1919
<subviews>
20-
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="Lwf-cA-VEr" customClass="InfiniteCollectionView" customModule="InfiniteCollectionView">
20+
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="Lwf-cA-VEr" customClass="InfiniteCollectionView" customModule="InfiniteCollectionView">
2121
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
22-
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="9XM-Ng-ou9">
22+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
23+
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="9XM-Ng-ou9">
2324
<size key="itemSize" width="600" height="600"/>
2425
<size key="headerReferenceSize" width="0.0" height="0.0"/>
2526
<size key="footerReferenceSize" width="0.0" height="0.0"/>

Example/Example/IntroViewController.swift renamed to Example/Example/Pattern1ViewController.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// IntroViewController.swift
2+
// Pattern1ViewController.swift
33
// Example
44
//
55
// Created by hiroyuki yoshida on 2016/01/04.
@@ -9,20 +9,18 @@
99
import UIKit
1010
import InfiniteCollectionView
1111

12-
final class IntroViewController: UIViewController {
12+
final class Pattern1ViewController: UIViewController {
1313
var items = ["1", "2", "3", "4"]
1414
@IBOutlet weak var collectionView: InfiniteCollectionView! {
1515
didSet {
1616
collectionView.infiniteDataSource = self
1717
collectionView.infiniteDelegate = self
1818
collectionView.cellWidth = UIScreen.mainScreen().bounds.width
19-
collectionView.registerNib(IntroCollectionViewCell.nib, forCellWithReuseIdentifier: IntroCollectionViewCell.identifier)
20-
collectionView.pagingEnabled = true
19+
collectionView.registerNib(ImageCollectionViewCell.nib, forCellWithReuseIdentifier: ImageCollectionViewCell.identifier)
2120
}
2221
}
2322
@IBOutlet weak var layout: UICollectionViewFlowLayout! {
2423
didSet {
25-
layout.scrollDirection = .Horizontal
2624
layout.itemSize = CGSize(width: UIScreen.mainScreen().bounds.width, height: UIScreen.mainScreen().bounds.height)
2725
}
2826
}
@@ -31,19 +29,19 @@ final class IntroViewController: UIViewController {
3129
pageControl.numberOfPages = items.count
3230
}
3331
}
34-
static func createFromStoryboard() -> IntroViewController {
35-
let storyboard = UIStoryboard(name: "Intro", bundle: nil)
36-
return storyboard.instantiateInitialViewController() as! IntroViewController
32+
static func createFromStoryboard() -> Pattern1ViewController {
33+
let storyboard = UIStoryboard(name: "Pattern1", bundle: nil)
34+
return storyboard.instantiateInitialViewController() as! Pattern1ViewController
3735
}
3836
}
3937

4038
// MARK: - InfiniteCollectionViewDataSource, InfiniteCollectionViewDelegate
41-
extension IntroViewController: InfiniteCollectionViewDataSource, InfiniteCollectionViewDelegate {
39+
extension Pattern1ViewController: InfiniteCollectionViewDataSource, InfiniteCollectionViewDelegate {
4240
func numberOfItems(collectionView: UICollectionView) -> Int {
4341
return items.count
4442
}
4543
func cellForItemAtIndexPath(collectionView: UICollectionView, dequeueIndexPath: NSIndexPath, indexPath: NSIndexPath) -> UICollectionViewCell {
46-
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(IntroCollectionViewCell.identifier, forIndexPath: dequeueIndexPath) as! IntroCollectionViewCell
44+
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(ImageCollectionViewCell.identifier, forIndexPath: dequeueIndexPath) as! ImageCollectionViewCell
4745
cell.configure(dequeueIndexPath: indexPath)
4846
return cell
4947
}

0 commit comments

Comments
 (0)