Masonry icon indicating copy to clipboard operation
Masonry copied to clipboard

v 1.1.0 safeAreaLayoutGuide Crsah

Open nogeo opened this issue 6 years ago • 20 comments

this ok: make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop); make.left.equalTo(self.view.mas_safeAreaLayoutGuideLeft); make.right.equalTo(self.view.mas_safeAreaLayoutGuideRight);

this crash: make.top.left.right.equalTo(self.view.mas_safeAreaLayoutGuide);

why?

nogeo avatar Oct 13 '17 04:10 nogeo

so sorry, safeAreaLayoutGuide is my PR. by default, self.view.mas_safeAreaLayoutGuide is self.view.mas_safeAreaLayoutGuideBottom

cntrump avatar Oct 16 '17 07:10 cntrump

Do not understand why this change, with the use of examples do not match, easy to read down Provided examples of use   make.edges.equalTo (self.view.mas_safeAreaLayoutGuide) .inset (10.0);   make.right.bottom.equalTo (self.view.mas_safeAreaLayoutGuide);   make.width.height.equalTo (self.view.mas_safeAreaLayoutGuide) .sizeOffset (CGSizeMake (- 40.0, - 40.0));

CDYeah avatar Oct 17 '17 06:10 CDYeah

@CDYeah you are right, it is my mistake

cntrump avatar Oct 17 '17 07:10 cntrump

#473 fixed this issue.

iwill avatar Oct 17 '17 12:10 iwill

When release new version? I see the Demo define is OK

  • (MASViewAttribute *)mas_safeAreaLayoutGuide { return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeNotAnAttribute]; } but in release 1.1.0 version is
  • (MASViewAttribute *)mas_safeAreaLayoutGuide { return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; }

ayang229 avatar Nov 12 '17 00:11 ayang229

@robertjpayne We need release a new version for iOS 11 and iPhone X.

iwill avatar Nov 12 '17 04:11 iwill

is this just a mistake?

sclcoder avatar Nov 20 '17 12:11 sclcoder

@iwill when did a new version for iOS 11 and iPhone X will release? Now 1.1.0 will crash

wuweili avatar Nov 27 '17 02:11 wuweili

@wuweili Sorry, I'm also waiting for it ...

iwill avatar Nov 27 '17 04:11 iwill

I'm using a gist temporarily which works fine.

iwill avatar Nov 27 '17 05:11 iwill

I see the source code:

mas_safeAreaLayoutGuide is isEqual to mas_safeAreaLayoutGuideBottom

so if you use mas_safeAreaLayoutGuide to code:

make.edges.equalTo(self.view.mas_safeAreaLayoutGuide);

it mean :

make.edges.equalTo(self.view.mas_safeAreaLayoutGuideBottom);

so it crash

to resolve , you can use:

make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop); make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom); make.left.equalTo(self.view.mas_safeAreaLayoutGuideLeft); make.right.equalTo(self.view.mas_safeAreaLayoutGuideRight);

instead

LINAICAI avatar Mar 22 '18 03:03 LINAICAI

why demo is ok?

yimao009 avatar Jun 25 '18 01:06 yimao009

@yimao009 because demo uses the latest version with this fix. The latest cocoapods version has this problem. Just compare UIView+MASAdditions.m file in your project and from github. https://github.com/SnapKit/Masonry/blob/master/Masonry/View%2BMASAdditions.m#L132

pingwinator avatar Jul 19 '18 13:07 pingwinator

@cloudkite Could you bump version? or I could do it and prepare a pull request.

pingwinator avatar Jul 19 '18 14:07 pingwinator

#528 @yimao009, as temporally solution, try to add in your pod file

pod 'Masonry', :git => 'https://github.com/pingwinator/Masonry.git'

pingwinator avatar Jul 19 '18 14:07 pingwinator

I fixed the crash for almost a year. Could you please release a new version with #473 ??? @robertjpayne @cloudkite @nickynick

iwill avatar Jul 20 '18 07:07 iwill

@iwill I did pull request with bumped version (+fixed travis). But also required a new version in cocoapods repo. #528

pingwinator avatar Jul 20 '18 07:07 pingwinator

@robertjpayne @cloudkite @nickynick Is it possible to have a new patched released version of Masonry with this fix? It has been almost 2 years now since this issue was raised

jwilliams-handy avatar Jul 11 '19 20:07 jwilliams-handy

@jwilliams-handy as temporally solution, you could use my fork. just add pod 'Masonry', :git => 'https://github.com/pingwinator/Masonry.git' into your podfile

pingwinator avatar Jul 11 '19 20:07 pingwinator

Thanks @pingwinator. I’m currently using the fork temporarily but would love for the development team to push up the new version to master so was trying to just echo sentiments.

jwilliams-handy avatar Jul 12 '19 14:07 jwilliams-handy