forked from zelo72/mastodon-ios
20 lines
433 B
Swift
20 lines
433 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)
|
|
}
|
|
}
|