【发布时间】:2023-03-31 11:06:02
【问题描述】:
我正在使用 JTAppleCalendar -> https://github.com/patchthecode/JTAppleCalendar 日历插件,我想将 ColectionView 单元格放置在 TableView 单元格中,并且我想在添加的事件中显示每个单元格(在 tableview 单元格内),但是当我连接插座时给我;
错误:非法配置:从 ViewController 到 UITableView 的 tableView 出口无效。插座不能连接到重复的内容。
我该如何解决?
CellView.swift
import JTAppleCalendar
class CellView: JTAppleCell {
@IBOutlet var selectedView: UIView!
@IBOutlet var dayLabel: UILabel!
@IBOutlet var Label: UILabel!
}
Cell.Swift
import UIKit
class Cell: UITableViewCell {
@IBOutlet weak var label : UILabel!
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
ViewController.Swift
@IBOutlet weak var tableView: UITableView!
extension ViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 5
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! Cell
cell.label?.text = String(indexPath.row)
return cell
}
func tableView(_ tableView: UITableView,didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
}
}
下面是我的屏幕;
【问题讨论】:
-
如果您创建一个新的 github 问题,并在那里上传问题的一个小 zip 文件,我可以提供帮助。那我就回这里来回答吧。
标签: ios uitableview swift3 uicollectionview jtapplecalendar