Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CollectionView #59

Merged
merged 9 commits into from Mar 8, 2019

Conversation

@hodovani
Copy link
Collaborator

commented Mar 7, 2019

Resolve #20

@hodovani hodovani self-assigned this Mar 7, 2019

fatalError("incorrect props type stored in CollectionView node")
}

return CollectionViewBox<T>(view, viewController, component, props, renderer)

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Line Length Violation: Line should be 80 characters or less: currently 81 characters (line_length)

}
}

private final class Delegate<T: CellProvider>: NSObject, UICollectionViewDelegate {

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Line Length Violation: Line should be 80 characters or less: currently 83 characters (line_length)

import UIKit

final class TokamakCollectionCell: UICollectionViewCell {
// FIXME: `component` has a strong reference to `box` through its own

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Todo Violation: FIXMEs should be resolved (component has a strong refer...). (todo)

@hodovani hodovani marked this pull request as ready for review Mar 7, 2019

@hodovani hodovani requested a review from MaxDesiatov Mar 7, 2019

}
}
}

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

// this delegate stays as a constant and doesn't create a reference cycle
// swiftlint:disable:next weak_delegate
private let delegate: Delegate<T>

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)


final class CollectionViewBox<T: CellProvider>: ViewBox<TokamakCollectionView> {
private let dataSource: DataSource<T>

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

) {
onSelect?(CellPath(indexPath))
}

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)


private final class Delegate<T: CellProvider>: NSObject, UICollectionViewDelegate {
var onSelect: ((CellPath) -> ())?

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

weak var viewController: UIViewController?
weak var renderer: UIKitRenderer?
var props: CollectionView<T>.Props

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

_reuseIdentifier = reuseIdentifier
super.init(frame: .zero)
}

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

override var reuseIdentifier: String? {
return _reuseIdentifier
}

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

fileprivate var component: UIKitRenderer.Mounted?

private let _reuseIdentifier: String

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

// property `target`, should that be `weak` to break a potential reference
// cycle?
fileprivate var component: UIKitRenderer.Mounted?

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 7, 2019

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)

@codecov-io

This comment has been minimized.

Copy link

commented Mar 7, 2019

Codecov Report

Merging #59 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #59   +/-   ##
=======================================
  Coverage   95.66%   95.66%           
=======================================
  Files           5        5           
  Lines         369      369           
=======================================
  Hits          353      353           
  Misses         16       16

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7b5384...252794b. Read the comment docs.

view.delegate = delegate

for id in T.Identifier.allCases {
view.register(TokamakCollectionCell.self, forCellWithReuseIdentifier: id.rawValue)

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 8, 2019

Line Length Violation: Line should be 80 characters or less: currently 88 characters (line_length)


final class TokamakCollectionView: UICollectionView, Default {
static var defaultValue: TokamakCollectionView {
return TokamakCollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout())

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Mar 8, 2019

Line Length Violation: Line should be 80 characters or less: currently 98 characters (line_length)

hodovani added some commits Mar 8, 2019

@hodovani hodovani merged commit bb0b585 into master Mar 8, 2019

4 of 5 checks passed

Hound 1 violation found.
codecov/patch Coverage not affected when comparing f7b5384...252794b
Details
codecov/project 95.66% remains the same compared to f7b5384
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@delete-merged-branch delete-merged-branch bot deleted the collection-view branch Mar 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.