0
私は2つのセクションを持つcollectionViewを持っています。各セクションは2組の画像を保持します。私は両方のセクションにタイトルを付けたい。それと並行して、スクロール方向も水平にしたい。 はスクロールのために、私が使用してきました:ときに、ユーザーのスクロールCollectionView Swift 3.0のセクションにタイトルを付ける?
if let layout = collectionFavourites.collectionViewLayout as? UICollectionViewFlowLayout {
layout.scrollDirection = .horizontal
はこのしかし、そのうちの一つにsimulataneouslyセクションの両方をスクロールされます。これらの2節に私のデータをpolulateする
、私は次のコードを使用しました:私は他のために上振れと下振れの一つのセクションの画像が欲しい
switch indexPath.section
{
case 0:
gTableFavouriteImagesIndexArray.sort())
let index = gTableFavouriteImagesIndexArray[indexPath.row]
let dictImage = gTableImageArray[index]
lblTitle.text = dictImage["Title"] as! String?
imgView.image = dictImage["image"] as! UIImage?
default:
gCollectionFavouriteImagesIndexArray.sort()
let index = gCollectionFavouriteImagesIndexArray[indexPath.row]
let dictImage = gCollectionImageArray[index]
lblTitle.text = dictImage["Title"] as! String?
imgView.image = dictImage["image"] as! UIImage?
}
を。しかし、私は同じセクションにすべてのようにそれらのすべてを取得しています。 この問題について私を助けてください。