You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.4 KiB

5 years ago
  1. //
  2. // SlackTextViewController
  3. // https://github.com/slackhq/SlackTextViewController
  4. //
  5. // Copyright 2014-2016 Slack Technologies, Inc.
  6. // Licence: MIT-Licence
  7. //
  8. #import <UIKit/UIKit.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. /** @name UIView additional features used for SlackTextViewController. */
  11. @interface UIView (SLKAdditions)
  12. /**
  13. Animates the view's constraints by calling layoutIfNeeded.
  14. @param bounce YES if the animation should use spring damping and velocity to give a bouncy effect to animations.
  15. @param options A mask of options indicating how you want to perform the animations.
  16. @param animations An additional block for custom animations.
  17. */
  18. - (void)slk_animateLayoutIfNeededWithBounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^ __nullable)(void))animations;
  19. - (void)slk_animateLayoutIfNeededWithBounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^ __nullable)(void))animations completion:(void (^ __nullable)(BOOL finished))completion;
  20. /**
  21. Animates the view's constraints by calling layoutIfNeeded.
  22. @param duration The total duration of the animations, measured in seconds.
  23. @param bounce YES if the animation should use spring damping and velocity to give a bouncy effect to animations.
  24. @param options A mask of options indicating how you want to perform the animations.
  25. @param animations An additional block for custom animations.
  26. */
  27. - (void)slk_animateLayoutIfNeededWithDuration:(NSTimeInterval)duration bounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^ __nullable)(void))animations completion:(void (^ __nullable)(BOOL finished))completion;
  28. /**
  29. Returns the view constraints matching a specific layout attribute (top, bottom, left, right, leading, trailing, etc.)
  30. @param attribute The layout attribute to use for searching.
  31. @return An array of matching constraints.
  32. */
  33. - (nullable NSArray *)slk_constraintsForAttribute:(NSLayoutAttribute)attribute;
  34. /**
  35. Returns a layout constraint matching a specific layout attribute and relationship between 2 items, first and second items.
  36. @param attribute The layout attribute to use for searching.
  37. @param first The first item in the relationship.
  38. @param second The second item in the relationship.
  39. @return A layout constraint.
  40. */
  41. - (nullable NSLayoutConstraint *)slk_constraintForAttribute:(NSLayoutAttribute)attribute firstItem:(id __nullable)first secondItem:(id __nullable)second;
  42. @end
  43. NS_ASSUME_NONNULL_END