Theme fixes

This commit is contained in:
Ilya Laktyushin
2019-12-27 01:38:30 +03:00
parent 2cb6ebc410
commit 533257976b
34 changed files with 217 additions and 189 deletions

View File

@@ -143,6 +143,16 @@ public final class SegmentedControlNode: ASDisplayNode, UIGestureRecognizerDeleg
}
}
public func setSelectedIndex(_ index: Int, animated: Bool) {
guard index != self._selectedIndex else {
return
}
self._selectedIndex = index
if let layout = self.validLayout {
let _ = self.updateLayout(layout, transition: .animated(duration: 0.2, curve: .easeInOut))
}
}
public var selectedIndexChanged: (Int) -> Void = { _ in }
public var selectedIndexShouldChange: (Int, @escaping (Bool) -> Void) -> Void = { _, f in
f(true)