You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NYTPhotoViewerDataSource has NS_ASSUME_NONNULL_BEGIN, and in definition of indexOfPhoto:(id <NYTPhoto>)photo, photo is assumed to be non null. However, property currentlyDisplayedPhoto in NYTPhotosViewController is declared as nullable and in NYTPhotosViewController::setCurrentlyDisplayedViewController there is the following call [self.dataSource indexOfPhoto:self.currentlyDisplayedPhoto], which sometimes calls indexOfPhoto with nil.
The problem is due to NS_ASSUME_NONNULL_BEGIN Swift translates indexOfPhoto delegate method to func index(of photo:NYTPhoto) -> Int, and there is no way to check for nil. The only workaround is to call some objc method that allows checking for nil.
I'm not sure if the project is still maintained, but hopefully it is and it would be nice if somebody could fix this issue.
The text was updated successfully, but these errors were encountered:
NYTPhotoViewerDataSource
hasNS_ASSUME_NONNULL_BEGIN
, and in definition ofindexOfPhoto:(id <NYTPhoto>)photo
,photo
is assumed to be non null. However, propertycurrentlyDisplayedPhoto
inNYTPhotosViewController
is declared as nullable and inNYTPhotosViewController::setCurrentlyDisplayedViewController
there is the following call[self.dataSource indexOfPhoto:self.currentlyDisplayedPhoto]
, which sometimes callsindexOfPhoto
with nil.The problem is due to
NS_ASSUME_NONNULL_BEGIN
Swift translatesindexOfPhoto
delegate method tofunc index(of photo:NYTPhoto) -> Int
, and there is no way to check for nil. The only workaround is to call some objc method that allows checking for nil.I'm not sure if the project is still maintained, but hopefully it is and it would be nice if somebody could fix this issue.
The text was updated successfully, but these errors were encountered: