OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 @class MDCCollectionViewCell; |
| 11 |
| 12 // CollectionViewItem holds the model data for a given collection view item. |
| 13 @interface CollectionViewItem : NSObject<UIAccessibilityIdentification> |
| 14 |
| 15 // A client-defined value. It should be unique among items of a given collection |
| 16 // view model. |
| 17 @property(nonatomic, readonly, assign) NSInteger type; |
| 18 |
| 19 // The cell class to use in conjunction with this item. Must be a subclass of |
| 20 // MDCCollectionViewCell. The default is MDCCollectionViewCell. |
| 21 @property(nonatomic, assign) Class cellClass; |
| 22 |
| 23 - (instancetype)initWithType:(NSInteger)type NS_DESIGNATED_INITIALIZER; |
| 24 - (instancetype)init NS_UNAVAILABLE; |
| 25 |
| 26 // Configures the given cell with the item's information. Override this method |
| 27 // to specialize. At this level, only accessibility properties are ported from |
| 28 // the item to the cell. |
| 29 // The cell's class must match cellClass for the given instance. |
| 30 - (void)configureCell:(MDCCollectionViewCell*)cell NS_REQUIRES_SUPER; |
| 31 |
| 32 @end |
| 33 |
| 34 #endif // IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_H_ |
OLD | NEW |