CFPPTView是Swift编写的无限滚动相册切换。
Swift版幻灯,scrollView无限滚动,支持网络和本地图片展示!
//创建并展示一个本地幻灯: //创建SwiftPPT var pptView = CFPPTView(type: PPTType.local) { () -> [PPTDataModel] in var localImages = [UIImage(named: "local1"),UIImage(named: "local2"),UIImage(named: "local3"),UIImage(named: "local4")] var localTitleStr = ["本地幻灯:花千骨剧照一","本地幻灯:花千骨剧照二","本地幻灯:花千骨剧照三","本地幻灯:花千骨剧照四"] var dataModels: [PPTDataModel] = Array() for i in 0..<localImages.count { var dataModel = PPTDataModel(localImage: localImages[i]!, titleStr: localTitleStr[i]) dataModels.append(dataModel) } return dataModels } pptView.frame = CGRectMake(0, 80, Screen.width, 160) self.view.addSubview(pptView)
评论