UIScrollView+YYAdd.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // UIScrollView+YYAdd.h
  3. // YYKit <https://github.com/ibireme/YYKit>
  4. //
  5. // Created by ibireme on 13/4/5.
  6. // Copyright (c) 2015 ibireme.
  7. //
  8. // This source code is licensed under the MIT-style license found in the
  9. // LICENSE file in the root directory of this source tree.
  10. //
  11. #import <UIKit/UIKit.h>
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. Provides extensions for `UIScrollView`.
  15. */
  16. @interface UIScrollView (YYAdd)
  17. /**
  18. Scroll content to top with animation.
  19. */
  20. - (void)scrollToTop;
  21. /**
  22. Scroll content to bottom with animation.
  23. */
  24. - (void)scrollToBottom;
  25. /**
  26. Scroll content to left with animation.
  27. */
  28. - (void)scrollToLeft;
  29. /**
  30. Scroll content to right with animation.
  31. */
  32. - (void)scrollToRight;
  33. /**
  34. Scroll content to top.
  35. @param animated Use animation.
  36. */
  37. - (void)scrollToTopAnimated:(BOOL)animated;
  38. /**
  39. Scroll content to bottom.
  40. @param animated Use animation.
  41. */
  42. - (void)scrollToBottomAnimated:(BOOL)animated;
  43. /**
  44. Scroll content to left.
  45. @param animated Use animation.
  46. */
  47. - (void)scrollToLeftAnimated:(BOOL)animated;
  48. /**
  49. Scroll content to right.
  50. @param animated Use animation.
  51. */
  52. - (void)scrollToRightAnimated:(BOOL)animated;
  53. @end
  54. NS_ASSUME_NONNULL_END