Created
May 9, 2017 08:14
-
-
Save usagimaru/911ef08ad366bab79f30366f587d8d6e to your computer and use it in GitHub Desktop.
UIScrollView extension.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIScrollView { | |
/// ms 後にスクロールインジケーターを表示 | |
func flashScrollIndicators(afterIn milliseconds: Int = 500) { | |
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .milliseconds(milliseconds)) {[weak self] in | |
self?.flashScrollIndicators() | |
} | |
} | |
/// 慣性スクロールを停止 | |
func stopDeceleration() { | |
setContentOffset(contentOffset, animated: false) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment