Skip to content

Commit bd50a75

Browse files
committed
Fixes issue #1
Add a public initializer for YBSlantedCollectionViewLayoutSizeOptions.
1 parent 5be479a commit bd50a75

16 files changed

Lines changed: 530 additions & 34 deletions

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# YBSlantedCollectionViewLayout CHANGELOG
22

3+
## 2.1.1
4+
* Add a public initializer for YBSlantedCollectionViewLayoutSizeOptions.
5+
36
## 2.1.0
47

58
* Add tests

Source/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.0</string>
18+
<string>2.1.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Source/YBSlantedCollectionViewLayout.swift

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,35 @@ import UIKit;
2727
/// The item size options
2828
public struct YBSlantedCollectionViewLayoutSizeOptions {
2929
/**
30-
* The item height if the scroll direction is setted to `Vertical`.
31-
* Default value is `220`
30+
The item height if the scroll direction is setted to `Vertical`.
31+
Default value is `220`
3232
*/
33-
var VerticalSize: CGFloat = 220
33+
public var verticalSize: CGFloat
3434

3535
/**
36-
* The item width if the scroll direction is setted to `Horizontal`.
37-
* Default value is `290`
36+
The item width if the scroll direction is setted to `Horizontal`.
37+
Default value is `290`
3838
*/
39-
var HorizontalSize: CGFloat = 290
39+
public var horizontalSize: CGFloat
40+
41+
/**
42+
Init with default values
43+
*/
44+
public init() {
45+
self.verticalSize = 220;
46+
self.horizontalSize = 290;
47+
}
48+
49+
/**
50+
Initialize with custom values
51+
52+
- Parameter verticalSize: Cell's height for `Vertical` scroll direction
53+
- Parameter horizontalSize: Cell's width for `Horizontal` scroll direction
54+
*/
55+
public init(verticalSize verticalSize:CGFloat, horizontalSize:CGFloat) {
56+
self.verticalSize = verticalSize;
57+
self.horizontalSize = horizontalSize;
58+
}
4059
}
4160

