Skip to content

Commit

Permalink
Merge pull request #1 from zhangao0086/1.0.0
Browse files Browse the repository at this point in the history
supports default image
  • Loading branch information
zhangao0086 committed Nov 13, 2014
2 parents da13f73 + d16c7bc commit 49f2126
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DKCarouselView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.platform = :ios, "6.0"
s.source = { :git => "https://github.com/zhangao0086/DKCarouselView.git",
:tag => s.version.to_s }
s.source_files = "DKCarouselView.{h,m}"
s.source_files = "DKCarouselView/*.{h,m}"
s.frameworks = "Foundation", "UIKit"
s.requires_arc = true
s.dependency "SDWebImage", "~> 3.7.1"
Expand Down
6 changes: 5 additions & 1 deletion DKCarouselView/DKCarouselView.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ typedef void(^ItemClicked)(DKCarouselItem *ad, NSInteger index);

@interface DKCarouselView : UIView

//@property (nonatomic, assign) BOOL stretchingImage;
@property (nonatomic, readonly) NSUInteger numberOfItems;

@property (nonatomic, copy) ItemClicked itemClickedBlock;

/**
* Placeholder For DKCarouselURLItem
*/
@property (nonatomic, strong) UIImage *defaultImage;

-(void)setItems:(NSArray *)items;

-(void)setAutoPagingForInterval:(NSTimeInterval)timeInterval;
Expand Down
9 changes: 1 addition & 8 deletions DKCarouselView/DKCarouselView.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ -(void)setItems:(NSArray *)items{
itemView.userInteractionEnabled = YES;
if ([item isKindOfClass:[DKCarouselURLItem class]]) {
NSString *imageUrl = [(DKCarouselURLItem *)item imageUrl];
[itemView sd_setImageWithURL:[NSURL URLWithString:imageUrl]];
[itemView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:self.defaultImage];
} else if ([item isKindOfClass:[DKCarouselViewItem class]]) {
UIView *customView = [(DKCarouselViewItem *)item view];
[itemView addSubview:customView];
Expand All @@ -201,13 +201,6 @@ -(void)setItems:(NSArray *)items{
[self setNeedsLayout];
}

//-(void)setStretchingImage:(BOOL)stretchingImage{
// _stretchingImage = stretchingImage;
// for (UIView *adView in self.adViews) {
// if (!_stretchingImage) imageView.contentMode = UIViewContentModeCenter;
// }
//}

-(void)setAutoPagingForInterval:(NSTimeInterval)timeInterval{
assert(timeInterval >= 0);
if (self.autoPagingTimer.timeInterval == timeInterval) {
Expand Down
Binary file not shown.

0 comments on commit 49f2126

Please sign in to comment.