Skip to content

Commit 1f7d9d8

Browse files
author
Nikita Egoshin
committed
~ collectionView is now outlet
1 parent 2f87931 commit 1f7d9d8

File tree

6 files changed

+140
-96
lines changed

6 files changed

+140
-96
lines changed

Example/ORCarousel/Base.lproj/Main.storyboard

Lines changed: 31 additions & 3 deletions
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="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.17" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
33
<device id="retina4_0" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.14"/>
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1010
</dependencies>
1111
<scenes>
@@ -50,13 +50,41 @@
5050
</view>
5151
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YxL-TF-6Nq" customClass="ORCarousel" customModule="ORCarousel">
5252
<rect key="frame" x="0.0" y="128" width="320" height="50"/>
53+
<subviews>
54+
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="uv4-Y8-5Rh">
55+
<rect key="frame" x="20" y="0.0" width="280" height="50"/>
56+
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="fSw-Yc-ljj">
57+
<size key="itemSize" width="50" height="50"/>
58+
<size key="headerReferenceSize" width="0.0" height="0.0"/>
59+
<size key="footerReferenceSize" width="0.0" height="0.0"/>
60+
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
61+
</collectionViewFlowLayout>
62+
<cells>
63+
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="lEc-NA-qRP">
64+
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
65+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
66+
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
67+
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
68+
<autoresizingMask key="autoresizingMask"/>
69+
</view>
70+
</collectionViewCell>
71+
</cells>
72+
</collectionView>
73+
</subviews>
5374
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
5475
<constraints>
76+
<constraint firstAttribute="bottom" secondItem="uv4-Y8-5Rh" secondAttribute="bottom" id="EO4-I2-Ydp"/>
77+
<constraint firstAttribute="trailing" secondItem="uv4-Y8-5Rh" secondAttribute="trailing" constant="20" id="Kyu-kn-BtV"/>
78+
<constraint firstItem="uv4-Y8-5Rh" firstAttribute="top" secondItem="YxL-TF-6Nq" secondAttribute="top" id="ePv-RL-OHc"/>
5579
<constraint firstAttribute="height" constant="50" id="lMD-vB-ofk"/>
80+
<constraint firstItem="uv4-Y8-5Rh" firstAttribute="leading" secondItem="YxL-TF-6Nq" secondAttribute="leading" constant="20" id="uRn-12-wHA"/>
5681
</constraints>
5782
<userDefinedRuntimeAttributes>
5883
<userDefinedRuntimeAttribute type="boolean" keyPath="showScrollIndicator" value="NO"/>
5984
</userDefinedRuntimeAttributes>
85+
<connections>
86+
<outlet property="collectionView" destination="uv4-Y8-5Rh" id="kqO-Js-QDk"/>
87+
</connections>
6088
</view>
6189
</subviews>
6290
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -80,7 +108,7 @@
80108
<outlet property="bottomCarousel" destination="CKM-d1-7dH" id="3DP-QA-OWf"/>
81109
<outlet property="dayCarousel" destination="mbI-Kh-uaP" id="eAq-X0-nwH"/>
82110
<outlet property="monthCarousel" destination="NGX-AU-arZ" id="Dv5-G0-tnc"/>
83-
<outlet property="yearCarousel" destination="YxL-TF-6Nq" id="89i-MI-HK1"/>
111+
<outlet property="yearCarousel" destination="YxL-TF-6Nq" id="seo-CG-OUc"/>
84112
</connections>
85113
</viewController>
86114
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>

Example/ORCarousel/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>2</string>
22+
<string>3</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UILaunchStoryboardName</key>

Example/ORCarousel/ViewController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ class ViewController: UIViewController, ORCarouselDelegate {
6161

6262
@IBOutlet weak var bottomCarousel: ORCarousel!
6363

64-
var dateItems = [Date(day: 5, month: 2, year: 1986), Date(day: 17, month: 10, year: 1972), Date(day: 11, month: 4, year: 1994), Date(day: 21, month: 8, year: 2005), Date(day: 30, month: 10, year: 1990), Date(day: 29, month: 9, year: 2012)]
64+
// var dateItems = [Date(day: 5, month: 2, year: 1986), Date(day: 17, month: 10, year: 1972), Date(day: 11, month: 4, year: 1994), Date(day: 21, month: 8, year: 2005), Date(day: 30, month: 10, year: 1990), Date(day: 29, month: 9, year: 2012)]
65+
66+
var dateItems: [Date] = []
6567

6668
var dayRange: Range<Int> {
6769
let calendar = Calendar.current
@@ -106,7 +108,7 @@ class ViewController: UIViewController, ORCarouselDelegate {
106108
override func viewDidAppear(_ animated: Bool) {
107109
super.viewDidAppear(animated)
108110

109-
let defaultDate = dateItems[kDefaultDateIndex]
111+
let defaultDate = Date()
110112
selectedDate = SelectedDate(defaultDate)
111113

112114
dayCarousel.reloadData()

Example/Pods/Target Support Files/ORCarousel/Info.plist

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ORCarousel.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'ORCarousel'
11-
s.version = '0.2.1'
11+
s.version = '0.2.2'
1212
s.summary = 'The wrapper for collection view, that implements infinite scroll'
1313

1414
# This description is used to generate tags and improve search results.

0 commit comments

Comments
 (0)