support

  • iOS 8+

Let’s look at a couple of demos





The demo list





Zhihu daily





Local image rotation





Network picture rotation





StoryBoard to create





Unlimited rotation





Don’t show the pageControl

How to use

var cycleScrollView:WRCycleScrollView?
let height = 520 * kScreenWidth / 1080.0
let frame = CGRect(x: 0.y: 150.width: kScreenWidth, height: height)
// Can load network image or local image
let serverImages = ["http://mobile/s252_05471521705899113.png". ]// constructor
cycleScrollView = WRCycleScrollView(frame: frame, type: .SERVER, imgs: serverImages)
view.addSubview(cycleScrollView!)
// Add the proxycycleScrollView? .delegate = selfCopy the code

Proxy methods (click events and image scroll events)

extension ServerImgController: WRCycleScrollViewDelegate
{
    /// Click the image event
    func cycleScrollViewDidSelect(at index:Int, cycleScrollView:WRCycleScrollView)
    {
        print("Click number one\(index+1)A picture")}/// picture scroll event
    func cycleScrollViewDidScroll(to index:Int, cycleScrollView:WRCycleScrollView)
    {
        print("Roll to number one\(index+1)A picture")}}Copy the code

Demo download address:WRCycleScrollView

Highly recommended: Super easy!! IOS set status bar, navigation bar buttons, title, color, transparency, offset, etc

Github.com/wangrui460/… Github.com/wangrui460/…

Welcome to my weibo: Wangrui460