Created
January 23, 2020 13:32
-
-
Save cliss/db6835d00194731f0661861c766ad373 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
public typealias RowSectionPair = (row: Int, section: Int) | |
extension IndexPath: RawRepresentable { | |
public typealias RawValue = RowSectionPair | |
public init?(rawValue: RowSectionPair) { | |
self = IndexPath(row: rawValue.row, section: rawValue.section) | |
} | |
public var rawValue: RowSectionPair { | |
return RowSectionPair(row: self.row, section: self.section) | |
} | |
} | |
let indexPath = IndexPath(rawValue: RowSectionPair(row: 43, section: 1))! | |
print("Section \(indexPath.section) row \(indexPath.row)") | |
enum Rows: IndexPath { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ಠ_ಠ