1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #import <PureLayout/PureLayout.h>
- #import "CTAssetsPickerDefines.h"
- #import "CTAssetsGridView.h"
- @interface CTAssetsGridView ()
- @property (nonatomic, assign) BOOL didSetupConstraints;
- @end
- @implementation CTAssetsGridView
- - (instancetype)initWithFrame:(CGRect)frame
- {
- if (self = [super initWithFrame:frame])
- {
- [self setupViews];
- }
-
- return self;
- }
- #pragma mark - Setup
- - (void)setupViews
- {
- self.backgroundColor = CTAssetsGridViewBackgroundColor;
- }
- #pragma mark - Apperance
- - (UIColor *)gridBackgroundColor
- {
- return self.backgroundColor;
- }
- - (void)setGridBackgroundColor:(UIColor *)backgroundColor
- {
- UIColor *color = (backgroundColor) ? (backgroundColor) : CTAssetsGridViewBackgroundColor;
- self.backgroundColor = color;
- }
- #pragma mark - Update auto layout constraints
- - (void)updateConstraints
- {
- if (!self.didSetupConstraints)
- {
- [self autoPinEdgesToSuperviewEdges];
- self.didSetupConstraints = YES;
- }
-
- [super updateConstraints];
- }
- @end
|