Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new iOS 11 api adjustedContentInset support #1020

Closed
wants to merge 9 commits into from

Conversation

yiplee
Copy link
Contributor

@yiplee yiplee commented Nov 21, 2017

adopt adjustedContentInset instead of contentInset on iOS 11

Checklist

  • All tests pass. Demo project builds and runs.
  • I added tests, an experiment, or detailed why my change isn't tested.
  • I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes.
  • I have reviewed the contributing guide

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

@yiplee has updated the pull request.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@rnystrom
Copy link
Contributor

Awesome! Would love a change log entry and even a unit test for this.

Sent with GitHawk

@facebook-github-bot
Copy link
Contributor

@yiplee has updated the pull request. View: changes

@facebook-github-bot
Copy link
Contributor

@yiplee has updated the pull request. View: changes

@facebook-github-bot
Copy link
Contributor

@yiplee has updated the pull request. View: changes

@facebook-github-bot
Copy link
Contributor

@yiplee has updated the pull request. View: changes

@yiplee
Copy link
Contributor Author

yiplee commented Nov 21, 2017

Change log entry and unit test added :)

@rnystrom rnystrom added this to the 3.2.0 milestone Nov 21, 2017
Copy link
Contributor

@rnystrom rnystrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last thing! Can you run the Examples/pod_setup.sh script to make sure the examples projects have your new file included?

@yiplee
Copy link
Contributor Author

yiplee commented Nov 21, 2017

screen shot 2017-11-22 at 01 37 48

Yes, the new files have been included by pod. @rnystrom

@rnystrom
Copy link
Contributor

@yiplee are the examples building for you?

@facebook-github-bot
Copy link
Contributor

@yiplee has updated the pull request. View: changes

@facebook-github-bot
Copy link
Contributor

@yiplee has updated the pull request.

@iglistkit-bot
Copy link

iglistkit-bot commented Nov 22, 2017

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

Copy link
Contributor

@rnystrom rnystrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yiplee last change request from me!

I thought about this more over the holidays. There's a chance that this will change behavior and introduce bugs when people explicitly want the contentInset and not the adjusted inset.

Could we instead provide a new API on the context, something like:

@protocol IGListCollectionContext
// ...
- (UIEdgeInsets)adjustedContainerInset;
// ...
@end

That way people can choose which they need w/out breaking any existing solutions?

@yiplee
Copy link
Contributor Author

yiplee commented Nov 28, 2017

@rnystrom I agree with you. But the bug will remain exist if people forget to replace containerInset by adjustedContainerInset in their codes. And in my opinion, when people call context's containerInset, they expect context to return the real content inset applied to collectionView.

@rnystrom
Copy link
Contributor

rnystrom commented Dec 7, 2017

@yiplee though even more about this, I think the only way to go is with a separate API. I found a few places that will break in Instagram if we make this change, so that’s a blocker.

Would you be ok making this a separate API? Thanks!!

Sent with GitHawk

@yiplee
Copy link
Contributor Author

yiplee commented Dec 7, 2017

@rnystrom It's OK. I will update the PR right now. 😄

@facebook-github-bot
Copy link
Contributor

@yiplee has updated the pull request. View: changes

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rnystrom has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@yiplee has updated the pull request. View: changes, changes since last import

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rnystrom has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants