|
@@ -19,8 +19,7 @@ static CGFloat const kArrayExampleIncrement = 10.0;
|
|
|
|
|
|
@implementation MASExampleArrayView
|
|
@implementation MASExampleArrayView
|
|
|
|
|
|
-- (id)init
|
|
|
|
-{
|
|
|
|
|
|
+- (id)init {
|
|
self = [super init];
|
|
self = [super init];
|
|
if (!self) return nil;
|
|
if (!self) return nil;
|
|
|
|
|
|
@@ -56,29 +55,24 @@ static CGFloat const kArrayExampleIncrement = 10.0;
|
|
return self;
|
|
return self;
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)centerAction
|
|
|
|
-{
|
|
|
|
|
|
+- (void)centerAction {
|
|
self.offset = 0.0;
|
|
self.offset = 0.0;
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)raiseAction
|
|
|
|
-{
|
|
|
|
|
|
+- (void)raiseAction {
|
|
self.offset -= kArrayExampleIncrement;
|
|
self.offset -= kArrayExampleIncrement;
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)lowerAction
|
|
|
|
-{
|
|
|
|
|
|
+- (void)lowerAction {
|
|
self.offset += kArrayExampleIncrement;
|
|
self.offset += kArrayExampleIncrement;
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)setOffset:(CGFloat)offset
|
|
|
|
-{
|
|
|
|
|
|
+- (void)setOffset:(CGFloat)offset {
|
|
_offset = offset;
|
|
_offset = offset;
|
|
[self setNeedsUpdateConstraints];
|
|
[self setNeedsUpdateConstraints];
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)updateConstraints
|
|
|
|
-{
|
|
|
|
|
|
+- (void)updateConstraints {
|
|
[super updateConstraints];
|
|
[super updateConstraints];
|
|
[self.buttonViews updateConstraints:^(MASConstraintMaker *make) {
|
|
[self.buttonViews updateConstraints:^(MASConstraintMaker *make) {
|
|
make.baseline.equalTo(self.mas_centerY).with.offset(self.offset);
|
|
make.baseline.equalTo(self.mas_centerY).with.offset(self.offset);
|