я впервые использую Stack Overflow :) надеюсь, что смогу найти ответы и поделиться своими знаниями.
В настоящее время я делаю приложение для чата, такое как Tinder или стиль Instagram, для изучения Swift.
как вы можете видеть в Tinder, вы можете смахивать горизонтально совпадающих пользователей
https://i.stack.imgur.com/dFUcM.jpg
Я хочу построить почти такой же дизайн, как этот.
на моем main.storyboard это похоже на
TableViewController
-collectionView
-collectionViewCell
-collectionViewFlowLayout
-tableViewCell
-contentView
как это.
Ячейка collectionView предназначена для сопоставленных пользователей, а tableviewCells — для открытых чатов.
Я уже закончил делать чаты.
но часть представления коллекции никогда не отображается. Я попытался создать файл Extension.swift для этого и набрал как
extension TableViewController {
class RequestCVCell: UICollectionViewCell {
@IBOutlet weak var MatchedAvatar: UIImageView!
@IBOutlet weak var MatchedName: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
MatchedAvatar.layer.cornerRadius = 30
MatchedAvatar.clipsToBounds = true
}
let horizontalView = UIView(backgroundColor: .blue)
}
}
Я думал о создании раскадровки, например
ViewController
-collectionView
-collectionViewCell
-collectionViewFlowLayout
-tableView
-contentView
Я действительно понятия не имею, почему это не работает. :( Есть ли способ сделать как трут?
спасибо за чтение и извините за мой английский, отсутствие объяснений.