Latest 0.0.1
Homepage https://github.com/DuckDeck/GrandSlider
License MIT
Platforms ios 8.0
Authors

===

下面有中文说明

GrandSlider is a powerful alternate UIImage(UIView) player

GrandSlider is a scrollable UIImage(UIView) player,cyou can put any UIView in it which it match the GrandSlider size. it can scrollable infinity and you can scroll it manually. and the dot view(pageController) is totally customized.

Key Features

  • GrandSlider will arrange serival UIViews in the ScrollView, which mean you can put anything in the UIView.
  • It can Scroll infinitely. and you can also scroll it manually.
  • You can add or remove the UIView, the GrandSlider will auto set the new scroll state.
  • the doe view(PageController) can totally customized and you can set it at any time the GrandSlider will adjust the new size the location.

Requirements

Xcode 7.1 and iOS 8.0(the lasted swift grammar)

Installation

if you want to use cocopods, just pod 'GrandSlider'.

if you want to use file, just pod copy the GrandSlider.swift to your project .

How To Use It

*Please see these code below

 var views:[UIView] = [UIView]() //init the UIViews, which you will put all the images in it
var img = UIImageView()
img.frame = CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width, height: UIScreen.mainScreen().bounds.width * 0.6)
img.sd_setImageWithURL(NSURL(string: "http://img1.gamersky.com/image2015/12/20151219ge_10/gamersky_019origin_037_201512191817808.jpg"))
views.append(img)
//init the UIImageView, it usually match witn SDWebImage or other Image cache tool.
slider = GrandSlider(frame: CGRect(x: 0, y: 64, width: UIScreen.mainScreen().bounds.width, height: UIScreen.mainScreen().bounds.width * 0.6),animationDuration:2) //Init the GrandSlider
slider?.views = views  //then assgin the views to the GrandSlider
slider?.tap     = abc //set the tap event
{
    func abc (v:UIView,i:Int){ // this is the cakkback func
        print(i)
    }
}
slider?.dotGap = 10 //set the dot gap
slider?.dotWidth = 20 //set the dot width
slider?.normalDotColor = UIColor.blueColor() // set the dot view backgroungcolor
slider?.highlightedDotColor = UIColor.redColor() // set the dot view backgraound color when the current image match this dot
view.addSubview(slider!)// then add the slider . it's done
//if you want totally customize the dot View, you can init a dotView and set some property
let dView = DotView(frame: CGRect(x: 0, y: 0, width: 16, height: 6), color: UIColor.clearColor()) //init a normal dot view
let hdView = DotView(frame: CGRect(x: 0, y: 0, width: 16, height: 6), color: UIColor.whiteColor()) // init a current image match dot view
dView.layer.cornerRadius = 3 //set the dow view radius
dView.layer.borderWidth = 1 //set the dot view borderwidth
dView.layer.borderColor = UIColor.whiteColor().CGColor //border color
hdView.layer.cornerRadius = 3 // set the  radius
slider1 = GrandSlider(frame: CGRect(x: 0, y: CGRectGetMaxY(slider!.frame) + 2, width: UIScreen.mainScreen().bounds.size.width, height: UIScreen.mainScreen().bounds.size.width * 0.6), animationDuration: 2, dView: dView, hDotView: hdView, dotGap: 8)// init another slider 
slider1?.views = views // assgin the views to the GrandSlider
//You can change the Views any time, the GrandSlider can suto adjust it 
slider?.views = otherViews

*Check the demo project will help you understand more

add -DDEBUG location

Contact

Any issue or problem please contact me:[email protected], I will be happy fix it

中文说明

===

GrandSlider是一个可以无限滚动的图片播放器

GrandSlider是一个可以无限滚动的图片播放器,它使用了UIView作为载体,因此你可以在里面放何东西来播放(前提是它要符合ScrollVIew的尺寸).它可以无限滚动,也可以手动控制.同时指示的Dot View,也可以完全自定义

