From 36c0a9013676f86162daae8dff66604233d54ad4 Mon Sep 17 00:00:00 2001 From: Maxim Isaev Date: Fri, 15 Oct 2021 18:29:20 +0300 Subject: [PATCH] SegmentedCell: cast row to OptionsRow not to the final class SegmentedRow --- Source/Rows/SegmentedRow.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Rows/SegmentedRow.swift b/Source/Rows/SegmentedRow.swift index 863bc6b14..236bf64ed 100644 --- a/Source/Rows/SegmentedRow.swift +++ b/Source/Rows/SegmentedRow.swift @@ -115,7 +115,7 @@ open class SegmentedCell : Cell, CellType { } @objc (valueDidChange) func valueChanged() { - row.value = (row as! SegmentedRow).options?[segmentedControl.selectedSegmentIndex] + row.value = (row as! OptionsRow).options?[segmentedControl.selectedSegmentIndex] } open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { @@ -131,7 +131,7 @@ open class SegmentedCell : Cell, CellType { func updateSegmentedControl() { segmentedControl.removeAllSegments() - (row as! SegmentedRow).options?.reversed().forEach { + (row as! OptionsRow).options?.reversed().forEach { if let image = $0 as? UIImage { segmentedControl.insertSegment(with: image, at: 0, animated: false) } else { @@ -180,7 +180,7 @@ open class SegmentedCell : Cell, CellType { func selectedIndex() -> Int? { guard let value = row.value else { return nil } - return (row as! SegmentedRow).options?.firstIndex(of: value) + return (row as! OptionsRow).options?.firstIndex(of: value) } }