-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// GridCollectionReusableView.swift | ||
// Hagrid | ||
// | ||
// Created by Ondrej Rafaj on 20/06/2018. | ||
// Copyright © 2018 LiveUI. All rights reserved. | ||
// | ||
|
||
#if os(iOS) || os(tvOS) | ||
@_exported import Foundation | ||
@_exported import UIKit | ||
@_exported import SnapKit | ||
|
||
|
||
/// Grid view enabled collection reusable view | ||
open class GridCollectionReusableView: UICollectionReusableView { | ||
|
||
/// Grid view | ||
public let gridView = GridView() | ||
|
||
// MARK: Initialization | ||
|
||
/// Initializer | ||
override public init(frame rect: CGRect) { | ||
super.init(frame: rect) | ||
|
||
addSubview(gridView) | ||
gridView.snp.makeConstraints { make in | ||
make.edges.equalToSuperview() | ||
} | ||
} | ||
|
||
@available(*, unavailable, message: "This method is unavailable") | ||
required public init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// GridCollectionViewCell.swift | ||
// Hagrid | ||
// | ||
// Created by Ondrej Rafaj on 20/06/2018. | ||
// Copyright © 2018 LiveUI. All rights reserved. | ||
// | ||
|
||
#if os(iOS) || os(tvOS) | ||
@_exported import Foundation | ||
@_exported import UIKit | ||
@_exported import SnapKit | ||
|
||
|
||
/// Grid view enabled collection view cell | ||
open class GridCollectionViewCell: UICollectionViewCell { | ||
|
||
/// Grid view | ||
public let gridView = GridView() | ||
|
||
@available(*, unavailable, message: "This method is unavailable", renamed: "gridView") | ||
override open var contentView: UIView { | ||
get { return super.contentView } | ||
} | ||
|
||
// MARK: Initialization | ||
|
||
/// Initializer | ||
override public init(frame rect: CGRect) { | ||
super.init(frame: rect) | ||
|
||
super.contentView.addSubview(gridView) | ||
gridView.snp.makeConstraints { make in | ||
make.edges.equalToSuperview() | ||
} | ||
} | ||
|
||
@available(*, unavailable, message: "This method is unavailable") | ||
required public init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters