Skip to content

Commit

Permalink
Created files
Browse files Browse the repository at this point in the history
  • Loading branch information
hryk224 committed Jan 3, 2016
1 parent 5730051 commit 5ae841a
Show file tree
Hide file tree
Showing 20 changed files with 718 additions and 40 deletions.
24 changes: 24 additions & 0 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

/* Begin PBXBuildFile section */
49588A0F5E1A5829806CF162 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C685BA161AB98E8D668D2F26 /* Pods.framework */; };
9349943A1C399D70006C4B97 /* IntroViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 934994391C399D70006C4B97 /* IntroViewController.swift */; };
9349943C1C399D99006C4B97 /* Intro.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9349943B1C399D99006C4B97 /* Intro.storyboard */; };
9349943F1C39A5B9006C4B97 /* IntroCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9349943D1C39A5B9006C4B97 /* IntroCollectionViewCell.swift */; };
934994401C39A5B9006C4B97 /* IntroCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9349943E1C39A5B9006C4B97 /* IntroCollectionViewCell.xib */; };
934994421C39B0F4006C4B97 /* SecoundViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 934994411C39B0F4006C4B97 /* SecoundViewController.swift */; };
934994441C39B102006C4B97 /* Secound.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 934994431C39B102006C4B97 /* Secound.storyboard */; };
93DC8E391BD232CA004BCCBC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93DC8E381BD232CA004BCCBC /* AppDelegate.swift */; };
93DC8E3B1BD232CA004BCCBC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93DC8E3A1BD232CA004BCCBC /* ViewController.swift */; };
93DC8E3E1BD232CA004BCCBC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 93DC8E3C1BD232CA004BCCBC /* Main.storyboard */; };
Expand All @@ -16,6 +22,12 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
934994391C399D70006C4B97 /* IntroViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntroViewController.swift; sourceTree = "<group>"; };
9349943B1C399D99006C4B97 /* Intro.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Intro.storyboard; sourceTree = "<group>"; };
9349943D1C39A5B9006C4B97 /* IntroCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntroCollectionViewCell.swift; sourceTree = "<group>"; };
9349943E1C39A5B9006C4B97 /* IntroCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IntroCollectionViewCell.xib; sourceTree = "<group>"; };
934994411C39B0F4006C4B97 /* SecoundViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecoundViewController.swift; sourceTree = "<group>"; };
934994431C39B102006C4B97 /* Secound.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Secound.storyboard; sourceTree = "<group>"; };
93DC8E351BD232CA004BCCBC /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
93DC8E381BD232CA004BCCBC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
93DC8E3A1BD232CA004BCCBC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -63,7 +75,13 @@
children = (
93DC8E381BD232CA004BCCBC /* AppDelegate.swift */,
93DC8E3A1BD232CA004BCCBC /* ViewController.swift */,
934994411C39B0F4006C4B97 /* SecoundViewController.swift */,
934994431C39B102006C4B97 /* Secound.storyboard */,
934994391C399D70006C4B97 /* IntroViewController.swift */,
9349943D1C39A5B9006C4B97 /* IntroCollectionViewCell.swift */,
9349943E1C39A5B9006C4B97 /* IntroCollectionViewCell.xib */,
93DC8E3C1BD232CA004BCCBC /* Main.storyboard */,
9349943B1C399D99006C4B97 /* Intro.storyboard */,
93DC8E3F1BD232CA004BCCBC /* Assets.xcassets */,
93DC8E411BD232CA004BCCBC /* LaunchScreen.storyboard */,
93DC8E441BD232CA004BCCBC /* Info.plist */,
Expand Down Expand Up @@ -150,7 +168,10 @@
files = (
93DC8E431BD232CA004BCCBC /* LaunchScreen.storyboard in Resources */,
93DC8E401BD232CA004BCCBC /* Assets.xcassets in Resources */,
934994441C39B102006C4B97 /* Secound.storyboard in Resources */,
934994401C39A5B9006C4B97 /* IntroCollectionViewCell.xib in Resources */,
93DC8E3E1BD232CA004BCCBC /* Main.storyboard in Resources */,
9349943C1C399D99006C4B97 /* Intro.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -209,8 +230,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9349943A1C399D70006C4B97 /* IntroViewController.swift in Sources */,
93DC8E3B1BD232CA004BCCBC /* ViewController.swift in Sources */,
934994421C39B0F4006C4B97 /* SecoundViewController.swift in Sources */,
93DC8E391BD232CA004BCCBC /* AppDelegate.swift in Sources */,
9349943F1C39A5B9006C4B97 /* IntroCollectionViewCell.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file added Example/Example/Assets.xcassets/0.imageset/0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Example/Example/Assets.xcassets/0.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "0.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added Example/Example/Assets.xcassets/1.imageset/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Example/Example/Assets.xcassets/1.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "1.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added Example/Example/Assets.xcassets/2.imageset/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Example/Example/Assets.xcassets/2.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "2.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added Example/Example/Assets.xcassets/3.imageset/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Example/Example/Assets.xcassets/3.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "3.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
4 changes: 2 additions & 2 deletions Example/Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="6uU-YD-eXt" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-280" y="516"/>
<point key="canvasLocation" x="-460" y="511"/>
</scene>
<!--View Controller-->
<scene sceneID="1Kl-4d-wQ0">
Expand Down Expand Up @@ -53,7 +53,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="5m4-Is-Uww" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="408" y="516"/>
<point key="canvasLocation" x="201" y="511"/>
</scene>
</scenes>
</document>
71 changes: 71 additions & 0 deletions Example/Example/Intro.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="jtB-7l-rQl">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--Intro View Controller-->
<scene sceneID="w99-5n-3Mx">
<objects>
<viewController automaticallyAdjustsScrollViewInsets="NO" id="jtB-7l-rQl" customClass="IntroViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Vix-Nr-Wbb"/>
<viewControllerLayoutGuide type="bottom" id="rTP-xN-QW3"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="fk8-nc-mgC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="Lwf-cA-VEr" customClass="InfiniteCollectionView" customModule="InfiniteCollectionView">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="9XM-Ng-ou9">
<size key="itemSize" width="600" height="600"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells/>
</collectionView>
<view alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QjU-up-8Sl">
<rect key="frame" x="0.0" y="543" width="600" height="37"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="37" id="Pl4-pn-Jed"/>
</constraints>
</view>
<pageControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" numberOfPages="3" translatesAutoresizingMaskIntoConstraints="NO" id="RxI-o2-lRZ">
<rect key="frame" x="0.0" y="543" width="600" height="37"/>
<constraints>
<constraint firstAttribute="height" constant="37" id="L4v-Uu-0PK"/>
</constraints>
<color key="pageIndicatorTintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="currentPageIndicatorTintColor" red="0.75686274509999996" green="0.1960784314" blue="0.15686274510000001" alpha="1" colorSpace="calibratedRGB"/>
</pageControl>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="QjU-up-8Sl" secondAttribute="trailing" id="12W-C1-v9R"/>
<constraint firstAttribute="trailing" secondItem="RxI-o2-lRZ" secondAttribute="trailing" id="I7I-K3-VLb"/>
<constraint firstItem="Lwf-cA-VEr" firstAttribute="leading" secondItem="fk8-nc-mgC" secondAttribute="leading" id="NFN-BY-c0F"/>
<constraint firstItem="rTP-xN-QW3" firstAttribute="top" secondItem="Lwf-cA-VEr" secondAttribute="bottom" id="Rm1-Pt-2ET"/>
<constraint firstItem="rTP-xN-QW3" firstAttribute="top" secondItem="RxI-o2-lRZ" secondAttribute="bottom" constant="20" id="fYC-HN-2ix"/>
<constraint firstItem="RxI-o2-lRZ" firstAttribute="leading" secondItem="fk8-nc-mgC" secondAttribute="leading" id="hbP-3L-wxy"/>
<constraint firstItem="Lwf-cA-VEr" firstAttribute="top" secondItem="fk8-nc-mgC" secondAttribute="top" id="mQv-aQ-Qp8"/>
<constraint firstItem="QjU-up-8Sl" firstAttribute="leading" secondItem="fk8-nc-mgC" secondAttribute="leading" id="nv4-jf-hwP"/>
<constraint firstAttribute="trailing" secondItem="Lwf-cA-VEr" secondAttribute="trailing" id="o9s-cD-XIp"/>
<constraint firstItem="rTP-xN-QW3" firstAttribute="top" secondItem="QjU-up-8Sl" secondAttribute="bottom" constant="20" id="oBP-Bl-GPa"/>
</constraints>
</view>
<connections>
<outlet property="collectionView" destination="Lwf-cA-VEr" id="OVu-NX-VQz"/>
<outlet property="layout" destination="9XM-Ng-ou9" id="rvd-rt-iwV"/>
<outlet property="pageControl" destination="RxI-o2-lRZ" id="IaE-F1-N1Z"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="6qE-8b-tDF" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="584" y="352"/>
</scene>
</scenes>
</document>
21 changes: 21 additions & 0 deletions Example/Example/IntroCollectionViewCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// IntroCollectionViewCell.swift
// Example
//
// Created by hiroyuki yoshida on 2016/01/04.
// Copyright © 2016年 hiroyuki yoshida. All rights reserved.
//

import UIKit

final class IntroCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
static let identifier = "IntroCollectionViewCell"
static let nib = UINib(nibName: "IntroCollectionViewCell", bundle: nil)
func configure(dequeueIndexPath dequeueIndexPath: NSIndexPath) {
let image = UIImage(named: String(dequeueIndexPath.row))
imageView.image = image
setNeedsLayout()
layoutIfNeeded()
}
}
34 changes: 34 additions & 0 deletions Example/Example/IntroCollectionViewCell.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="IntroCollectionViewCell" id="gTV-IL-0wX" customClass="IntroCollectionViewCell" customModule="Example" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6aC-HR-aM0">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<constraints>
<constraint firstItem="6aC-HR-aM0" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="hnJ-jX-Q7o"/>
<constraint firstItem="6aC-HR-aM0" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="i9e-jp-U9f"/>
<constraint firstAttribute="bottom" secondItem="6aC-HR-aM0" secondAttribute="bottom" id="uck-YH-fqc"/>
<constraint firstAttribute="trailing" secondItem="6aC-HR-aM0" secondAttribute="trailing" id="yqw-wr-SkO"/>
</constraints>
<connections>
<outlet property="imageView" destination="6aC-HR-aM0" id="4uF-jM-h1C"/>
</connections>
<point key="canvasLocation" x="839" y="363"/>
</collectionViewCell>
</objects>
</document>
55 changes: 55 additions & 0 deletions Example/Example/IntroViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// IntroViewController.swift
// Example
//
// Created by hiroyuki yoshida on 2016/01/04.
// Copyright © 2016年 hiroyuki yoshida. All rights reserved.
//

import UIKit
import InfiniteCollectionView

final class IntroViewController: UIViewController {
var items = ["1", "2", "3", "4"]
@IBOutlet weak var collectionView: InfiniteCollectionView! {
didSet {
collectionView.infiniteDataSource = self
collectionView.infiniteDelegate = self
collectionView.cellWidth = UIScreen.mainScreen().bounds.width
collectionView.registerNib(IntroCollectionViewCell.nib, forCellWithReuseIdentifier: IntroCollectionViewCell.identifier)
collectionView.pagingEnabled = true
}
}
@IBOutlet weak var layout: UICollectionViewFlowLayout! {
didSet {
layout.scrollDirection = .Horizontal
layout.itemSize = CGSize(width: UIScreen.mainScreen().bounds.width, height: UIScreen.mainScreen().bounds.height)
}
}
@IBOutlet weak var pageControl: UIPageControl! {
didSet {
pageControl.numberOfPages = items.count
}
}
static func createFromStoryboard() -> IntroViewController {
let storyboard = UIStoryboard(name: "Intro", bundle: nil)
return storyboard.instantiateInitialViewController() as! IntroViewController
}
}

// MARK: - InfiniteCollectionViewDataSource, InfiniteCollectionViewDelegate
extension IntroViewController: InfiniteCollectionViewDataSource, InfiniteCollectionViewDelegate {
func numberOfItems(collectionView: UICollectionView) -> Int {
return items.count
}
func cellForItemAtIndexPath(collectionView: UICollectionView, dequeueIndexPath: NSIndexPath, indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(IntroCollectionViewCell.identifier, forIndexPath: dequeueIndexPath) as! IntroCollectionViewCell
cell.configure(dequeueIndexPath: indexPath)
return cell
}
func didSelectCellAtIndexPath(collectionView: UICollectionView, indexPath: NSIndexPath) {
}
func didUpdatePageIndex(index: Int) {
pageControl.currentPage = index
}
}
Loading

0 comments on commit 5ae841a

Please sign in to comment.