mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various fixes
This commit is contained in:
@@ -37,7 +37,9 @@ public final class SheetComponentEnvironment: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public let sheetComponentTag = GenericComponentViewTag()
|
||||
public final class SheetComponent<ChildEnvironmentType: Equatable>: Component {
|
||||
|
||||
public typealias EnvironmentType = (ChildEnvironmentType, SheetComponentEnvironment)
|
||||
|
||||
public enum BackgroundColor: Equatable {
|
||||
@@ -90,7 +92,19 @@ public final class SheetComponent<ChildEnvironmentType: Equatable>: Component {
|
||||
}
|
||||
}
|
||||
|
||||
public final class View: UIView, UIScrollViewDelegate {
|
||||
public final class View: UIView, UIScrollViewDelegate, ComponentTaggedView {
|
||||
public final class Tag {
|
||||
public init() {
|
||||
}
|
||||
}
|
||||
|
||||
public func matches(tag: Any) -> Bool {
|
||||
if let _ = tag as? Tag {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private let dimView: UIView
|
||||
private let scrollView: ScrollView
|
||||
private let backgroundView: UIView
|
||||
@@ -159,6 +173,10 @@ public final class SheetComponent<ChildEnvironmentType: Equatable>: Component {
|
||||
}
|
||||
}
|
||||
|
||||
public func dismissAnimated() {
|
||||
self.dismiss?(true)
|
||||
}
|
||||
|
||||
private var scrollingOut = false
|
||||
public func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
|
||||
let contentOffset = (scrollView.contentOffset.y + scrollView.contentInset.top - scrollView.contentSize.height) * -1.0
|
||||
|
||||
Reference in New Issue
Block a user