File tree Expand file tree Collapse file tree 4 files changed +10
-27
lines changed Expand file tree Collapse file tree 4 files changed +10
-27
lines changed Original file line number Diff line number Diff line change @@ -149,19 +149,11 @@ - (NSInteger)numberOfThumbnailsInRowForThumbnailGridView:(VCThumbnailGridView *)
149
149
return 3 ;
150
150
}
151
151
152
- - (UIImage *)thumbnailGridView : (VCThumbnailGridView*)thumbnailGridView imageAtIndex : (NSInteger )index
152
+ - (VCThumbnailView *)thumbnailGridView : (VCThumbnailGridView *)thumbnailGridView thumbnailViewAtIndex : (NSInteger )index
153
153
{
154
- return [UIImage imageNamed: @" Icon.png" ];
155
- }
156
-
157
- - (NSString *)thumbnailGridView : (VCThumbnailGridView*)thumbnailGridView imageUrlAtIndex : (NSInteger )index
158
- {
159
- static bool something = false ;
160
- something = !something;
161
- if (something) {
162
- return [NSString stringWithString: @" http://images.apple.com/support/home/images/featured_itunes.png" ];
163
- }
164
- return nil ;
154
+ VCThumbnailView *thumbnailView = [[VCThumbnailView alloc ] initWithFrame: CGRectZero];
155
+ [thumbnailView setImage: [UIImage imageNamed: @" Icon.png" ]];
156
+ return [thumbnailView autorelease ];
165
157
}
166
158
167
159
#pragma mark - VCThumbnailGridViewDelegate
Original file line number Diff line number Diff line change 33
33
34
34
#import < UIKit/UIKit.h>
35
35
36
+ #import " VCThumbnailViewCell.h"
37
+
36
38
@protocol VCThumbnailGridViewDataSource;
37
39
@protocol VCThumbnailGridViewDelegate;
38
40
39
41
@class VCThumbnailView;
40
- @class VCThumbnailViewCell;
41
42
42
43
@interface VCThumbnailGridView : UIView <UITableViewDataSource, UITableViewDelegate> {
43
44
@private
68
69
@optional
69
70
- (NSInteger )numberOfThumbnailsInRowForThumbnailGridView : (VCThumbnailGridView *)thumbnailGridView ;
70
71
- (VCThumbnailView *)thumbnailGridView : (VCThumbnailGridView *)thumbnailGridView thumbnailViewAtIndex : (NSInteger )index ;
71
- - (UIImage *)thumbnailGridView : (VCThumbnailGridView *)thumbnailGridView imageAtIndex : (NSInteger )index ;
72
+ // - (UIImage *)thumbnailGridView:(VCThumbnailGridView *)thumbnailGridView imageAtIndex:(NSInteger)index;
72
73
73
74
@end
74
75
Original file line number Diff line number Diff line change @@ -140,7 +140,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
140
140
int indexOfImage = indexPath.row * _numberOfThumbnailsInRow;
141
141
142
142
VCThumbnailView *thumbnail = nil ;
143
- BOOL respondsToSelectorImage = [self .dataSource respondsToSelector: @selector (thumbnailGridView:imageAtIndex: )];
144
143
BOOL respondsToSelectorView = [self .dataSource respondsToSelector: @selector (thumbnailGridView:thumbnailViewAtIndex: )];
145
144
for (int i = 0 ; i < _numberOfThumbnailsInRow; i++) {
146
145
if (indexOfImage < _numberOfThumbnails) {
@@ -153,25 +152,16 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
153
152
}
154
153
155
154
// set proerties
156
- thumbnail.backgroundColor = [UIColor whiteColor ];
155
+ thumbnail.tag = indexOfImage;
156
+ [thumbnail addTarget: self withSelector: @selector (didTapImageThumbnail: )];
157
157
[cell addSubview: thumbnail];
158
158
[cell.thumbnails addObject: thumbnail];
159
-
160
- thumbnail.hidden = NO ;
161
- if (respondsToSelectorImage) {
162
- [thumbnail setImage: [self .dataSource thumbnailGridView: self imageAtIndex: indexOfImage]];
163
- [thumbnail addTarget: self withSelector: @selector (didTapImageThumbnail: )];
164
- }
165
159
thumbnail.tag = indexOfImage++;
166
- }else {
167
- thumbnail.hidden = YES ;
168
160
}
169
-
170
161
thumbnail = nil ;
171
162
}
172
163
}
173
164
174
-
175
165
return cell;
176
166
}
177
167
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ - (id)initWithFrame:(CGRect)frame {
44
44
shouldAutoRotateToFit = NO ;
45
45
self.autoresizesSubviews = YES ;
46
46
self.backgroundColor = [UIColor clearColor ];
47
- self.userInteractionEnabled = NO ;
47
+ self.userInteractionEnabled = YES ;
48
48
self.contentMode = UIViewContentModeScaleAspectFit;
49
49
self.layer .borderColor = [[UIColor lightGrayColor ] CGColor ];
50
50
self.layer .borderWidth = 1 .0f ;
You can’t perform that action at this time.
0 commit comments