Created
April 27, 2016 09:23
-
-
Save lukedesu/96fb90daef3c7b7eb8767aad0893d5fe to your computer and use it in GitHub Desktop.
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
// | |
// messageDetailViewController.swift | |
// testapp | |
// | |
// Created by SenseLuo on 4/27/16. | |
// Copyright © 2016 Unicorn, Inc. All rights reserved. | |
// | |
import UIKit | |
class myCollectionViewController: UICollectionViewController { | |
private let detailCellId = "detailCellId" | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
collectionView?.backgroundColor = UIColor.whiteColor() | |
collectionView?.registerClass(detailCell.self, forCellWithReuseIdentifier: detailCellId) | |
} | |
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { | |
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(detailCellId, forIndexPath: indexPath) as! detailCell | |
return cell | |
} | |
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | |
return 3 | |
} | |
} | |
class detailCell: UICollectionViewCell { | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
setupViews() | |
} | |
required init?(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
func setupViews() { | |
backgroundColor = UIColor.redColor() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment