Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
6fbfcb75
Unverified
Commit
6fbfcb75
authored
Jun 26, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: added default registry of CollectionViewCell to CollectionView
parent
fc9c0582
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
7 deletions
+13
-7
Sources/iOS/CardCollectionViewController.swift
+0
-0
Sources/iOS/CollectionView.swift
+10
-6
Sources/iOS/CollectionViewCell.swift
+1
-0
Sources/iOS/CollectionViewController.swift
+2
-1
No files found.
Sources/iOS/CardCollectionViewController.swift
View file @
6fbfcb75
Sources/iOS/CollectionView.swift
View file @
6fbfcb75
...
...
@@ -104,21 +104,24 @@ open class CollectionView: UICollectionView {
An initializer that initializes the object.
- Parameter collectionViewLayout: A UICollectionViewLayout reference.
*/
public
convenience
init
(
collectionViewLayout
layout
:
UICollectionViewLayout
)
{
self
.
init
(
frame
:
.
zero
,
collectionViewLayout
:
layout
)
public
init
(
collectionViewLayout
layout
:
UICollectionViewLayout
)
{
super
.
init
(
frame
:
.
zero
,
collectionViewLayout
:
layout
)
prepare
()
}
/**
An initializer that initializes the object.
- Parameter frame: A CGRect defining the view's frame.
*/
public
convenience
init
(
frame
:
CGRect
)
{
self
.
init
(
frame
:
frame
,
collectionViewLayout
:
CollectionViewLayout
())
public
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
,
collectionViewLayout
:
CollectionViewLayout
())
prepare
()
}
/// A convenience initializer that initializes the object.
public
convenience
init
()
{
self
.
init
(
frame
:
.
zero
)
public
init
()
{
super
.
init
(
frame
:
.
zero
,
collectionViewLayout
:
CollectionViewLayout
())
prepare
()
}
/**
...
...
@@ -131,5 +134,6 @@ open class CollectionView: UICollectionView {
open
func
prepare
()
{
backgroundColor
=
.
white
contentScaleFactor
=
Screen
.
scale
register
(
CollectionViewCell
.
self
,
forCellWithReuseIdentifier
:
"CollectionViewCell"
)
}
}
Sources/iOS/CollectionViewCell.swift
View file @
6fbfcb75
...
...
@@ -251,6 +251,7 @@ open class CollectionViewCell: UICollectionViewCell, Pulseable, PulseableLayer {
when subclassing.
*/
open
func
prepare
()
{
backgroundColor
=
.
white
contentScaleFactor
=
Screen
.
scale
prepareVisualLayer
()
preparePulse
()
...
...
Sources/iOS/CollectionViewController.swift
View file @
6fbfcb75
...
...
@@ -112,6 +112,7 @@ extension CollectionViewController {
}
extension
CollectionViewController
:
CollectionViewDelegate
{}
extension
CollectionViewController
:
CollectionViewDataSource
{
@objc
open
func
numberOfSections
(
in
collectionView
:
UICollectionView
)
->
Int
{
...
...
@@ -125,6 +126,6 @@ extension CollectionViewController: CollectionViewDataSource {
@objc
open
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
return
UICollectionViewCell
(
)
return
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
"CollectionViewCell"
,
for
:
indexPath
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment