要运行示例项目,首先从仓库克隆项目,然后在 Example 目录中运行 pod install
WHScrollPageView 通过 CocoaPods 提供。要安装,只需将以下行添加到您的 Podfile:
pod "WHScrollPageView"
let page = WHScrollPageView(frame: CGRect(x: 20, y: 50, width: 335, height: 120), { (imageView, url) in
//内部传出imageView跟url,通过url设置imageView的图片
//imageView.kf.setImage(with: url)
}) { (index) in
print("听单处理\(index)")
}
let array = ["https://raw.githubusercontent.com/onevcat/Kingfisher/master/images/kingfisher-1.jpg", "https://raw.githubusercontent.com/onevcat/Kingfisher/master/images/kingfisher-2.jpg", "https://raw.githubusercontent.com/onevcat/Kingfisher/master/images/kingfisher-3.jpg"]
//一定要设置图片数组
page.imagesURLString = array
view.addSubview(page)
wenhe-liu, [email protected]
WHScrollPageView 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。