Code Monkey home page Code Monkey logo

phcyclepictureview's Introduction

PHCyclePictureView

CI Status CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

img

let images = ["http://bizhi.zhuoku.com/bizhi2008/0516/3d/3d_desktop_13.jpg",
"http://tupian.enterdesk.com/2012/1015/zyz/03/5.jpg",
"http://img.web07.cn/UpImg/Desk/201301/12/desk230393121053551.jpg",
"http://wallpaper.160.com/Wallpaper/Image/1280_960/1280_960_37227.jpg",
"http://bizhi.zhuoku.com/wall/jie/20061124/cartoon2/cartoon014.jpg"]
let titles = ["标题一", "标题二", "标题三", "标题四", "标题五"]

cyclePictureView = PHCyclePictureView()
let cyclePVFrame = CGRect(x: 0, y: 64, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.width * 0.512)
cyclePictureView.frame = cyclePVFrame
cyclePictureView.pageControlPosition = .right
cyclePictureView.imageURLStrings = images
cyclePictureView.imageTitles = titles
view.addSubview(cyclePictureView)

PHCyclePictureViewDelegate

cyclePictureView.delegate = self

extension ViewController: PHCyclePictureViewDelegate {
func cyclePictureView(_ cyclePictureView: PHCyclePictureView, didTapItemAt index: Int) {
print("点击了第\(index + 1)张图片")
}
}

Requirements

  • Xcode 9 +
  • iOS 8 +
  • Swift 4 +

Installation

CocoaPods

PHCyclePictureView is available through CocoaPods. To install it, simply add the following line to your Podfile:

Swift 4:

pod 'PHCyclePictureView'

Carthage

github "qixizhu/PHCyclePictureView"

Thanks

航歌-做最好的开发者知识平台Swift - 图片循环轮播组件的实现(附样例)

走心的 Swift 翻译组基于 Swift 创建 CocoaPods 完全指南

@roshanman

Author

qixizhu, [email protected]

License

PHCyclePictureView is available under the MIT license. See the LICENSE file for more info.

phcyclepictureview's People

Contributors

qixizhu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mohsinalimat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.