A drop-in carousel view. Most of Apps put it in their first screen.
enhancement
Storyboard inspector Spported at version 1.1.0
#####Recommend
Import with Cocoapods
add follow line into your podfile:
pod 'PSCarouselView'
#####Import manually Download zip and unarchiver.Drag 'PSCarouselView' folder into your project.
- Drag A
UICollectionView
into your Storyboard and make sure your constraints has been settled. - Set
PSCarouselView
as a custom class for this collectionView in Storyboard Inspector. - connect
IBOutlet
to Your ViewController. - set PSCarouselView's
imageURL
property.
###Tips:
- Implement
PSCarouselViewDelegate
if you want to make a pageControl. SDWebImage
framework is necessary.Make sure you had importedSDWebImage
when importPSCarouselView
manually.if you import with cocoapods,don't worry abount that.
For more,download and see the demo。
===============
扔进你的项目就可以用了!实现了很多app都需要的首页广告轮播功能。
enhancement
从1.1.0
版本开始,支持故事板直接编辑属性,不用再写那么多初始化代码啦!
#####推荐
使用CocoaPods导入
在你的podfile文件中加入如下一行
pod 'PSCarouselView'
#####下载并手动导入
下载zip,解压并把PSCarouselView
文件夹以及里面的文件添加到你的工程。
- Storyboard拖拽一个
UICollectionView
到你要放轮播的位置,约束好大小 - Storyboard中将这个
CollectionView
的类设置为PSCarouselView
- 连接
IBOutlet
到ViewController
- 给carouselView的*
imageURL
*赋值。
###注意:
- 如果你想做个pageControl,请实现代理方法。
- 控件需要使用SDWebImage,不使用CocoaPods的情况下,请确保你的工程中导入了SDWebImage。
详情请参阅Demo