Swift 我的cocoaPod库HFCardCollectionViewLayout存在问题
我发现了一个惊人的图书馆,它和我想要的一样,一个持卡人: 但我甚至不知道如何使用它。我把它整合到我的项目中。创建了CollectionView并从HFCardCollectionViewLayout成功。现在我有了这样的东西:) 我的代码看起来像Swift 我的cocoaPod库HFCardCollectionViewLayout存在问题,swift,xcode,cocoapods,Swift,Xcode,Cocoapods,我发现了一个惊人的图书馆,它和我想要的一样,一个持卡人: 但我甚至不知道如何使用它。我把它整合到我的项目中。创建了CollectionView并从HFCardCollectionViewLayout成功。现在我有了这样的东西:) 我的代码看起来像 { import UIKit import HFCardCollectionViewLayout class ViewController: UIViewController { @IBOutlet weak var cardsC
{
import UIKit
import HFCardCollectionViewLayout
class ViewController: UIViewController {
@IBOutlet weak var cardsCollectionView: HFCardCollectionViewLayout!
override func viewDidLoad() {
super.viewDidLoad()
}
}
我无法理解如何装饰这个collectionView,因为我没有使用过这样的库,HFCardCollectionViewLayout没有DataSource和DelegateFlowLayout?我应该使用CollectionViewDelegateFlowLayout和DataSorce吗?。我该怎么办?任何信息都应该有用 基本上您没有
数据源
和delegateFlowLayout
,因为HFCardCollectionViewLayoutDelegate
实现了UICollectionViewDelegate
,HFCardCollectionViewLayout
实现了UICollectionViewLayout
你可以查一下
HFCardCollectionViewLayout有一个非常简单的实现示例。要运行它,请执行以下操作:
1) 克隆计算机上的pod存储库:
git clone https://github.com/hfrahmann/HFCardCollectionViewLayout
2) 打开HFCardCollectionViewLayoutExample
文件夹,然后打开HFCardCollectionViewLayoutExample.xcworkspace
文件
3) 运行项目。实现在ExampleViewController.swift
和ExampleCollectionViewCell.swift
中。您还可以看到源代码
问题是,如果我将自己的UICollectionView成功转换为HFCardCollectionView,则没有答案?上面说只使用HFCardCollectionViewLayout。请看一下该pod中的示例项目。它很好地展示了如何实现它。您是否检查了源代码并检查了示例应用程序?我如何找到示例应用程序?天哪!太多了!