IGListKit/Examples/Examples-tvOS/IGListKitExamples/Views/EmbeddedCollectionViewCell.swift
Shukhrat Tursunov 67eaf0e999 Focus in tvOS app
Summary:
fixed #261
Closes https://github.com/Instagram/IGListKit/pull/262

Differential Revision: D4235651

Pulled By: jessesquires

fbshipit-source-id: 9777927d2c1c89ad838197fc10db81a069bbf197
2016-11-27 16:59:00 -08:00

42 lines
1.4 KiB
Swift

/**
Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
The examples provided by Facebook are for non-commercial testing and evaluation
purposes only. Facebook reserves all rights not expressly granted.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import UIKit
import IGListKit
final class EmbeddedCollectionViewCell: UICollectionViewCell {
lazy var collectionView: IGListCollectionView = {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .horizontal
let view = IGListCollectionView(frame: .zero, collectionViewLayout: layout)
view.backgroundColor = .clear
view.alwaysBounceVertical = false
view.alwaysBounceHorizontal = true
self.contentView.addSubview(view)
return view
}()
override func layoutSubviews() {
super.layoutSubviews()
collectionView.frame = contentView.frame
}
override var canBecomeFocused: Bool {
get {
return false
}
}
}