关键特点

  • GrandSlider会把将你需要展示的UIView放在正确的位置,UIView相当于视图窗口,所以你可以在里面放任何东西
  • 可以无限滚动,也可以手动去滑动
  • 你可以随意移除和添加UIView,GrandSlider会帮你自动处理好
  • Dot View(PageController) j 是完全可以自己定制的.当你设定了新的样式后,GrandSlider会自动帮你设定好位置和大小

系统要求

Xcode 7.1 and iOS 8.0(最新的Swift语法)

安装

如果你使用cocopods, 则pod 'GrandSlider' 再安装即可.

如果你想使用文件,直接拷贝GrandSlider.swift到你的项目即可

怎么使用

*请参考以下代码

 var views:[UIView] = [UIView]() //init the UIViews, which you will put all the images in it
var img = UIImageView()
img.frame = CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width, height: UIScreen.mainScreen().bounds.width * 0.6)
img.sd_setImageWithURL(NSURL(string: "http://img1.gamersky.com/image2015/12/20151219ge_10/gamersky_019origin_037_201512191817808.jpg"))
views.append(img)
//init the UIImageView, it usually match witn SDWebImage or other Image cache tool.
slider = GrandSlider(frame: CGRect(x: 0, y: 64, width: UIScreen.mainScreen().bounds.width, height: UIScreen.mainScreen().bounds.width * 0.6),animationDuration:2) //Init the GrandSlider
slider?.views = views  //then assgin the views to the GrandSlider
slider?.tap     = abc //set the tap event
{
    func abc (v:UIView,i:Int){ // this is the cakkback func
        print(i)
    }
}
slider?.dotGap = 10 //set the dot gap
slider?.dotWidth = 20 //set the dot width
slider?.normalDotColor = UIColor.blueColor() // set the dot view backgroungcolor
slider?.highlightedDotColor = UIColor.redColor() // set the dot view backgraound color when the current image match this dot
view.addSubview(slider!)// then add the slider . it's done
//if you want totally customize the dot View, you can init a dotView and set some property
let dView = DotView(frame: CGRect(x: 0, y: 0, width: 16, height: 6), color: UIColor.clearColor()) //init a normal dot view
let hdView = DotView(frame: CGRect(x: 0, y: 0, width: 16, height: 6), color: UIColor.whiteColor()) // init a current image match dot view
dView.layer.cornerRadius = 3 //set the dow view radius
dView.layer.borderWidth = 1 //set the dot view borderwidth
dView.layer.borderColor = UIColor.whiteColor().CGColor //border color
hdView.layer.cornerRadius = 3 // set the  radius
slider1 = GrandSlider(frame: CGRect(x: 0, y: CGRectGetMaxY(slider!.frame) + 2, width: UIScreen.mainScreen().bounds.size.width, height: UIScreen.mainScreen().bounds.size.width * 0.6), animationDuration: 2, dView: dView, hDotView: hdView, dotGap: 8)// init another slider 
slider1?.views = views // assgin the views to the GrandSlider
//You can change the Views any time, the GrandSlider can suto adjust it 
slider?.views = otherViews

*参考GrandSliderDemo会更好的理解StarReview怎么使用

add -DDEBUG location

和我联系

任何问题或者BUG请直接和我联系[email protected], 我会乐于帮你解决

Latest podspec

{
    "name": "GrandSlider",
    "version": "0.0.1",
    "summary": "GrandSlider is a powerful alternate UIImage(UIView) player",
    "description": "GrandSlider is a simple and useful UIImage(UIView) player. It provide a custmize dot view",
    "homepage": "https://github.com/DuckDeck/GrandSlider",
    "license": "MIT",
    "authors": {
        "DuckDeck": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/DuckDeck/GrandSlider.git",
        "tag": "0.0.1"
    },
    "source_files": "GrandSlider/*"
}

Pin It on Pinterest

Share This