This repository was archived by the owner on Oct 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathUIView+SLKAdditions.h
57 lines (43 loc) · 2.42 KB
/
UIView+SLKAdditions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// SlackTextViewController
// https://github.com/slackhq/SlackTextViewController
//
// Copyright 2014-2016 Slack Technologies, Inc.
// Licence: MIT-Licence
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/** @name UIView additional features used for SlackTextViewController. */
@interface UIView (SLKAdditions)
/**
Animates the view's constraints by calling layoutIfNeeded.
@param bounce YES if the animation should use spring damping and velocity to give a bouncy effect to animations.
@param options A mask of options indicating how you want to perform the animations.
@param animations An additional block for custom animations.
*/
- (void)slk_animateLayoutIfNeededWithBounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^ __nullable)(void))animations;
- (void)slk_animateLayoutIfNeededWithBounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^ __nullable)(void))animations completion:(void (^ __nullable)(BOOL finished))completion;
/**
Animates the view's constraints by calling layoutIfNeeded.
@param duration The total duration of the animations, measured in seconds.
@param bounce YES if the animation should use spring damping and velocity to give a bouncy effect to animations.
@param options A mask of options indicating how you want to perform the animations.
@param animations An additional block for custom animations.
*/
- (void)slk_animateLayoutIfNeededWithDuration:(NSTimeInterval)duration bounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^ __nullable)(void))animations completion:(void (^ __nullable)(BOOL finished))completion;
/**
Returns the view constraints matching a specific layout attribute (top, bottom, left, right, leading, trailing, etc.)
@param attribute The layout attribute to use for searching.
@return An array of matching constraints.
*/
- (nullable NSArray *)slk_constraintsForAttribute:(NSLayoutAttribute)attribute;
/**
Returns a layout constraint matching a specific layout attribute and relationship between 2 items, first and second items.
@param attribute The layout attribute to use for searching.
@param first The first item in the relationship.
@param second The second item in the relationship.
@return A layout constraint.
*/
- (nullable NSLayoutConstraint *)slk_constraintForAttribute:(NSLayoutAttribute)attribute firstItem:(id __nullable)first secondItem:(id __nullable)second;
@end
NS_ASSUME_NONNULL_END