Authored by Jonas Budelmann

accept array in equality blocks

Pod::Spec.new do |s|
s.name = 'Masonry'
s.version = '0.0.4'
s.version = '0.1.0'
s.license = 'MIT'
s.summary = 'A light-weight layout framework which makes creating iOS AutoLayout NSLayoutConstraints in code quick, readable and descriptive.'
s.homepage = 'https://github.com/cloudkite/Masonry'
s.author = { 'Jonas Budelmann' => 'jonas.budelmann@gmail.com' }
s.source = { :git => 'https://github.com/cloudkite/Masonry.git', :tag => 'v0.0.4' }
s.source = { :git => 'https://github.com/cloudkite/Masonry.git', :tag => 'v0.1.0' }
s.description = %{
Masonary is a light-weight layout framework which wraps AutoLayout with a nicer syntax.
... ...
... ... @@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
DD38397E17A5170F00C35C17 /* MASConstraintDelegateMock.m in Sources */ = {isa = PBXBuildFile; fileRef = DD38397D17A5170F00C35C17 /* MASConstraintDelegateMock.m */; };
DD52F1AE179CA93B005CD195 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD52F1AD179CA93B005CD195 /* Foundation.framework */; };
DD52F1BD179CA93B005CD195 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD52F1BC179CA93B005CD195 /* SenTestingKit.framework */; };
DD52F1BF179CA93B005CD195 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD52F1BE179CA93B005CD195 /* UIKit.framework */; };
... ... @@ -55,6 +56,8 @@
/* Begin PBXFileReference section */
CC61B4599FE44F12AD607E9B /* Pods-MasonryTests.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MasonryTests.xcconfig"; path = "Pods/Pods-MasonryTests.xcconfig"; sourceTree = SOURCE_ROOT; };
DD38397C17A5170F00C35C17 /* MASConstraintDelegateMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASConstraintDelegateMock.h; sourceTree = "<group>"; };
DD38397D17A5170F00C35C17 /* MASConstraintDelegateMock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASConstraintDelegateMock.m; sourceTree = "<group>"; };
DD52F1AA179CA93B005CD195 /* libMasonry.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMasonry.a; sourceTree = BUILT_PRODUCTS_DIR; };
DD52F1AD179CA93B005CD195 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
DD52F1B1179CA93B005CD195 /* Masonry-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Masonry-Prefix.pch"; sourceTree = "<group>"; };
... ... @@ -168,6 +171,8 @@
DD52F1C5179CA93B005CD195 /* Supporting Files */ = {
isa = PBXGroup;
children = (
DD38397C17A5170F00C35C17 /* MASConstraintDelegateMock.h */,
DD38397D17A5170F00C35C17 /* MASConstraintDelegateMock.m */,
DD52F1D6179CAA71005CD195 /* MasonryTests-Prefix.pch */,
DD52F1C6179CA93B005CD195 /* MasonryTests-Info.plist */,
DD52F1C7179CA93B005CD195 /* InfoPlist.strings */,
... ... @@ -371,6 +376,7 @@
files = (
DD52F1DA179CAA9C005CD195 /* MASCompositeConstraintSpec.m in Sources */,
DD52F1DB179CAA9C005CD195 /* MASViewConstraintSpec.m in Sources */,
DD38397E17A5170F00C35C17 /* MASConstraintDelegateMock.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ...
... ... @@ -9,18 +9,19 @@
#import <UIKit/UIKit.h>
#import "MASConstraint.h"
typedef NS_ENUM(NSInteger, MASCompositeViewConstraintType) {
MASCompositeViewConstraintTypeEdges, //top, left, bottom, right
MASCompositeViewConstraintTypeSize, //width, height
MASCompositeViewConstraintTypeCenter, //centerX, centerY
typedef NS_ENUM(NSInteger, MASCompositeConstraintType) {
MASCompositeConstraintTypeEdges, //top, left, bottom, right
MASCompositeConstraintTypeSize, //width, height
MASCompositeConstraintTypeCenter, //centerX, centerY
};
@interface MASCompositeConstraint : NSObject <MASConstraint>
@property (nonatomic, weak) id<MASConstraintDelegate> delegate;
@property (nonatomic, weak, readonly) UIView *view;
@property (nonatomic, assign, readonly) MASCompositeViewConstraintType type;
@property (nonatomic, assign, readonly) MASCompositeConstraintType type;
- (id)initWithView:(UIView *)view type:(MASCompositeViewConstraintType)type;
- (id)initWithView:(UIView *)view type:(MASCompositeConstraintType)type;
- (id)initWithView:(UIView *)view children:(NSArray *)children;
@end
... ...
... ... @@ -18,7 +18,7 @@
@implementation MASCompositeConstraint
- (id)initWithView:(UIView *)view type:(MASCompositeViewConstraintType)type {
- (id)initWithView:(UIView *)view type:(MASCompositeConstraintType)type {
self = [super init];
if (!self) return nil;
... ... @@ -30,23 +30,33 @@
return self;
}
- (id)initWithView:(UIView *)view children:(NSArray *)children {
self = [super init];
if (!self) return nil;
_view = view;
_childConstraints = [children mutableCopy];
return self;
}
- (void)createChildren {
self.childConstraints = NSMutableArray.array;
NSArray *viewAttributes;
switch (self.type) {
case MASCompositeViewConstraintTypeEdges:
case MASCompositeConstraintTypeEdges:
viewAttributes = @[
self.view.mas_top, self.view.mas_left,
self.view.mas_bottom, self.view.mas_right
];
break;
case MASCompositeViewConstraintTypeSize:
case MASCompositeConstraintTypeSize:
viewAttributes = @[
self.view.mas_width, self.view.mas_height
];
break;
case MASCompositeViewConstraintTypeCenter:
case MASCompositeConstraintTypeCenter:
viewAttributes = @[
self.view.mas_centerX, self.view.mas_centerY
];
... ...
... ... @@ -6,7 +6,7 @@
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
enum {
MASLayoutPriorityRequired = UILayoutPriorityRequired,
... ...
... ... @@ -102,19 +102,19 @@
#pragma mark - composite Attributes
- (id<MASConstraint>)edges {
MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithView:self.view type:MASCompositeViewConstraintTypeEdges];
MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithView:self.view type:MASCompositeConstraintTypeEdges];
constraint.delegate = self;
return constraint;
}
- (id<MASConstraint>)size {
MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithView:self.view type:MASCompositeViewConstraintTypeSize];
MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithView:self.view type:MASCompositeConstraintTypeSize];
constraint.delegate = self;
return constraint;
}
- (id<MASConstraint>)center {
MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithView:self.view type:MASCompositeViewConstraintTypeCenter];
MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithView:self.view type:MASCompositeConstraintTypeCenter];
constraint.delegate = self;
return constraint;
}
... ...
... ... @@ -9,7 +9,7 @@
#import "MASViewAttribute.h"
#import "MASConstraint.h"
@interface MASViewConstraint : NSObject <MASConstraint>
@interface MASViewConstraint : NSObject <MASConstraint, NSCopying>
@property (nonatomic, weak) id<MASConstraintDelegate> delegate;
@property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute;
... ...
... ... @@ -7,6 +7,7 @@
//
#import "MASViewConstraint.h"
#import "MASCompositeConstraint.h"
@interface MASViewConstraint ()
... ... @@ -33,6 +34,18 @@
return self;
}
#pragma mark - NSCoping
- (id)copyWithZone:(NSZone *)zone {
MASViewConstraint *constraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:self.firstViewAttribute];
constraint.layoutConstant = self.layoutConstant;
constraint.layoutRelation = self.layoutRelation;
constraint.layoutPriority = self.layoutPriority;
constraint.layoutMultiplier = self.layoutMultiplier;
constraint.delegate = self.delegate;
return constraint;
}
#pragma mark - private
- (void)setLayoutConstant:(CGFloat)layoutConstant {
... ... @@ -52,9 +65,7 @@
- (void)setSecondViewAttribute:(id)secondViewAttribute {
if ([secondViewAttribute isKindOfClass:NSNumber.class]) {
self.layoutConstant = [secondViewAttribute doubleValue];
// } else if ([secondViewAttribute isKindOfClass:NSArray.class]) {
// //TODO Composite
} else if ([secondViewAttribute isKindOfClass:UIView.class]) {
} else if ([secondViewAttribute isKindOfClass:UIView.class]) {
_secondViewAttribute = [[MASViewAttribute alloc] initWithView:secondViewAttribute layoutAttribute:self.firstViewAttribute.layoutAttribute];
} else if ([secondViewAttribute isKindOfClass:MASViewAttribute.class]) {
_secondViewAttribute = secondViewAttribute;
... ... @@ -176,37 +187,39 @@
#pragma mark - NSLayoutRelation proxies
- (id<MASConstraint> (^)(id))equalTo {
return ^id(id attr) {
- (id<MASConstraint> (^)(id))equalityWithRelation:(NSLayoutRelation)relation {
return ^id(id attribute) {
NSAssert(!self.hasLayoutRelation, @"Redefinition of constraint relation");
self.layoutRelation = NSLayoutRelationEqual;
self.secondViewAttribute = attr;
[self.delegate addConstraint:self];
return self;
if ([attribute isKindOfClass:NSArray.class]) {
NSMutableArray *children = NSMutableArray.new;
for (id attr in attribute) {
MASViewConstraint *viewConstraint = [self copy];
viewConstraint.secondViewAttribute = attr;
[viewConstraint.delegate addConstraint:viewConstraint];
[children addObject:viewConstraint];
}
MASCompositeConstraint *compositeConstraint = [[MASCompositeConstraint alloc] initWithView:self.firstViewAttribute.view children:children];
compositeConstraint.delegate = self.delegate;
return compositeConstraint;
} else {
self.layoutRelation = relation;
self.secondViewAttribute = attribute;
[self.delegate addConstraint:self];
return self;
}
};
}
- (id<MASConstraint> (^)(id))equalTo {
return [self equalityWithRelation:NSLayoutRelationEqual];
}
- (id<MASConstraint> (^)(id))greaterThanOrEqualTo {
return ^id(id attr) {
NSAssert(!self.hasLayoutRelation, @"Redefinition of constraint relation");
self.layoutRelation = NSLayoutRelationGreaterThanOrEqual;
self.secondViewAttribute = attr;
[self.delegate addConstraint:self];
return self;
};
return [self equalityWithRelation:NSLayoutRelationGreaterThanOrEqual];
}
- (id<MASConstraint> (^)(id))lessThanOrEqualTo {
return ^id(id attr) {
NSAssert(!self.hasLayoutRelation, @"Redefinition of constraint relation");
self.layoutRelation = NSLayoutRelationLessThanOrEqual;
self.secondViewAttribute = attr;
[self.delegate addConstraint:self];
return self;
};
return [self equalityWithRelation:NSLayoutRelationLessThanOrEqual];
}
#pragma mark - Semantic properties
... ...
... ... @@ -56,8 +56,7 @@
make.right.equalTo(superview.mas_right).offset(-padding);
make.width.equalTo(view1.mas_width);
make.height.equalTo(view1.mas_height);
make.height.equalTo(view3.mas_height);
make.height.equalTo(@[view1, view3]); //can pass array of views
}];
[view3 mas_makeConstraints:^(MASConstraintMaker *make) {
... ... @@ -66,8 +65,7 @@
make.bottom.equalTo(superview.mas_bottom).offset(-padding);
make.right.equalTo(superview.mas_right).offset(-padding);
make.height.equalTo(view1.mas_height);
make.height.equalTo(view2.mas_height);
make.height.equalTo(@[view1.mas_height, view2.mas_height]); //can pass array of attributes
}];
return self;
... ...
... ... @@ -8,6 +8,7 @@
#import "MASCompositeConstraint.h"
#import "MASViewConstraint.h"
#import "MASConstraintDelegateMock.h"
@interface MASCompositeConstraint () <MASConstraintDelegate>
... ... @@ -24,21 +25,21 @@
SpecBegin(MASCompositeConstraint)
__block id<MASConstraintDelegate> delegate;
__block MASConstraintDelegateMock *delegate;
__block UIView *superview;
__block UIView *view;
__block MASCompositeConstraint *composite;
beforeEach(^{
composite = nil;
delegate = mockProtocol(@protocol(MASConstraintDelegate));
delegate = MASConstraintDelegateMock.new;
view = UIView.new;
superview = UIView.new;
[superview addSubview:view];
});
it(@"should create centerY and centerX children", ^{
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeViewConstraintTypeCenter];
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeConstraintTypeCenter];
expect(composite.childConstraints).to.haveCountOf(2);
... ... @@ -53,7 +54,7 @@ it(@"should create centerY and centerX children", ^{
it(@"should create top, left, bottom, right children", ^{
UIView *newView = UIView.new;
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeViewConstraintTypeEdges];
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeConstraintTypeEdges];
composite.equalTo(newView);
expect(composite.childConstraints).to.haveCountOf(4);
... ... @@ -80,7 +81,7 @@ it(@"should create top, left, bottom, right children", ^{
});
it(@"should create width and height children", ^{
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeViewConstraintTypeSize];
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeConstraintTypeSize];
expect(composite.childConstraints).to.haveCountOf(2);
MASViewConstraint *viewConstraint = composite.childConstraints[0];
... ... @@ -93,12 +94,12 @@ it(@"should create width and height children", ^{
});
it(@"should complete children", ^{
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeViewConstraintTypeSize];
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeConstraintTypeSize];
composite.delegate = delegate;
UIView *newView = UIView.new;
//first equality statement
composite.equalTo(newView).sizeOffset(CGSizeMake(90, 30));
composite.equalTo(newView).sizeOffset(CGSizeMake(90, 30)).priorityLow();
expect(composite.childConstraints).to.haveCountOf(2);
... ... @@ -106,17 +107,17 @@ it(@"should complete children", ^{
expect(viewConstraint.secondViewAttribute.view).to.beIdenticalTo(newView);
expect(viewConstraint.secondViewAttribute.layoutAttribute).to.equal(NSLayoutAttributeWidth);
expect(viewConstraint.layoutConstant).to.equal(90);
expect(viewConstraint.layoutPriority).to.equal(MASLayoutPriorityRequired);
expect(viewConstraint.layoutPriority).to.equal(MASLayoutPriorityDefaultLow);
viewConstraint = composite.childConstraints[1];
expect(viewConstraint.secondViewAttribute.view).to.beIdenticalTo(newView);
expect(viewConstraint.secondViewAttribute.layoutAttribute).to.equal(NSLayoutAttributeHeight);
expect(viewConstraint.layoutConstant).to.equal(30);
expect(viewConstraint.layoutPriority).to.equal(MASLayoutPriorityRequired);
expect(viewConstraint.layoutPriority).to.equal(MASLayoutPriorityDefaultLow);
});
it(@"should remove completed on commit", ^{
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeViewConstraintTypeSize];
it(@"should not remove on commit", ^{
composite = [[MASCompositeConstraint alloc] initWithView:view type:MASCompositeConstraintTypeSize];
composite.delegate = delegate;
UIView *newView = UIView.new;
[superview addSubview:newView];
... ... @@ -126,8 +127,9 @@ it(@"should remove completed on commit", ^{
[composite commit];
[verify(delegate) addConstraint:(id)composite.childConstraints[0]];
[verify(delegate) addConstraint:(id)composite.childConstraints[1]];
expect(composite.childConstraints).to.haveCountOf(2);
expect(delegate.constraints).to.contain(composite.childConstraints[0]);
expect(delegate.constraints).to.contain(composite.childConstraints[1]);
});
SpecEnd
\ No newline at end of file
... ...
//
// MASConstraintDelegate.h
// Masonry
//
// Created by Jonas Budelmann on 28/07/13.
// Copyright (c) 2013 Jonas Budelmann. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MASConstraint.h"
@interface MASConstraintDelegateMock : NSObject <MASConstraintDelegate>
@property (nonatomic, strong) NSMutableArray *constraints;
@end
... ...
//
// MASConstraintDelegate.m
// Masonry
//
// Created by Jonas Budelmann on 28/07/13.
// Copyright (c) 2013 Jonas Budelmann. All rights reserved.
//
#import "MASConstraintDelegateMock.h"
@implementation MASConstraintDelegateMock
- (id)init {
self = [super init];
if (!self) return nil;
self.constraints = NSMutableArray.new;
return self;
}
- (void)addConstraint:(id<MASConstraint>)constraint {
[self.constraints addObject:constraint];
}
@end
... ...
... ... @@ -9,6 +9,7 @@
#import "MASViewConstraint.h"
#import "MASConstraint.h"
#import "UIView+MASAdditions.h"
#import "MASConstraintDelegateMock.h"
@interface MASViewConstraint ()
... ... @@ -23,7 +24,7 @@
SpecBegin(MASViewConstraint)
__block id<MASConstraintDelegate> delegate;
__block MASConstraintDelegateMock *delegate;
__block UIView *superview;
__block MASViewConstraint *constraint;
__block UIView *otherView;
... ... @@ -31,7 +32,7 @@ __block UIView *otherView;
beforeEach(^{
superview = UIView.new;
delegate = mockProtocol(@protocol(MASConstraintDelegate));
delegate = MASConstraintDelegateMock.new;
UIView *view = UIView.new;
constraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:view.mas_width];
... ... @@ -47,9 +48,9 @@ describe(@"create equality constraint", ^{
it(@"should create equal constraint", ^{
MASViewAttribute *secondViewAttribute = otherView.mas_top;
MASViewConstraint *newConstraint = constraint.equalTo(secondViewAttribute);
MASViewConstraint *newConstraint = (id)constraint.equalTo(secondViewAttribute);
[verify(constraint.delegate) addConstraint:(id)constraint];
expect(delegate.constraints).to.contain(constraint);
expect(newConstraint).to.beIdenticalTo(constraint);
expect(constraint.secondViewAttribute).to.beIdenticalTo(secondViewAttribute);
expect(constraint.layoutRelation).to.equal(NSLayoutRelationEqual);
... ... @@ -57,9 +58,9 @@ describe(@"create equality constraint", ^{
it(@"should create greaterThanOrEqual constraint", ^{
MASViewAttribute *secondViewAttribute = otherView.mas_top;
MASViewConstraint *newConstraint = constraint.greaterThanOrEqualTo(secondViewAttribute);
[verify(constraint.delegate) addConstraint:(id)constraint];
MASViewConstraint *newConstraint = (id)constraint.greaterThanOrEqualTo(secondViewAttribute);
expect(delegate.constraints).to.contain(constraint);
expect(newConstraint).to.beIdenticalTo(constraint);
expect(constraint.secondViewAttribute).to.beIdenticalTo(secondViewAttribute);
expect(constraint.layoutRelation).to.equal(NSLayoutRelationGreaterThanOrEqual);
... ... @@ -67,9 +68,9 @@ describe(@"create equality constraint", ^{
it(@"create lessThanOrEqual constraint", ^{
MASViewAttribute *secondViewAttribute = otherView.mas_top;
MASViewConstraint *newConstraint = constraint.lessThanOrEqualTo(secondViewAttribute);
[verify(constraint.delegate) addConstraint:(id)constraint];
MASViewConstraint *newConstraint = (id)constraint.lessThanOrEqualTo(secondViewAttribute);
expect(delegate.constraints).to.contain(constraint);
expect(newConstraint).to.beIdenticalTo(constraint);
expect(constraint.secondViewAttribute).to.beIdenticalTo(secondViewAttribute);
expect(constraint.layoutRelation).to.equal(NSLayoutRelationLessThanOrEqual);
... ... @@ -110,8 +111,34 @@ describe(@"create equality constraint", ^{
expect(constraint.firstViewAttribute.layoutAttribute).to.equal(constraint.secondViewAttribute.layoutAttribute);
});
xit(@"should create composite when passed array of views", ^{
it(@"should create composite when passed array of views", ^{
NSArray *views = @[UIView.new, UIView.new, UIView.new];
constraint.equalTo(views).priorityMedium().offset(-10);
expect(delegate.constraints).to.haveCountOf(3);
for (MASViewConstraint *constraint in delegate.constraints) {
int index = [delegate.constraints indexOfObject:constraint];
expect(constraint.secondViewAttribute.view).to.beIdenticalTo(views[index]);
expect(constraint.firstViewAttribute.layoutAttribute).to.equal(NSLayoutAttributeWidth);
expect(constraint.secondViewAttribute.layoutAttribute).to.equal(NSLayoutAttributeWidth);
expect(constraint.layoutPriority).to.equal(MASLayoutPriorityDefaultMedium);
expect(constraint.layoutConstant).to.equal(-10);
}
});
it(@"should create composite when passed array of attributes", ^{
NSArray *viewAttributes = @[UIView.new.mas_height, UIView.new.mas_left];
constraint.equalTo(viewAttributes).priority(60).offset(10);
expect(delegate.constraints).to.haveCountOf(2);
for (MASViewConstraint *constraint in delegate.constraints) {
int index = [delegate.constraints indexOfObject:constraint];
expect(constraint.secondViewAttribute.view).to.beIdenticalTo([viewAttributes[index] view]);
expect(constraint.firstViewAttribute.layoutAttribute).to.equal(NSLayoutAttributeWidth);
expect(constraint.secondViewAttribute.layoutAttribute).to.equal([viewAttributes[index] layoutAttribute]);
expect(constraint.layoutPriority).to.equal(60);
expect(constraint.layoutConstant).to.equal(10);
}
});
});
... ...
... ... @@ -9,7 +9,4 @@
#define EXP_SHORTHAND
#import "Expecta.h"
#define MOCKITO_SHORTHAND
#import <OCMockito/OCMockito.h>
#endif
\ No newline at end of file
... ...
... ... @@ -3,5 +3,4 @@ platform :ios, '6.0'
target 'MasonryTests', :exclusive => true do
pod 'Specta'
pod 'Expecta'
pod 'OCMockito'
end
\ No newline at end of file
... ...
... ... @@ -126,6 +126,15 @@ make.width.greaterThanOrEqualTo(@200);
make.width.lessThanOrEqualTo(@400)
```
#### 4. NSArray
An array of a mixture of any of the previous types
```obj-c
make.height.equalTo(@[view1.mas_height, view2.mas_height]);
make.height.equalTo(@[view1, view2]);
make.left.equalTo(@[view1, @100, view3.right]);
````
## Learn to prioritize
> `.prority` allows you to specify an exact priority
... ...