同步操作将从 兰德网络O2OA平台软件/O2OA 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
//// ZLCollectionView.swift// O2Platform//// Created by 刘振兴 on 16/8/18.// Copyright © 2016年 zoneland. All rights reserved.//import UIKitimport Alamofireimport AlamofireImageimport AlamofireObjectMapperimport SwiftyJSONimport ObjectMapperimport EZSwiftExtensionsimport CocoaLumberjackprotocol ZLCollectionViewDelegate {func clickWithApp(_ app:O2App)}class ZLCollectionView: NSObject {fileprivate let itemNumberWithSection = 5var apps:[[O2App]] = [[],[]]var delegate:ZLCollectionViewDelegate?}extension ZLCollectionView:UICollectionViewDataSource{func numberOfSections(in collectionView: UICollectionView) -> Int {return 2}func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {return apps[section].count}func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "itemCell", for: indexPath) as! O2CollectionViewCelllet app = self.apps[indexPath.section][indexPath.row]if app.storyBoard! == "webview" {cell.initImg(app: app)}else{cell.appIconImageView.image = UIImage(named: app.normalIcon!)cell.appIconImageView.highlightedImage = UIImage(named: app.selectedIcon!)}cell.appTitle.text = app.titlereturn cell}}extension ZLCollectionView:UICollectionViewDelegateFlowLayout{func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {return CGSize(width:SCREEN_WIDTH/CGFloat(itemNumberWithSection),height:80)}func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)}func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {return 0.0}func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {return 0.0}}extension ZLCollectionView:UICollectionViewDelegate{func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {let app = self.apps[indexPath.section][indexPath.row]DDLogDebug("app \(app.title!) be clicked")self.delegate?.clickWithApp(app)}func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {var reusableView:UICollectionReusableView = UICollectionReusableView(frame: .zero)if kind == UICollectionView.elementKindSectionHeader {reusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "OOAppMainheaderView", for: indexPath)let headerView = reusableView as! OOAppMainCollectionReusableViewif indexPath.section == 0 {headerView.titleLabel.text = "主页应用"} else {headerView.titleLabel.text = "所有应用"}}else if kind == UICollectionView.elementKindSectionFooter {reusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "OOAppMainCollectionFooterView", for: indexPath)}return reusableView}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。