小编gha*_*raa的帖子

使用核心数据的具有多个部分的 Diffable 数据源

WWDC 2019真的挤满了iOS的新的东西,新的数据源TableViewsCollectionViewUITableViewDiffableDataSource

我已经成功地将上述新数据源与核心数据集成,删除和插入新记录工作没有任何问题,不幸的是我在将项目从一个部分移动到另一个部分时遇到问题,如果我试图移动最后一个单元格,就会出现问题这部分 。

下面是我的代码:

表视图设置

private func setupTableView() {
       diffableDataSource = UITableViewDiffableDataSource<Int, Reminder>(tableView: remindersTableView) { (tableView, indexPath, reminder) -> UITableViewCell? in
           let cell = tableView.dequeueReusableCell(withIdentifier: "SYReminderCompactCell", for: indexPath) as! SYReminderCompactCell
        var reminderDateString = ""
        let reminderTitle = "\(reminder.emoji ?? "") \(reminder.title  ?? "")"

        if let date = reminder.date {// check if reminder has date or no , if yes check number of todos and if date in today
            let dateFormatter = SYDateFormatterManager.sharedManager.getDateFormaatter() …
Run Code Online (Sandbox Code Playgroud)

ios swift ios13 diffabledatasource

6
推荐指数
1
解决办法
3827
查看次数

CocoaPods 找不到 pod“Alamofire 5.0.0-rc.2”的兼容版本

‘Alamofire’, ‘~> 5.0.0-beta.5’在我的 swift 项目中通过 CocoaPods使用。现在我正在尝试使用Alamofire (~> 5.0.0-rc.2).

不幸的是,我在应用“pod install”命令行后出现以下错误:

CocoaPods 找不到 pod“Alamofire”的兼容版本:在 Podfile 中:Alamofire (~> 5.0.0-rc.2)

有什么帮助吗?

ios cocoapods swift alamofire

3
推荐指数
1
解决办法
3911
查看次数

标签 统计

ios ×2

swift ×2

alamofire ×1

cocoapods ×1

diffabledatasource ×1

ios13 ×1