Skip to content

Commit

Permalink
Added indexPath to delegates. Updated readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvorobei committed May 8, 2021
1 parent 0125f2b commit d3b5f72
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 14 deletions.
7 changes: 0 additions & 7 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,10 @@ Using for request and check state of permissions. Available native UI for reques
#### [SparrowKit](https://github.com/ivanvorobei/SparrowKit)
Collection of native Swift extensions to boost your development. Support tvOS and watchOS.

#### [Telegram Stikers](https://sparrowcode.by/telegram/stickers)
You can import stikers for Telegram about iOS Development. Stickers with Xcode elements you know.

## Russian Community

В телеграм-канале [Код Воробья](https://sparrowcode.by/telegram) пишу о iOS разработке. Помощь можно найти в [нашем чате](https://sparrowcode.by/telegram/chat).

Видео-туториалы выклыдываю на [YouTube](https://sparrowcode.by/youtube):

[![Tutorials on YouTube](https://cdn.ivanvorobei.by/github/readme/youtube-preview.jpg)](https://sparrowcode.by/youtube)

[Стикеры в телеграм](https://sparrowcode.by/telegram/stickers) про iOS разработку:

[![Telegram Stikers](https://cdn.ivanvorobei.by/github/readme/telegram-stikers-preview.png)](https://sparrowcode.by/telegram/stickers)
2 changes: 1 addition & 1 deletion SPDiffable.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'SPDiffable'
s.version = '1.2.1'
s.version = '1.2.2'
s.summary = 'Extenshion of Diffable API which allow not duplicate code and use less models.'
s.homepage = 'https://github.com/ivanvorobei/SPDiffable'
s.source = { :git => 'https://github.com/ivanvorobei/SPDiffable.git', :tag => s.version }
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ open class SPDiffableCollectionController: UICollectionViewController {

open override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
guard let item = diffableDataSource?.item(for: indexPath) else { return }
diffableDelegate?.diffableCollectionView?(collectionView, didSelectItem: item)
diffableDelegate?.diffableCollectionView?(collectionView, didSelectItem: item, indexPath: indexPath)
switch item {
case let model as SPDiffableCollectionActionableItem:
model.action?(indexPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ open class SPDiffableCollectionView: UICollectionView, UICollectionViewDelegate

open func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
guard let item = diffableDataSource?.item(for: indexPath) else { return }
diffableDelegate?.diffableCollectionView?(collectionView, didSelectItem: item)
diffableDelegate?.diffableCollectionView?(collectionView, didSelectItem: item, indexPath: indexPath)
switch item {
case let model as SPDiffableCollectionActionableItem:
model.action?(indexPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ import UIKit
@available(iOS 13.0, *)
@objc public protocol SPDiffableCollectionDelegate: AnyObject {

@objc optional func diffableCollectionView(_ collectionView: UICollectionView, didSelectItem item: SPDiffableItem)
@objc optional func diffableCollectionView(_ collectionView: UICollectionView, didSelectItem item: SPDiffableItem, indexPath: IndexPath)
}
2 changes: 1 addition & 1 deletion Sources/SPDiffable/Delegate/SPDiffableTableDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ import UIKit
@available(iOS 13.0, *)
@objc public protocol SPDiffableTableDelegate: AnyObject {

@objc optional func diffableTableView(_ tableView: UITableView, didSelectItem item: SPDiffableItem)
@objc optional func diffableTableView(_ tableView: UITableView, didSelectItem item: SPDiffableItem, indexPath: IndexPath)
}
2 changes: 1 addition & 1 deletion Sources/SPDiffable/Table/SPDiffableTableController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ open class SPDiffableTableController: UITableViewController {

open override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard let item = diffableDataSource?.itemIdentifier(for: indexPath) else { return }
diffableDelegate?.diffableTableView?(tableView, didSelectItem: item)
diffableDelegate?.diffableTableView?(tableView, didSelectItem: item, indexPath: indexPath)
switch item {
case let model as SPDiffableTableRow:
model.action?(indexPath)
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# To Do List

- Update `SPDiffableCollectionDelegate` & `SPDiffableTableDelegate` for process index path.
- Now no more plans. For add feature please create issue.

0 comments on commit d3b5f72

Please sign in to comment.