Skip to content

Commit 342b0f0

Browse files
committed
Update Swift 5.0
1 parent 735e362 commit 342b0f0

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

ContinuesTouchCollectionView.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Pod::Spec.new do |spec|
1616
#
1717

1818
spec.name = "ContinuesTouchCollectionView"
19-
spec.version = "0.0.1"
19+
spec.version = "0.0.2"
2020
spec.summary = "A collection view subview for handling multiple touch on cells."
21-
spec.swift_version = "4.2"
21+
spec.swift_version = "5.0"
2222

2323
# This description is used to generate tags and improve search results.
2424
# * Think: What does it do? Why did you write it? What is the focus?

ContinuesTouchCollectionView.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
TargetAttributes = {
126126
B24BC6CC212C281D00056360 = {
127127
CreatedOnToolsVersion = 9.4.1;
128-
LastSwiftMigration = 1000;
128+
LastSwiftMigration = 1020;
129129
};
130130
};
131131
};
@@ -369,7 +369,7 @@
369369
);
370370
PRODUCT_BUNDLE_IDENTIFIER = com.cemolcay.ContinuesTouchCollectionView;
371371
PRODUCT_NAME = "$(TARGET_NAME)";
372-
SWIFT_VERSION = 4.2;
372+
SWIFT_VERSION = 5.0;
373373
TARGETED_DEVICE_FAMILY = "1,2";
374374
};
375375
name = Debug;
@@ -389,7 +389,7 @@
389389
);
390390
PRODUCT_BUNDLE_IDENTIFIER = com.cemolcay.ContinuesTouchCollectionView;
391391
PRODUCT_NAME = "$(TARGET_NAME)";
392-
SWIFT_VERSION = 4.2;
392+
SWIFT_VERSION = 5.0;
393393
TARGETED_DEVICE_FAMILY = "1,2";
394394
};
395395
name = Release;

ContinuesTouchCollectionView/ContinuesTouchCollectionView.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ open class ContinuesTouchCollectionViewCell: UICollectionViewCell {
3333
/// Delegate that informs about touch state changes.
3434
public weak var delegate: ContinuesTouchCollectionViewCellDelegate?
3535

36-
/// Assigned touch id if cell is being touched.
37-
fileprivate var touchID: String? {
36+
/// Assigned touch if cell is being touched.
37+
public fileprivate(set) var touch: UITouch? {
3838
didSet {
39-
isTouching = touchID != nil
39+
isTouching = touch?.touchID != nil
4040
}
4141
}
4242

@@ -72,7 +72,7 @@ open class ContinuesTouchCollectionView: UICollectionView {
7272
if let indexPath = indexPathForItem(at: location),
7373
let cell = cellForItem(at: indexPath) as? ContinuesTouchCollectionViewCell,
7474
!cell.isTouching {
75-
cell.touchID = touch.touchID
75+
cell.touch? = touch
7676
touchingCells.append(cell)
7777
}
7878
}
@@ -89,16 +89,16 @@ open class ContinuesTouchCollectionView: UICollectionView {
8989
let cell = cellForItem(at: indexPath) as? ContinuesTouchCollectionViewCell,
9090
!cell.isTouching {
9191

92-
if let untouchingCell = touchingCells.filter({ $0.touchID == touch.touchID }).first {
92+
if let untouchingCell = touchingCells.filter({ $0.touch?.touchID == touch.touchID }).first {
9393
untouchingCells.append(untouchingCell)
9494
}
9595

96-
cell.touchID = touch.touchID
96+
cell.touch = touch
9797
touchingCells.append(cell)
9898
}
9999
}
100100

101-
untouchingCells.forEach({ $0.touchID = nil })
101+
untouchingCells.forEach({ $0.touch = nil })
102102
touchingCells = touchingCells.filter({ !untouchingCells.contains($0) })
103103
}
104104

@@ -107,12 +107,12 @@ open class ContinuesTouchCollectionView: UICollectionView {
107107
var untouchingCells = [ContinuesTouchCollectionViewCell]()
108108

109109
for touch in touches {
110-
if let untouchingCell = touchingCells.filter({ $0.touchID == touch.touchID }).first {
110+
if let untouchingCell = touchingCells.filter({ $0.touch?.touchID == touch.touchID }).first {
111111
untouchingCells.append(untouchingCell)
112112
}
113113
}
114114

115-
untouchingCells.forEach({ $0.touchID = nil })
115+
untouchingCells.forEach({ $0.touch = nil })
116116
touchingCells = touchingCells.filter({ !untouchingCells.contains($0) })
117117
}
118118

@@ -121,12 +121,12 @@ open class ContinuesTouchCollectionView: UICollectionView {
121121
var untouchingCells = [ContinuesTouchCollectionViewCell]()
122122

123123
for touch in touches {
124-
if let untouchingCell = touchingCells.filter({ $0.touchID == touch.touchID }).first {
124+
if let untouchingCell = touchingCells.filter({ $0.touch?.touchID == touch.touchID }).first {
125125
untouchingCells.append(untouchingCell)
126126
}
127127
}
128128

129-
untouchingCells.forEach({ $0.touchID = nil })
129+
untouchingCells.forEach({ $0.touch = nil })
130130
touchingCells = touchingCells.filter({ !untouchingCells.contains($0) })
131131
}
132132
}

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ SPEC CHECKSUMS:
1313

1414
PODFILE CHECKSUM: e4fe0da0b239e31aa29d1eb902a4ca0870f029bc
1515

16-
COCOAPODS: 1.6.0.beta.1
16+
COCOAPODS: 1.6.0

0 commit comments

Comments
 (0)