4261
/**
@@ -116,10 +135,10 @@ public class YBSlantedCollectionViewLayout: UICollectionViewLayout {
116135

117136
internal var size: CGFloat {
118137
if ( hasVerticalDirection ) {
119-
return itemSizeOptions.VerticalSize
138+
return itemSizeOptions.verticalSize
120139
}
121140

122-
return itemSizeOptions.HorizontalSize
141+
return itemSizeOptions.horizontalSize
123142
}
124143

125144
internal var hasVerticalDirection: Bool {

YBSlantedCollectionViewLayout.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "YBSlantedCollectionViewLayout"
3-
s.version = "2.1.0"
3+
s.version = "2.1.1"
44
s.summary = "UICollectionViewLayout allowing the display of slanted content on UICollectionView"
55

66
s.description = <<-DESC

docs/Classes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<a href="Structs.html">Structs</a>
4040
<ul class="nav-group-tasks">
4141
<li class="nav-group-task">
42-
<a href="Structs.html#/s:V29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptions">YBSlantedCollectionViewLayoutSizeOptions</a>
42+
<a href="Structs/YBSlantedCollectionViewLayoutSizeOptions.html">YBSlantedCollectionViewLayoutSizeOptions</a>
4343
</li>
4444
</ul>
4545
</li>
@@ -92,7 +92,7 @@ <h4>Declaration</h4>
9292
</section>
9393
</section>
9494
<section id="footer">
95-
<p>&copy; 2016 <a class="link" href="https://linkedin.com/in/yassir-barchi-318a7949" target="_blank" rel="external">Yassir</a>. All rights reserved. (Last updated: 2016-03-11)</p>
95+
<p>&copy; 2016 <a class="link" href="https://linkedin.com/in/yassir-barchi-318a7949" target="_blank" rel="external">Yassir</a>. All rights reserved. (Last updated: 2016-09-05)</p>
9696
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
9797
</section>
9898
</article>

docs/Classes/YBSlantedCollectionViewLayout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<a href="../Structs.html">Structs</a>
4141
<ul class="nav-group-tasks">
4242
<li class="nav-group-task">
43-
<a href="../Structs.html#/s:V29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptions">YBSlantedCollectionViewLayoutSizeOptions</a>
43+
<a href="../Structs/YBSlantedCollectionViewLayoutSizeOptions.html">YBSlantedCollectionViewLayoutSizeOptions</a>
4444
</li>
4545
</ul>
4646
</li>
@@ -431,7 +431,7 @@ <h4>Declaration</h4>
431431
</section>
432432
</section>
433433
<section id="footer">
434-
<p>&copy; 2016 <a class="link" href="https://linkedin.com/in/yassir-barchi-318a7949" target="_blank" rel="external">Yassir</a>. All rights reserved. (Last updated: 2016-03-11)</p>
434+
<p>&copy; 2016 <a class="link" href="https://linkedin.com/in/yassir-barchi-318a7949" target="_blank" rel="external">Yassir</a>. All rights reserved. (Last updated: 2016-09-05)</p>
435435
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
436436
</section>
437437
</article>

docs/Structs.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<a href="Structs.html">Structs</a>
4040
<ul class="nav-group-tasks">
4141
<li class="nav-group-task">
42-
<a href="Structs.html#/s:V29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptions">YBSlantedCollectionViewLayoutSizeOptions</a>
42+
<a href="Structs/YBSlantedCollectionViewLayoutSizeOptions.html">YBSlantedCollectionViewLayoutSizeOptions</a>
4343
</li>
4444
</ul>
4545
</li>
@@ -70,6 +70,7 @@ <h1>Structs</h1>
7070
<div class="abstract">
7171
<p>The item size options</p>
7272

73+
<a href="Structs/YBSlantedCollectionViewLayoutSizeOptions.html" class="slightly-smaller">See more</a>
7374
</div>
7475
<div class="declaration">
7576
<h4>Declaration</h4>
@@ -87,7 +88,7 @@ <h4>Declaration</h4>
8788
</section>
8889
</section>
8990
<section id="footer">
90-
<p>&copy; 2016 <a class="link" href="https://linkedin.com/in/yassir-barchi-318a7949" target="_blank" rel="external">Yassir</a>. All rights reserved. (Last updated: 2016-03-11)</p>
91+
<p>&copy; 2016 <a class="link" href="https://linkedin.com/in/yassir-barchi-318a7949" target="_blank" rel="external">Yassir</a>. All rights reserved. (Last updated: 2016-09-05)</p>
9192
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
9293
</section>
9394
</article>
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>YBSlantedCollectionViewLayoutSizeOptions Struct Reference</title>
5+
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
6+
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
7+
<meta charset='utf-8'>
8+
<script src="../js/jquery.min.js" defer></script>
9+
<script src="../js/jazzy.js" defer></script>
10+
11+
</head>
12+
<body>
13+
<a name="//apple_ref/swift/Struct/YBSlantedCollectionViewLayoutSizeOptions" class="dashAnchor"></a>
14+
<a title="YBSlantedCollectionViewLayoutSizeOptions Struct Reference"></a>
15+
<header>
16+
<div class="content-wrapper">
17+
<p><a href="../index.html">YBSlantedCollectionViewLayout Docs</a> (100% documented)</p>
18+
<p class="header-right"><a href="https://github.com/yacir/YBSlantedCollectionViewLayout"><img src="../img/gh.png"/>View on GitHub</a></p>
19+
</div>
20+
</header>
21+
<div class="content-wrapper">
22+
<p id="breadcrumbs">
23+
<a href="../index.html">YBSlantedCollectionViewLayout Reference</a>
24+
<img id="carat" src="../img/carat.png" />
25+
YBSlantedCollectionViewLayoutSizeOptions Struct Reference
26+
</p>
27+
</div>
28+
<div class="content-wrapper">
29+
<nav class="sidebar">
30+
<ul class="nav-groups">
31+
<li class="nav-group-name">
32+
<a href="../Classes.html">Classes</a>
33+
<ul class="nav-group-tasks">
34+
<li class="nav-group-task">
35+
<a href="../Classes/YBSlantedCollectionViewLayout.html">YBSlantedCollectionViewLayout</a>
36+
</li>
37+
</ul>
38+
</li>
39+
<li class="nav-group-name">
40+
<a href="../Structs.html">Structs</a>
41+
<ul class="nav-group-tasks">
42+
<li class="nav-group-task">
43+
<a href="../Structs/YBSlantedCollectionViewLayoutSizeOptions.html">YBSlantedCollectionViewLayoutSizeOptions</a>
44+
</li>
45+
</ul>
46+
</li>
47+
</ul>
48+
</nav>
49+
<article class="main-content">
50+
<section>
51+
<section class="section">
52+
<h1>YBSlantedCollectionViewLayoutSizeOptions</h1>
53+
<div class="declaration">
54+
<div class="language">
55+
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">YBSlantedCollectionViewLayoutSizeOptions</span></code></pre>
56+
57+
</div>
58+
</div>
59+
<p>The item size options</p>
60+
61+
</section>
62+
<section class="section task-group-section">
63+
<div class="task-group">
64+
<ul>
65+
<li class="item">
66+
<div>
67+
<code>
68+
<a name="/s:vV29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptions12verticalSizeV12CoreGraphics7CGFloat"></a>
69+
<a name="//apple_ref/swift/Property/verticalSize" class="dashAnchor"></a>
70+
<a class="token" href="#/s:vV29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptions12verticalSizeV12CoreGraphics7CGFloat">verticalSize</a>
71+
</code>
72+
</div>
73+
<div class="height-container">
74+
<div class="pointer-container"></div>
75+
<section class="section">
76+
<div class="pointer"></div>
77+
<div class="abstract">
78+
<p>The item height if the scroll direction is setted to <code>Vertical</code>.
79+
Default value is <code>220</code></p>
80+
81+
</div>
82+
<div class="declaration">
83+
<h4>Declaration</h4>
84+
<div class="language">
85+
<p class="aside-title">Swift</p>
86+
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">verticalSize</span><span class="p">:</span> <span class="kt">CGFloat</span></code></pre>
87+
88+
</div>
89+
</div>
90+
</section>
91+
</div>
92+
</li>
93+
<li class="item">
94+
<div>
95+
<code>
96+
<a name="/s:vV29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptions14horizontalSizeV12CoreGraphics7CGFloat"></a>
97+
<a name="//apple_ref/swift/Property/horizontalSize" class="dashAnchor"></a>
98+
<a class="token" href="#/s:vV29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptions14horizontalSizeV12CoreGraphics7CGFloat">horizontalSize</a>
99+
</code>
100+
</div>
101+
<div class="height-container">
102+
<div class="pointer-container"></div>
103+
<section class="section">
104+
<div class="pointer"></div>
105+
<div class="abstract">
106+
<p>The item width if the scroll direction is setted to <code>Horizontal</code>.
107+
Default value is <code>290</code></p>
108+
109+
</div>
110+
<div class="declaration">
111+
<h4>Declaration</h4>
112+
<div class="language">
113+
<p class="aside-title">Swift</p>
114+
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">horizontalSize</span><span class="p">:</span> <span class="kt">CGFloat</span></code></pre>
115+
116+
</div>
117+
</div>
118+
</section>
119+
</div>
120+
</li>
121+
<li class="item">
122+
<div>
123+
<code>
124+
<a name="/s:FV29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptionscFT_S0_"></a>
125+
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
126+
<a class="token" href="#/s:FV29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptionscFT_S0_">init()</a>
127+
</code>
128+
</div>
129+
<div class="height-container">
130+
<div class="pointer-container"></div>
131+
<section class="section">
132+
<div class="pointer"></div>
133+
<div class="abstract">
134+
<p>Init with default values</p>
135+
136+
</div>
137+
<div class="declaration">
138+
<h4>Declaration</h4>
139+
<div class="language">
140+
<p class="aside-title">Swift</p>
141+
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">()</span></code></pre>
142+
143+
</div>
144+
</div>
145+
</section>
146+
</div>
147+
</li>
148+
<li class="item">
149+
<div>
150+
<code>
151+
<a name="/s:FV29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptionscFT12verticalSizeV12CoreGraphics7CGFloat14horizontalSizeS2__S0_"></a>
152+
<a name="//apple_ref/swift/Method/init(verticalSize:horizontalSize:)" class="dashAnchor"></a>
153+
<a class="token" href="#/s:FV29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptionscFT12verticalSizeV12CoreGraphics7CGFloat14horizontalSizeS2__S0_">init(verticalSize:horizontalSize:)</a>
154+
</code>
155+
</div>
156+
<div class="height-container">
157+
<div class="pointer-container"></div>
158+
<section class="section">
159+
<div class="pointer"></div>
160+
<div class="abstract">
161+
<p>Initialize with custom values</p>
162+
163+
<div class="aside aside-parameter">
164+
<p class="aside-title">Parameter</p>
165+
Parameter verticalSize: Cell&rsquo;s height for <code>Vertical</code> scroll direction
166+
167+
</div>
168+
169+
<div class="aside aside-parameter">
170+
<p class="aside-title">Parameter</p>
171+
Parameter horizontalSize: Cell&rsquo;s width for <code>Horizontal</code> scroll direction
172+
173+
</div>
174+
175+
</div>
176+
<div class="declaration">
177+
<h4>Declaration</h4>
178+
<div class="language">
179+
<p class="aside-title">Swift</p>
180+
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">verticalSize</span> <span class="nv">verticalSize</span><span class="p">:</span><span class="kt">CGFloat</span><span class="p">,</span> <span class="nv">horizontalSize</span><span class="p">:</span><span class="kt">CGFloat</span><span class="p">)</span></code></pre>
181+
182+
</div>
183+
</div>
184+
<div>
185+
<h4>Parameters</h4>
186+
<table class="graybox">
187+
<tbody>
188+
<tr>
189+
<td>
190+
<code>
191+
<em>verticalSize</em>
192+
</code>
193+
</td>
194+
<td>
195+
<div>
196+
<p>Cell&rsquo;s height for <code>Vertical</code> scroll direction</p>
197+
198+
</div>
199+
</td>
200+
</tr>
201+
<tr>
202+
<td>
203+
<code>
204+
<em>horizontalSize</em>
205+
</code>
206+
</td>
207+
<td>
208+
<div>
209+
<p>Cell&rsquo;s width for <code>Horizontal</code> scroll direction</p>
210+
211+
</div>
212+
</td>
213+
</tr>
214+
</tbody>
215+
</table>
216+
</div>
217+
</section>
218+
</div>
219+
</li>
220+
</ul>
221+
</div>
222+
</section>
223+
</section>
224+
<section id="footer">
225+
<p>&copy; 2016 <a class="link" href="https://linkedin.com/in/yassir-barchi-318a7949" target="_blank" rel="external">Yassir</a>. All rights reserved. (Last updated: 2016-09-05)</p>
226+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
227+
</section>
228+
</article>
229+
</div>
230+
</body>
231+
</div>
232+
</html>

docs/docsets/YBSlantedCollectionViewLayout.docset/Contents/Resources/Documents/Classes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<a href="Structs.html">Structs</a>
4040
<ul class="nav-group-tasks">
4141
<li class="nav-group-task">
42-
<a href="Structs.html#/s:V29YBSlantedCollectionViewLayout40YBSlantedCollectionViewLayoutSizeOptions">YBSlantedCollectionViewLayoutSizeOptions</a>
42+
<a href="Structs/YBSlantedCollectionViewLayoutSizeOptions.html">YBSlantedCollectionViewLayoutSizeOptions</a>
4343
</li>
4444
</ul>
4545
</li>
@@ -92,7 +92,7 @@ <h4>Declaration</h4>
9292
</section>
9393
</section>
9494
<section id="footer">
95-
<p>&copy; 2016 <a class="link" href="https://linkedin.com/in/yassir-barchi-318a7949" target="_blank" rel="external">Yassir</a>. All rights reserved. (Last updated: 2016-03-11)</p>
95+
<p>&copy; 2016 <a class="link" href="https://linkedin.com/in/yassir-barchi-318a7949" target="_blank" rel="external">Yassir</a>. All rights reserved. (Last updated: 2016-09-05)</p>
9696
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
9797
</section>
9898
</article>

0 commit comments

Comments
 (0)