这是我第一次使用 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
我真的不知道为什么它不起作用。:(有什么办法可以让我像火种一样吗?
感谢您的阅读,对不起我的英语,缺乏解释。