Skip to content

Commit d3b5f72

Browse files
committed
Added indexPath to delegates. Updated readme.
1 parent 0125f2b commit d3b5f72

File tree

9 files changed

+7
-14
lines changed

9 files changed

+7
-14
lines changed

Readme.md

-7
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,10 @@ Using for request and check state of permissions. Available native UI for reques
297297
#### [SparrowKit](https://github.com/ivanvorobei/SparrowKit)
298298
Collection of native Swift extensions to boost your development. Support tvOS and watchOS.
299299

300-
#### [Telegram Stikers](https://sparrowcode.by/telegram/stickers)
301-
You can import stikers for Telegram about iOS Development. Stickers with Xcode elements you know.
302-
303300
## Russian Community
304301

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

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

309306
[![Tutorials on YouTube](https://cdn.ivanvorobei.by/github/readme/youtube-preview.jpg)](https://sparrowcode.by/youtube)
310-
311-
[Стикеры в телеграм](https://sparrowcode.by/telegram/stickers) про iOS разработку:
312-
313-
[![Telegram Stikers](https://cdn.ivanvorobei.by/github/readme/telegram-stikers-preview.png)](https://sparrowcode.by/telegram/stickers)

SPDiffable.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = 'SPDiffable'
4-
s.version = '1.2.1'
4+
s.version = '1.2.2'
55
s.summary = 'Extenshion of Diffable API which allow not duplicate code and use less models.'
66
s.homepage = 'https://github.com/ivanvorobei/SPDiffable'
77
s.source = { :git => 'https://github.com/ivanvorobei/SPDiffable.git', :tag => s.version }

Sources/SPDiffable/Collection/SPDiffableCollectionController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ open class SPDiffableCollectionController: UICollectionViewController {
5252

5353
open override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
5454
guard let item = diffableDataSource?.item(for: indexPath) else { return }
55-
diffableDelegate?.diffableCollectionView?(collectionView, didSelectItem: item)
55+
diffableDelegate?.diffableCollectionView?(collectionView, didSelectItem: item, indexPath: indexPath)
5656
switch item {
5757
case let model as SPDiffableCollectionActionableItem:
5858
model.action?(indexPath)

Sources/SPDiffable/Collection/SPDiffableCollectionView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ open class SPDiffableCollectionView: UICollectionView, UICollectionViewDelegate
6868

6969
open func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
7070
guard let item = diffableDataSource?.item(for: indexPath) else { return }
71-
diffableDelegate?.diffableCollectionView?(collectionView, didSelectItem: item)
71+
diffableDelegate?.diffableCollectionView?(collectionView, didSelectItem: item, indexPath: indexPath)
7272
switch item {
7373
case let model as SPDiffableCollectionActionableItem:
7474
model.action?(indexPath)

Sources/SPDiffable/Delegate/SPDiffableCollectionDelegate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ import UIKit
2727
@available(iOS 13.0, *)
2828
@objc public protocol SPDiffableCollectionDelegate: AnyObject {
2929

30-
@objc optional func diffableCollectionView(_ collectionView: UICollectionView, didSelectItem item: SPDiffableItem)
30+
@objc optional func diffableCollectionView(_ collectionView: UICollectionView, didSelectItem item: SPDiffableItem, indexPath: IndexPath)
3131
}

Sources/SPDiffable/Delegate/SPDiffableTableDelegate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ import UIKit
2727
@available(iOS 13.0, *)
2828
@objc public protocol SPDiffableTableDelegate: AnyObject {
2929

30-
@objc optional func diffableTableView(_ tableView: UITableView, didSelectItem item: SPDiffableItem)
30+
@objc optional func diffableTableView(_ tableView: UITableView, didSelectItem item: SPDiffableItem, indexPath: IndexPath)
3131
}

Sources/SPDiffable/Table/SPDiffableTableController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ open class SPDiffableTableController: UITableViewController {
6262

6363
open override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
6464
guard let item = diffableDataSource?.itemIdentifier(for: indexPath) else { return }
65-
diffableDelegate?.diffableTableView?(tableView, didSelectItem: item)
65+
diffableDelegate?.diffableTableView?(tableView, didSelectItem: item, indexPath: indexPath)
6666
switch item {
6767
case let model as SPDiffableTableRow:
6868
model.action?(indexPath)

TODO.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# To Do List
22

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

0 commit comments

Comments
 (0)