Skip to content

Commit cf9e7c8

Browse files
committed
Remove optional indexpath from dequeue method
This better mirrors Apples methods and removes logic from the method.
1 parent b51c247 commit cf9e7c8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Library/UIKit/UITableView+ReuseIdentifierProtocol.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ import Foundation
1010
import UIKit
1111

1212
public extension UITableView {
13-
public func dequeueReusableCellWithIdentifier<Identifier: ReuseIdentifierProtocol where Identifier.ReusableType: UITableViewCell>(identifier: Identifier, forIndexPath indexPath: NSIndexPath?) -> Identifier.ReusableType? {
14-
if let indexPath = indexPath {
15-
return dequeueReusableCellWithIdentifier(identifier.identifier, forIndexPath: indexPath) as? Identifier.ReusableType
16-
}
17-
return dequeueReusableCellWithIdentifier(identifier.identifier) as? Identifier.ReusableType
13+
public func dequeueReusableCellWithIdentifier<Identifier: ReuseIdentifierProtocol where Identifier.ReusableType: UITableViewCell>(identifier: Identifier, forIndexPath indexPath: NSIndexPath) -> Identifier.ReusableType? {
14+
return dequeueReusableCellWithIdentifier(identifier.identifier, forIndexPath: indexPath) as? Identifier.ReusableType
1815
}
1916

2017
public func dequeueReusableCellWithIdentifier<Identifier: ReuseIdentifierProtocol where Identifier.ReusableType: UITableViewCell>(identifier: Identifier) -> Identifier.ReusableType? {

0 commit comments

Comments
 (0)