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

Bugfixes: bounds checks, don't retain data source #227

Merged
merged 3 commits into from
Feb 3, 2017

Conversation

cdzombak
Copy link
Contributor

@cdzombak cdzombak commented Feb 2, 2017

This fixes two bugs I found while rewriting the Swift example (#223):

  • The PhotosViewController should not retain its data source. This will lead trivially easily to retain cycles which would be difficult to manage.
  • The PhotosViewController was asking its data source for nonsensical bounds when scrolling from the first photo. I've added a check to avoid that, and while I was there I added a check to prevent the viewer from skipping back to the first photo when the data source returns NSNotFound for a photo.

@craighowarth
Copy link
Contributor

👍

@cdzombak cdzombak merged commit 369d70e into develop Feb 3, 2017
@cdzombak cdzombak deleted the fix/bounds-and-nullability branch February 3, 2017 15:40
shagedorn pushed a commit to iosphere/NYTPhotoViewer that referenced this pull request Jul 25, 2017
* develop: (50 commits)
  Add initial contributing guidelines
  style: remove unnecessary Array initializer call
  Remove no-longer-necessary bounds check in Swift Example
  style: make Swift-Example style tweaks, requested by @Veronique
  Add README documentation on Example project dependency management
  Update Changelog for nytimes#227
  fix: PhotosViewController shouldn’t retain its data source
  fix: add bounds checks before asking data source for a photo
  Reimplement Swift example
  fix: include single photo data source in umbrella header
  Use more modern `nullable` instead of `_Nullable`
  example: Improve caption for photo with a loading spinner
  example: Improve data-source-swap demo
  example: Use a more obvious demo for custom maximum zoom scale
  docs: add missing copyright in headers
  Update LICENSE to specify (c) through 2017
  docs: add this feature to CHANGELOG
  docs: clarify how NYTPhoto equality is determined
  fix: use proper equality checks
  style: correct spacing in Example ViewController
  ...
benguild pushed a commit to benguild/NYTPhotoViewer that referenced this pull request May 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants