2
2
mirror of https://github.com/mastodon/mastodon-ios synced 2025-04-11 22:58:02 +02:00
mastodon-ios/Mastodon/Protocol/ScrollViewContainer.swift
2021-02-07 16:19:33 +08:00

20 lines
431 B
Swift

//
// ScrollViewContainer.swift
// Mastodon
//
// Created by sxiaojian on 2021/2/7.
//
import UIKit
protocol ScrollViewContainer: UIViewController {
var scrollView: UIScrollView { get }
func scrollToTop(animated: Bool)
}
extension ScrollViewContainer {
func scrollToTop(animated: Bool) {
scrollView.scrollRectToVisible(CGRect(origin: .zero, size: CGSize(width: 1, height: 1)), animated: animated)
}
}