Skip to content

Commit a4dcf31

Browse files
committed
update ObjectiveCSpec.m
1 parent 07be46d commit a4dcf31

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

Tests/Common/ObjectiveCSpec.m

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,29 @@
5858
});
5959

6060
it(@"basic pinlayout calls", ^{
61-
[[[aView pinObjc] top:10] layout];
61+
aView.pinObjc.topValue(10).layout();
6262
expect(@(aView.frame)).to(equal(@(CGRectMake(40, 10, 100, 60))));
6363
});
6464

6565
it(@"using Pin.logMissingLayoutCalls", ^{
6666
Pin.logMissingLayoutCalls = true;
67-
[[aView pinObjc] top:10];
67+
aView.pinObjc.topValue(10);
6868
//expect(Pin.lastWarningText).to(contain(@"PinLayout commands have been issued without calling the 'layout()' method to complete the layout"));
6969
});
7070

7171
it(@"using Pin.logMissingLayoutCalls set to false", ^{
7272
Pin.logMissingLayoutCalls = false;
73-
[[[aView pinObjc] top:10] layout];
73+
aView.pinObjc.topValue(10).layout();
7474
expect(@(aView.frame)).to(equal(@(CGRectMake(40, 10, 100, 60))));
7575
expect(Pin.lastWarningText).to(beNil());
7676
});
7777

7878
it(@"check the access to PinLayout methods from objective-c", ^{
79-
[[[rootView pinObjc] wrapContent] layout];
80-
[[[rootView pinObjc] wrapContentWithType:WrapTypeVertically] layout];
81-
[[[rootView pinObjc] wrapContentWithInsets:UIEdgeInsetsMake(0, 0, 0, 0)] layout];
82-
[[[rootView pinObjc] wrapContentWithType:WrapTypeAll insets:UIEdgeInsetsMake(0, 0, 0, 0)] layout];
83-
[[[rootView pinObjc] wrapContentWithPadding:10] layout];
84-
[[[rootView pinObjc] wrapContentWithType:WrapTypeHorizontally padding:10] layout];
79+
rootView.pinObjc.wrapContent().layout();
80+
rootView.pinObjc.wrapContentInsets(UIEdgeInsetsMake(0, 0, 0, 0)).layout();
81+
rootView.pinObjc.wrapContentTypeInsets(WrapTypeAll, UIEdgeInsetsMake(0, 0, 0, 0)).layout();
82+
rootView.pinObjc.wrapContentPadding(10).layout();
83+
rootView.pinObjc.wrapContentTypePadding(WrapTypeHorizontally, 10).layout();
8584
});
8685
});
8786
});

docs/objective_c.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ When using the Objective-c interface, the `layout` method must be called explici
5050
view.pin.width(100)
5151
5252
// Objective-c
53-
view.pinObjc.width().layout();
53+
view.pinObjc.width(100).layout();
5454
```
5555

0 commit comments

Comments
 (0)