Я пытаюсь реализовать следующий экран.
![Expected Output](https://i.stack.imgur.com/1K5po.png)
Но в моем коде он отображается следующим образом:
![My Output](https://i.stack.imgur.com/dIjFX.png)
следующий код, который я написал,
import UIKit
class LunchViewController: UIViewController {
@IBOutlet weak var mainCollectionView: UICollectionView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}
extension LunchViewController:UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: 412, height: 180)
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
// return self.myLibraryArray.count
return 8
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
// let item = self.myLibraryArray[indexPath.row]
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "RestaurantCollectionViewCell", for: indexPath) as? RestaurantCollectionViewCell else {
return UICollectionViewCell()
}
//cell.fillDetails(item)
return cell
}
}
Вот полная ссылка на проект
Кто-нибудь может мне сказать , в чем проблема? или что мне нужно написать код, чтобы получить ожидаемый результат?
Обновление :
![some white Seperator is showing](https://i.stack.imgur.com/QkCuj.png)