Last active
August 29, 2015 14:14
-
-
Save justinmakaila/33ec25a5528737855b92 to your computer and use it in GitHub Desktop.
NibView
This file contains hidden or 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
import UIKit | |
// MARK: - Nib Views | |
/** | |
A protocol to be implemented by all views that implement their | |
presentation through a `.xib`. | |
*/ | |
protocol NibView { | |
/** | |
:returns: UINib instance representing the view. | |
*/ | |
class func nib() -> UINib | |
} | |
/** | |
A protocol to be implemented by views that can be reused and | |
supply their own reuse identifier. | |
*/ | |
protocol ReuseIdentifierProtocol { | |
/** | |
:returns: String reuse identifier to be registered with the view. | |
*/ | |
class func reuseIdentifier() -> String | |
} | |
protocol ReusableViewKind { | |
/* | |
Must return UICollectionElementKindSectionHeader or UICollectionElementKindSectionFooter | |
*/ | |
class func reusableKind() -> String | |
} | |
// MARK: - Table View Cells | |
/** | |
Provides a protocol which combines NibView and ReuseIdentifierProtocol | |
as a convenience for table view cells. | |
*/ | |
protocol CellNibView: NibView, ReuseIdentifierProtocol { } | |
/** | |
Protocol to be implemented by any view which can be reused | |
by UITableView or UICollectionView. | |
*/ | |
protocol ReusableNibView: NibView, ReuseIdentifierProtocol { } | |
protocol ReusableNibViewKind: ReusableNibView, ReusableViewKind { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment