Skip to content

Commit d7a0603

Browse files
committedDec 21, 2017
collectionView
1 parent cce03f6 commit d7a0603

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed
 

‎SomoDemo/SomoDemo.xcodeproj/project.pbxproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@
134134
98F5EAEE1FC6B58E00D91FA1 /* Somo */ = {
135135
isa = PBXGroup;
136136
children = (
137+
98F5EB081FC91F3C00D91FA1 /* Somo.h */,
137138
98F5EAEF1FC6B69D00D91FA1 /* UIView+SomoSkeleton.h */,
138139
98F5EAF01FC6B69D00D91FA1 /* UIView+SomoSkeleton.m */,
139140
98F5EAF31FC7F92D00D91FA1 /* SomoView.h */,
140141
98F5EAF41FC7F92D00D91FA1 /* SomoView.m */,
141-
98F5EAF61FC7F9F600D91FA1 /* SomoSkeletonLayoutProtocol.h */,
142-
98F5EB081FC91F3C00D91FA1 /* Somo.h */,
143-
98D3E36A1FC95EEA007F5A97 /* SomoDefines.h */,
144142
9836566B1FD798CF008F57D4 /* SomoDataSourceProvider.h */,
145143
9836566C1FD798CF008F57D4 /* SomoDataSourceProvider.m */,
144+
98D3E36A1FC95EEA007F5A97 /* SomoDefines.h */,
145+
98F5EAF61FC7F9F600D91FA1 /* SomoSkeletonLayoutProtocol.h */,
146146
);
147147
path = Somo;
148148
sourceTree = "<group>";

‎SomoDemo/SomoDemo/Somo/SomoDataSourceProvider.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#import <Foundation/Foundation.h>
1212
#import <UIKit/UIKit.h>
1313

14-
@interface SomoDataSourceProvider : NSObject<UITableViewDataSource,UITableViewDelegate>
14+
@interface SomoDataSourceProvider : NSObject<UITableViewDataSource,UITableViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource>
1515

1616
/**
1717
default 15

‎SomoDemo/SomoDemo/Somo/SomoDataSourceProvider.m

+16-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ @implementation SomoDataSourceProvider
1919
- (instancetype)initWithCellReuseIdentifier:(NSString *)reuseIdentifier{
2020
if (self = [super init]) {
2121
_reuseIdentifier = reuseIdentifier;
22-
_numberOfRowsInSection = 15;
22+
_numberOfRowsInSection = 30;
2323
}
2424
return self;
2525
}
@@ -41,4 +41,19 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)ce
4141
[cell beginSomo];
4242
}
4343

44+
#pragma mark - collection
45+
46+
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
47+
return self.numberOfRowsInSection;
48+
}
49+
50+
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
51+
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:_reuseIdentifier forIndexPath:indexPath];
52+
return cell;
53+
}
54+
55+
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath{
56+
[cell beginSomo];
57+
}
58+
4459
@end

‎SomoDemo/SomoDemo/Somo/SomoView.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ - (void)setAnimationStyle:(SomoAnimationStyle)animationStyle{
6060

6161
- (void)_setup{
6262
_somoColor = SomoColorFromRGBV(150);
63-
_animationStyle = SomoAnimationStyleSolid;
63+
_animationStyle = SomoAnimationStyleGradientVertical;
6464
self.backgroundColor = self.somoColor;
6565
self.layer.masksToBounds = YES;
6666
[self _animate];

0 commit comments

Comments
 (0)